Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Packages and Libraries / Re: Installing RX library in Lazarus v.2.0.6 (again)
« Last post by wp on Today at 10:46:36 am »
Installation of the OPM-rx into Laz 2.0.6 crashed with message 'rxToolbar.pas: Identifier not found "sTop"'. I found "sTop" in unit rxdconst - but this was taken from the rx trunk that I have on my disk, too. After cleaning up package paths (removing rx trunk directory in "Package" > "Package links") I got this running. I could fix the installation for Laz trunk in the same way.

There is still an issue with rx, although not with the OPM version, but with the trunk version. Trying to compile rxnew.lpk with Laz 2.0.6 fails in RxDBBGrid because the grid property OnUserCheckboxImage does not exist in the ancestor. It does exist in Laz trunk, but not in Laz 2.0.6.

2
Databases / Re: Update form after an edit
« Last post by MarkMLl on Today at 10:35:32 am »
As I see it you have a choice. The crude way of doing it is to use privileged information (i.e. state in the single program that's doing all the work) to recognise that something's changed, and to rerun the query that populates the main grid on screen.

The less-crude way is to use a database that has a notification/event facility (PostgreSQL, Firebird) and to make sure that when a row in the database is changed the program receives an event warning it that it's got to reload the grid.

MarkMLl
3
Networking and Web Programming / Re: TMS package "pas2js_rtl" not found
« Last post by Handoko on Today at 10:33:42 am »
I never tried TMS Web Core.

But is what you usually need to do for installing a package:

1. Lazarus main menu > Package > Open Package File
2. On the package windows > Compile, then Use > Add to project
3. It should be shown on the Project Inspector
4
I got tetris so far that it removes rows, but when a row is removed, existing blocks won't drop down anymore, they hang still in the air.

Sure, it won't automatically drop. You need to write a loop to do it. The pseudo code can be something like this:

procedure RemoveLine(Index: Integer);
var
  i, j: Integer;
begin

  If Index >= (MaxRow - 1) then Exit;
  If Index < 0 then Exit;

  for i := Index to MaxlRow-1 do
    for j := 0 to MaxColumn do
      GameWord[i, j] := GameWorld[i+1, j];

end;
5
Networking and Web Programming / TMS package "pas2js_rtl" not found
« Last post by kotakomputer on Today at 10:19:40 am »
I ask to this forum because I'm not buy TMS Web Core yet, so I can't post to their forum :)


After install TMS Web Core and pas2js, then when I create new project "TMS Web Core Application" I got error
Code: Text  [Select]
  1. TMS package "pas2js_rtl" not found:
  2. "C:\tmssoftware\TMS WEB Core RSXE12\Core Source\RTL\pas2js_rtl.lpk"
  3.  

I have open and compile C:\lazarus\pas2js\packages\rtl\pas2js_rtl.lpk, but still error. Compiler options already set to:
- C:\tmssoftware\TMS WEB Core RSXE12\Compiler\pas2js.exe

Any idea to fix this issue?
Should I just copy C:\lazarus\pas2js\packages\rtl\pas2js_rtl.lpk to C:\tmssoftware\TMS WEB Core RSXE12\Core Source\RTL ?
6
Mac OS X / Re: Freepascal install on macOS 10.15 Catalina
« Last post by madref on Today at 10:17:03 am »
Have you tried to install the fpc-3.0.4a.intel-macosx.dmg ?That's what helped me on MacOS Majave
7
Mac OS X / Re: fpc cannot installed on MacOS Catalina
« Last post by madref on Today at 10:14:21 am »
Have you tried to install the fpc-3.0.4a.intel-macosx.dmg ?


That's what helped me on MacOS Majave
8
Databases / Re: Update form after an edit
« Last post by madref on Today at 10:08:02 am »
This is the code to edit.
It opens the form to edit and then comes backt to it's routine.
Code: Pascal  [Select]
  1. procedure TForm_Wedstrijd_Overzicht.BT_GameEditClick(Sender: TObject);
  2. var
  3.   wID: Integer;
  4.   fWI: TForm_WedstrijdInformatie;
  5.   c: TGridColumn;
  6.   F: TField;
  7.  
  8.  
  9. begin
  10.   if TQ_Wedstrijden.RecordCount =  0 then begin
  11.     Form_Message.MsgWindow(mThink, bOk,
  12.       'There are no games in the database.' + sCrLf +
  13.       'So no game can be edited !!', Prgnaam);
  14.     Exit;
  15.   end;  // if
  16.   wID := StrToInt (Grid_wedstrijden.Cells[0, Grid_wedstrijden.Row]);
  17.   fWI := TForm_WedstrijdInformatie.Create(Self);
  18.   try
  19.     fWI.ShowWedstrijd(wID);
  20.   finally
  21.     fWI.Free;
  22.   end;
  23.   TQ_Wedstrijden.Refresh;
  24.   TQ_Wedstrijden.Locate('Wed_ID', wID, []);
  25.   for wID := 0 to Grid_wedstrijden.Columns.Count - 1 do begin
  26.     c := Grid_wedstrijden.Columns[wID];
  27.     F := TField(c.Tag);
  28.     Grid_wedstrijden.Cells [wID + Grid_wedstrijden.FixedCols, Grid_wedstrijden.Row] := F.AsString;
  29.   end;
  30. end;     // BT_GameEditClick
  31.  


