Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FYI - alines() with blank string
Message
From
04/08/2006 13:48:46
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01142943
Message ID:
01143037
Views:
8
>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]
Previous
Reply
Map
View

Click here to load this message in the networking platform