Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Similar to ALLTRIM()?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00957249
Message ID:
00957328
Views:
31
Hello Hugo,

The example is useful and almost correct. Here how I tested it:
cText1 = 'Text1' + space(5)
cText2 = 'Text2'
? cText1 + cText2   && returns 'Text1     Text2'
? LEN(cText1 + cText2)   && returns 15
? cText1 - cText2   && returns 'Text1Text2     '
? LEN(cText1 - cText2)   && returns 15
While it is almost useless for output intended for reports, it would seem to be useful for index expressions. For example, instead of
INDEX ON  PADR(TRIM(lastname)+TRIM(firstname),25)  TO blahblah
it would be simpler (and much more readable) to
INDEX ON  lastname-firstname  TO blahblah
I have read messages here and elsewhere that index expressions do not _have_ to be a constant length, but I've always followed that practice since my dBaseII days.

>The minus is a concatenation operator for 2 strings, but, it is different of the plus operator because it removes all trailing blank spaces from the first operand and put them back at the end of the result, thus the lenght of the result is the same as the sum of the to operands, I better leave english explanations and put code examples :)
>
>
>cText1 = 'Text1' + space(5)
>cText2 = 'Text2'
>
>cText1 + cText2 -> 'Text1     Text2'
>cText1 + cText2 -> 'Text1Text2     '
>


HTH,
Randy Bosma
VFP - Because life is too short to code in something else...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform