Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FYI - alines() with blank string
Message
De
04/08/2006 09:00:15
 
 
À
04/08/2006 08:50:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01142943
Message ID:
01142952
Vues:
7
>Hi everybody,
>
>lcTitle = ""
>lnLines = alines(laLines, m.lcTitle)
>
>lnLines = 1
>
>I would expect it to return 0. Anyway, once I found this out I put a special handling for empty cases.

Actually, I'd expect it to return 1. lcTitle is not empty, it contains 1 empty string.

What's more interesting is that if lcTitle contains "" + Chr(10) + "", the return is still 1, which intuitively seems wrong, but on looking at it longer, makes sense since the line feed becomes the 1st character (ie line 1). Similarly, you get back 2 if lcTitle is "" + chr(10) + "" + chr(10) + "".
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform