Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty last line not recognized by ALINES()
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00792524
Message ID:
00792548
Views:
25
I think that Alines has always been this way, and it does create a discrepency.
lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF + ""

with Memlines(), you get four
with alines(), you get three

This has bitten me good on a couple of equations. Upgrade my code to use alines() and suddenly my app starts throwing run time errors because it attempts to access beyond end of the array when last fragment in original line is empty


>Hi to all,
>
>Here's a piece of code that shows a puzzling result, at least puzzling for me. A FOUR LINES string is copied to an array by ALines(). However, the array length is only 3! This happens if the last 'line' is empty.
>
>The documentation doesn't mention any special handling of a last empty line. Is this a bug? If it is, then I'll send a report to the VFPteam.
>
>
>#define ccCRLF	chr( 13 ) + chr( 10 )
>
>local lcC
>local array laLine[1]
>
>lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF + ""
>
>? lcC + "<"
>? alines( laLine, lcC )
>list memo like laLine
>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform