Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty last line not recognized by ALINES()
Message
From
24/05/2003 11:27:19
 
 
To
24/05/2003 08:28:56
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00792524
Message ID:
00792551
Views:
21
>Peter,
>
>What's the difference between
>
>lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF + ""
>and
>lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF
No difference.

>
>The only way to indicate an empty line is to append crlf as in
>
>lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF + "" + ccCRLF
>
> or
>lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF + ccCRLF
Suppose the last item is determined by some string variable. The result of ALINES() will differ depending on whether or not the variable is empty.
lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF + lcSomeVar
This is troublesome, also because the resulting array is redimensioned even if was originally longer. Do something like
dimension laLine[4]
laLine = ''
alines( laLine, lcC )
? alen( laLine )
The array will shrink back to 3 elements if the last line in lcC is empty.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform