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:
00138777
Vues:
9
Hi Rick,

This is a nasty bug.

If you need to search into larger memo fields the fastest way is to create a temporary cursor, copy the contents of memo to a text file, append from this text file to the cursor.

Then use scan, index it whatever. Depending on your SET MEMOWIDTH if each line could fit into each record that's great. If not, you can write a pre SCAN which will first create the line numbers depending on where you encounter CHR(13) and then lookup the string.


>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 ---
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform