Source strings problem

This forum designated to discuss the TsiLang Components Suite.
Post Reply
Malcolm
Posts: 109
Joined: Tue Jan 21, 2003 5:18 pm
Location: Scotland

Source strings problem

Post 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.

Malcolm
Posts: 109
Joined: Tue Jan 21, 2003 5:18 pm
Location: Scotland

Post 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 .....

Malcolm
Posts: 109
Joined: Tue Jan 21, 2003 5:18 pm
Location: Scotland

Post 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!

isiticov
Site Admin
Posts: 2265
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

We're glad to see that you finally found the origin of problem by yourself. :-)

Post Reply