Hello Igor
Delphi D10.
I had a list of about 75 string constants in a unit and tried to translate them. Mostly it worked fine and converted them to string variables.
However, a few of the original declarations had been wrapped by my source code formatter as follows:
mylongerstringconstant =
'a string of about 70 .... 80 characters';
These items either vanished from my source or the code generated was incomplete or invalid. Can you reproduce this?
No big deal - I just fixed my source .. but ..
Malcolm
Problem with constants declared with line wrap?
-
- Posts: 65
- Joined: Thu May 08, 2008 7:46 pm
Re: Problem with constants declared with line wrap?
I got two other forms of the same problem (in Delphi 7 with version 6.2.2).Malcolm wrote:... a few of the original declarations had been wrapped by my source code formatter as follows:These items either vanished from my source or the code generated was incomplete or invalid...Code: Select all
mylongerstringconstant = 'a string of about 70 .... 80 characters';
If a constant is split on two lines, the generated source code can be wrong.
Expected:
Code: Select all
SimpleConst = 'All on one line';
Code: Select all
SimpleConst: string = ''; (* All on one line *)
First problem:
Code: Select all
ConstOnTwoLines = 'First line'+
'Second lines';
Code: Select all
ConstOnTwoLine: string = 'First line'+
'Second line';
The generated code works and both lines are inserted in the TsiLang Container.
However, this is a minor problem since one can update the source string instead of the TsiLang Container.
Second Problem:
Code: Select all
ConstWithPlusOnSecondLine = 'First line'
+'Second line';
Code: Select all
ConstWithPlusOnSecondLine: string = ''; (* First line *)
+'Second line';
Moreover, that second line is not inserted in the TsiLang Container.
It seems that all those problems come from an incomplete Syntax parsing.
Jean-Paul
Jean-Paul Brassard
Quebec, Canada
Quebec, Canada