strings

All announcements, questions and issues related to the TsiLang Components Suite.
Post Reply
Angus
Posts: 21
Joined: Sun Dec 10, 2006 11:39 pm
Location: New Zealand

strings

Post by Angus »

Hi Ivor,

(Borland VCL C++ V6.0 user)

We don't seem to be getting an expected result for strings.
Typically we declare strings as
const AnsiString var = "hi var";
or
AnsiString var = "hi var";

neither of which are being pulled when used with run Source>With Form
and Const > With Form

While these two funcs do pull some lines of text used in dynamic sql
creation for TIBQuery, it misses all the rest of our strings...as above.

What am i missing please?

thanks... angus.

ps - the help on this section in the siManual.pdf on page 62/63, doesn't help as the replacement code indicated looks identical to the problem code and has no type for us C coders.
Cheers angus
isiticov
Site Admin
Posts: 2387
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hi Angus,
Unfortunately, it is not possible to translate string constants in C++Builder automatically. But you can modify your code a little and then TsiLang Expert will do the rest of work:
1.You need to leave the declarations for these constants in place but move initialization code to some function. For example:

Code: Select all

AnsiString sSomeString;
char * sAnotherString;
void StringsInitialization();
{
  sSomeString = “Some string value 1”;
  sAnotherString = “Some string value2”;
}
2.After this just use TsiLang Expert menu File | Source | With Form and translate these strings as usual hard-coded strings used in your source.

Please note: Example code provided above are for reference only! For your particular case it could be different.

P.S. It looks like the latest C++ packages were incorrectly compiled under BCB6. There must be no Const Section menu item in Expert. We're preparing the updated build right now.
Best regards,
Igor Siticov.
Angus
Posts: 21
Joined: Sun Dec 10, 2006 11:39 pm
Location: New Zealand

Post by Angus »

Hi Igor,
thank for your reply.

Has version 6.2 changed? The reason i ask is that the last time i ran tsilang expert, a number of strings within the code were correctly updated with ids_
However, running the new code, nothing was found.

While the solution you've provided may work, it will be tedious to infill all strings (const or not) using the functor you've mentioned for forms that have hundreds possibly thousands of string declarations. Any other workaround for regular non const defined strings - or is down to individual replacement with ids_ for each string it he form?

angus.
isiticov
Site Admin
Posts: 2387
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hi Angus,

Actually, it just wasn't properly compiled. The C++Builder command line compiler didn't activate BCB define and as result all C++Builder 5 and 6 packages were compiled as for Delphi. So TsiLang Expert searches for Pascal style strings enclosed with single quotes.
If you would have Full Source license you could just re-build the packages on your side.

We will try to find additional way to translate constants in C++ code but I can't promise anything as this is realy quite difficult because of nature of C++ and possible syntax used.
Best regards,
Igor Siticov.
Angus
Posts: 21
Joined: Sun Dec 10, 2006 11:39 pm
Location: New Zealand

Post by Angus »

Hi Igor,
I don't have a full source license, but i do have a binary license.

Options:
1. You let me have a download link for the 'properly' compiled bcb6 'release' version (as mentioned in separate email - the current bcb 6 release comes up as trial version even though i have paid, and my year expires in December)

2. I go back to using the older version - not happy about this option really as i'd like to take advantage of any bug fixes.

3. You let me have the source code and i do a rebuild.

cheers Angus.
isiticov
Site Admin
Posts: 2387
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hi Angus,

Yesterday we've released 6.2.0.1 update and it contains this fixed. Please download registered version from our site.
Best regards,
Igor Siticov.
Post Reply