Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
FYI - alines() with blank string
Message
De
04/08/2006 13:48:46
 
 
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:
01143037
Vues:
12
>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.

A bug exists:
* escpected 1 and NULL or ( 0 or NULL ) and error
? ALINES(laLines,null)
? EMPTY(laLines[1])
then you can add phantom line and ignore it
CLEAR
#define CRLF 0h0d0a

lcTitle = ""
? alines(laLines, CRLF +m.lcTitle)-1
* ignore laLines[1]

lcTitle = "Line1" + CRLF + CRLF + "Line3"
? alines(laLines, CRLF +m.lcTitle) - 1
* ignore laLines[1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform