Page 1 of 1

Source strings problem

Posted: Tue Jan 21, 2003 5:37 pm
by Malcolm
Doing my first project using D6 Pro and TsiLang 5.2.1

All was going well until I came to strings in the source code.
Some strings are being returned as empty strings by siLang1.GetTextOrDefault and I can't see where I am going wrong.

The ones returned OK are always OK, the others are always empty, so it is consistent.

The problem arises even in the same procedure of a unit, some are OK others blank. I have made sure that each unit has a unique series of IDS_ numbers.

Can there be a problem if one unit 'uses' another and .GetText.. looks in the wrong form?

Any pointers would be most welcome, please.

Posted: Tue Jan 21, 2003 6:01 pm
by Malcolm
Ah! The problem seems to be .GetText.. is looking in the 'wrong' unit.

I duplicated the 'problem' strings in the other unit (a Data Module) and it now works.

Seems to be that where a unit uses other units .GetText looks in the .dfm of the 'active' unit (or something like that).

Hmm, that's going to be a problem - unless I can prefix the IDS_# with a unit name.

... off to try it .....

Posted: Tue Jan 21, 2003 6:14 pm
by Malcolm
OK, cracked it.
Funny how one always finds the solution *after* asking someone else!

I had two siLang components with same name, Doh!

Posted: Wed Jan 22, 2003 7:48 am
by isiticov
We're glad to see that you finally found the origin of problem by yourself. :-)