Problems a with a unit without form in Delphi 7

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
doctec
Posts: 8
Joined: Mon Feb 14, 2005 4:17 pm
Location: Argentina
Contact:

Problems a with a unit without form in Delphi 7

Post by doctec »

Hi,

I'm working with Delphi 7 and Tsilang Components Suite 5.3.2.
I have a unit without form called License. This unit have four constant strings:

err1000= 'Ivalid license file';
err1001= 'License CRC failed';
(.......)

I go to Tsilang Expert --> File --> Const Section --> Without Form.
I select unit called "License" and Select the Main Form with Tsilang.

Tsilang generates in the license unit the following code:

err1000: string = '';
err1001: string = '';

And this code in the Main Form:

procedure TDoc_MainForm.UpdateStrings;
begin
err1001 := siLang1.GetTextOrDefault('strerr1001');
err1000 := siLang1.GetTextOrDefault('strerr1000');
(....)

I translate the strings in the Translation Editor....

But when I press Ctrl + F9 to compile, I receive the following error in the main form:

Undeclared Identifier: 'err1001'
Undeclared Identifier: 'err1000'

Thats because there is no const declaration in the main form for this constant.

I will appreciate any help about this issue.

Regards
Marcelo
isiticov
Site Admin
Posts: 2383
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Just add unit License to uses clause of main form unit.
doctec
Posts: 8
Joined: Mon Feb 14, 2005 4:17 pm
Location: Argentina
Contact:

Post by doctec »

Excelent! it's working now.
Thanks a lot Isiticov for your help.

Just a suggestion, It would be great that Tsilang Expert add the unit to the uses clause automatically.

Regards.
Marcelo
Post Reply