Forums

Full Version: Create Constructor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

ADemers

Hi, did i miss something.
I have install 5.0.3 on my delphi Xe and when I code something like
a := TIlSegmentText.Create(nil);

I receive an error at runtime and with Trace step by step at this line the system ask for ILSegmentText.pas ( Source file not found )

Can you help me please ?Huh

I will be more specific.

Type Champs = record
Nom : string;
Indexe : Boolean;
TypeChamp : integer; {Mémo, integer, string, float}
Longueur : integer;
Precision : integer;
end;

Type LabelFichier = record
NomSegmentFichier : TIlSegmentText;
NomTable : String;
NombreChamps : integer;
LesChamps : array of Champs;
end;


var TableComplete : array of LabelFichier; /* dynamic table */
var Table1 : TIlSegmentText;

begin
Table1 := TIlSegmentText.create(nil); /* working maybe because the Table1 exist */

SetLength(TableComplete,length(TableComplete)+1);
TableComplete[Indice].NomTable := 'blabla';
TableComplete[Indice].NomSegmentFichier := TIlSegmentText.create(nil);
/* the previous line doesn't work, he ask for the ILSegmentText.pas */
TableComplete[Indice].NomSegmentFichier.Top := 2;
TableComplete[Indice].NomSegmentFichier.Left := 5;
TableComplete[Indice].NomSegmentFichier.Segments.color := ClRed;


end;

Dave

Hi! Are you trying to create an array of ILSegmentText? If you'd want them on a form perhaps exchange 'nil' with 'Form1'?

Regards,
Dave

ADemers

(07-31-2013 08:13 PM)Dave Wrote: [ -> ]Hi! Are you trying to create an array of ILSegmentText? If you'd want them on a form perhaps exchange 'nil' with 'Form1'?

Regards,
Dave

Yes, it's a dymanic array of ILSegmentText. The idea behind it's open a database and show up the table name inside. For those of them how are suppose to be there the ILSegmentText will be green, and for those who are not suppose to be there the ILSegmentText will be Red.

I have try with Form1 and same thing append. Undecided

Can you tell me why he ask for a file he doesn't exist ?

Dave

The compiler likes to show you where the error occured, of course without the source-code it can't but it's still trying. What error do you get? (i don't mean asking for the file)

Regards,
Dave
Reference URL's