Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ATLINE() bug and workaround?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00138760
Message ID:
00138833
Vues:
14
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform