Jump to content

Recommended Posts

Posted

Hi Farshad.

 

The first application I have wrote using Unigui was a TicTacToe. Today I have installed unigui 0.85.868 and, for the first time using a 0.85 version, I have tried to recompile my TicTactoe game.

 

The initialisation loop works in desktop mode, but don't worked in web mode. The code is

 

const 
 MAX_TTT = 9;

type
 TMainForm = class(TUniForm)
   Panel1: TUniButton;
   Panel2: TUniButton;
   Panel3: TUniButton;
   Panel4: TUniButton;
   Panel5: TUniButton;
   Panel6: TUniButton;
   Panel7: TUniButton;
   Panel8: TUniButton;
   Panel9: TUniButton;
   procedure UniFormActivate(Sender: TObject);
 private  
   Paineis: array[1..MAX_TTT] of TUniButton;
[...]


69: procedure TMainForm.UniFormActivate(Sender: TObject);
70: var
71:  P: Integer;
72: begin
73:   Randomize;
74:   for P := 1 to MAX_TTT do begin
75:       Paineis[P] := TUniButton(FindComponent('Panel' + IntToStr(P)));
76:       Paineis[P].Tag := P;
77:   end;
78: end;

 

There are a AV in line 76. Debugging shows that FindComponent() is not working and always return nil. The Paineis array shows (nil, nil, nil, nil, nil, nil, nil, nil, nil).

×
×
  • Create New...