Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Empty last line not recognized by ALINES()
Message
De
24/05/2003 08:28:56
 
 
À
24/05/2003 07:38:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00792524
Message ID:
00792535
Vues:
22
>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
>
Peter,

What's the difference between
lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF + ""
and
lcC = "a" + ccCRLF + "b" + ccCRLF + "c" + ccCRLF
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
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform