Forums
Create Constructor - Printable Version

+- Forums (http://mitov.com/forum)
+-- Forum: VCL Components (/forum-6.html)
+--- Forum: InstrumentLab (/forum-31.html)
+--- Thread: Create Constructor (/thread-3002.html)



Create Constructor - ADemers - 07-31-2013 06:04 AM

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;


RE: Create Constructor - Dave - 07-31-2013 08:13 PM

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


RE: Create Constructor - ADemers - 07-31-2013 10:21 PM

(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 ?


RE: Create Constructor - Dave - 07-31-2013 11:54 PM

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