Notice that the 'Screen Before Edit' has the correct sorting and the 'Screen After Edit' not
9
I think that if I were doing that I'd take the naive approach of slapping a TDrawGrid onto the form and manipulating rows and columns relative to that.

However I make absolutely no claim to being the most experienced graphics programmer around here.

MarkMLl
10
hi all,

I've searched for an hour now, and no result so I decided to ask you guys.

I'm building a tetris clone for my internship, and I divided my field into a twodimensional array. if a block lands, that coordinate (x,y) gets turned from 0 to 1.
I got tetris so far that it removes rows, but when a row is removed, existing blocks won't drop down anymore, they hang still in the air.

I'm thinking of giving all Boolean 1 blocks a +1 on the vertical coordinate, but I cant get it to work and I can't find relevant info for it (or i'm reading over it, since my experience with free pascal is 2 months.)

the most important pieces of code:
Code: Pascal  [Select]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, LCLType,math,
  9.   StdCtrls;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     darkblue: TImage;
  17.     fallingblock: TImage;
  18.     Label1: TLabel;
  19.     lightblue: TImage;
  20.     green: TImage;
  21.     blockfalling: TTimer;
  22.     move: TTimer;
  23.     yellow: TImage;
  24.     orange: TImage;
  25.     red: TImage;
  26.     purple: TImage;
  27.     horizontal: tlabel;
  28.     vertical: tlabel;
  29.     procedure blockfallingTimer(Sender: TObject);
  30.     procedure FormCreate(Sender: TObject);
  31.     procedure FormKeyDown(Sender: TObject; var Key: word; Shift: TShiftState);
  32.     procedure moveTimer(Sender: TObject);
  33.     procedure createblock(b: integer);
  34.     procedure pickblock();
  35.   private
  36.     blockwait, bottomcheck, movement, x, y, shapes: integer;
  37.     start,filled: boolean;
  38.     img : Timage;
  39.     location: array[0..10, 0..20] of integer;
  40.     arrfilled: array[0..10, 0..20] of boolean;
  41.     arrfilledimg: array[0..10, 0..20] of timage;
  42.   public
  43.  
  44.   end;
  45.  
  46. //irrelevant code here
  47.  
  48. procedure tform1.createblock(b:integer);
  49. var
  50.   a,drop:integer;
  51.   fullrow:boolean;
  52. begin
  53.   x:=5;
  54.   y:=0;
  55.   img:= timage.create(application);
  56.   img.top:=y*50;
  57.   img.left:=x*50;
  58.   img.visible:=true;
  59.   img.stretch:=true;
  60.   img.width:=50;
  61.   img.height:=50;
  62.   img.enabled:=true;
  63.   img.transparent:=true;
  64.   img.Parent:=fallingblock.parent;
  65.   pickblock();
  66.   fallingblock:=img;
  67.  
  68.   fullrow:=true;
  69.   for a:=0 to 9 do
  70.   begin
  71.   if  arrfilled[a,b]= false then fullrow:=false;
  72.   end;
  73.   if fullrow then
  74.   begin
  75.   for a:=0 to 9 do
  76.     begin
  77.     arrfilled[a,b]:=false;
  78.     arrfilledimg[a,b].visible:=false;
  79.   end;
  80.    {for drop:=0 to 9 do
  81.      begin
  82.       if a=1 then
  83.       begin
  84.       b:=0;
  85.       b+1:=1;
  86.       a:=0;
  87.       end;
  88.       for drop:=0 to (b-1) do
  89.       begin
  90.       //b has to go down 1* (b+1) but how?
  91.       //how do i separate the 1/0's in my entire array?
  92.       //maybe use locate?
  93.       end;
  94.      end;}
  95.   end;
  96. end;
  97. procedure TForm1.blockfallingTimer(Sender: TObject);
  98. begin
  99.  
  100. horizontal.caption:=x.tostring;
  101. vertical.caption:=y.tostring;
  102.   if (y>=19) or (arrfilled[x,(y+1)]=true) then
  103. begin
  104.   arrfilled[x,y] := true;
  105.   arrfilledimg[x,y] := fallingblock;
  106.  
  107.   createblock(y);
  108. end
  109. else
  110. begin
  111. y:=y+1;
  112. fallingblock.top := 50 * y;
  113. end;
  114. end;
  115.  
Pages: [1] 2 3 ... 10