When you have to construct long strings combining different types of data using many functions in between, it maybe better and easier to use the "Format()" functions instead of using "+" signs.
'My name is ' + sName + ' and I am '
+ IntToStr( 16 )
+ ' years old'
+ IntToStr( 16 )
+ ' years old'
Listing #1 : Delphi code. Download strcc (0.19 KB).
Format(
'My name is %s and I am %d years old',
[ sName, 16 ] )
'My name is %s and I am %d years old',
[ sName, 16 ] )
Listing #2 : Delphi code. Download strcc2 (0.19 KB).