Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ATLINE() bug and workaround?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00138760
Message ID:
00138833
Views:
13
>VFP 6.0 has a new command ATLINE and ATCLINE which is nice for qiuckly getting to a line in a string. This is handy if you need to line based parsing of strings.
>
>Unfortunately there's a bug (feature?) that causes ATLINE to fail if you look for strings that contain CHR(13) or for strings at the end of a line that have trailing spaces:
>
>lcText = "Hi..." + CHR(13)+"Hello World  "+CHR(13)+"!"
>? ATCLINE("World ",lcText)
>
>lcText = "Hi..." + CHR(13)+"Hello World  "+CHR(13)+"!"
>? ATCLINE("World"+CHR(13),lcText)
>
>Both of the above fail making it impossible to search for an exact
>match that may occur at the end of a line.
>
>Ok, so that's out. Any suggestions on how you could do this
>efficiently? I need to get a line number into a string in order
>to be able to go forward and backwards through the file. Parsing
>with MLINE won't work either, because it'll never retrieve a
>CHR(13) either.
>
>Any ideas how else to get a line pointer?
>
>+++ Rick ---

Perhaps the ATLINE() definition of *End of line* is different than you expected.
What are you using as a definition of *End of line* ? The visual end of the line ? Is ATLINE using chr(13) the end of the line, regardless of where it is visually ?
Glenn
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform