SiComponents Home Page SiComponents Forums
Here you will be able to get help and share your experience
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compilation problem after CONST translation

 
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite
View previous topic :: View next topic  
Author Message
MainSoft



Joined: 14 Feb 2005
Posts: 52

PostPosted: Thu Feb 17, 2005 1:47 pm    Post subject: Compilation problem after CONST translation Reply with quote

Hi again,

Sorry but I have another one to report.

I have a unit A with no form containing a big CONST section. Only a part of the strings declared there have to be translated. So I deleted the non translatable strings in the editor and generated the code from TsiLang Expert. Since the unit has no form, I used my main form as a target.

In unit A, declarations like
scLangId = 'langid';
were changed to
scLangId : string = '';
while the following code was added to my main form

scLangId := siLang.GetTextOrDefault('strscLangId');

However, this didn't compile because in unit A, these declarations were still residing in the CONST section. So the statement above could not compile because the left member cannot be assigned (it's a CONST).

The problem was solved by manually moving the offending declarations in unit A from the CONST section to a VAR section. However, this should be done automatically

Regards.
Back to top
View user's profile Send private message Visit poster's website
isiticov
Site Admin


Joined: 21 Nov 2002
Posts: 2103

PostPosted: Thu Feb 17, 2005 2:06 pm    Post subject: Reply with quote

Thank you for your report.
If we would move automatically strings from declration places this may cause a lot of problem for all of us. Adding {$J+} compiler directive at the beginning of the unit or activating "Assignable typed constants" compiler option for project would solve the problem without moving anything.
Back to top
View user's profile Send private message
MainSoft



Joined: 14 Feb 2005
Posts: 52

PostPosted: Thu Feb 17, 2005 2:38 pm    Post subject: Reply with quote

isiticov wrote:
If we would move automatically strings from declration places this may cause a lot of problem for all of us. Adding {$J+} compiler directive at the beginning of the unit


Correct. Actually, it is just necessary to bracket the modified declarations with a {J+} / {J-} pair, which could be done automatically. However, the current state of the $J directive should be taken into account, which might complicate matters somewhat.

Thanks.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    SiComponents Forums Forum Index -> TsiLang Components Suite All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by p h p B B  © 2001, 2005 p h p B B  Group