SOLVED using an alternative method.
Hi,
I am trying to write a function that will create and then return a TLABEL object - for use in easier label creation.
This is the function:
Simba Code:
Function CreateLabel(Parent : TFORM; Top : Integer; Left : Integer; Caption : String) : TLABEL;
var
TmpLabel : TLABEL;
begin
TmpLabel := TLABEL.Create(Parent);
TmpLabel.Top := Top;
TmpLabel.Left := Left;
TmpLabel.Caption := Caption;
Result := TmpLabel;
end;
This is the error:
Code:
[Error] (156:63): Internal error (20) at line 155
Compiling failed.
This is the line that is causing the error (155):
Simba Code:
UsernameLabel = CreateLabel(FrmDesign, 60, 370, 'Username:');
The UsernameLabel TLABEL is defined globally as follows:
Simba Code:
var
// Labels
UsernameLabel : TLabel;
Any help would be much appreciated!