There is a bug in MID$() in FB 3.1.5 beta. Contrary to the behaviour in
FBII (and contrary to the Reference Manual's statement that "If startPos is
greater than the length of string$ , then a null (zero-length) string is
returned.", the following code fragment correctly gives a length of 0 and a
null string in FBII, but gives the curious string "ibcdefghij...." of length
248 in FB^3 (Lite or FBII emulation)
LOCAL
DIM i,63 txt$,255 a$
LOCAL FN Tester
txt$ = ""
FOR i=_"a" TO _"z"
txt$ = txt$+CHR$(i)
NEXT
txt$ = ""
a$ = MID$(txt$,9)
PRINT LEN(a$),a$
END FN
This illustrates it some more. Note that a negative numChars parameter
doesn't inhibit it:
LOCAL
DIM i,63 txt$,255 a$, b$
LOCAL FN Tester
txt$ = ""
'fill txt$ with location-specific characters:
FOR i=_"a" TO _"z"
txt$ = txt$+CHR$(i)
NEXT
txt$ = LEFT$(txt$,5)
FOR i=3 TO 8
a$ = MID$(txt$,i)
PRINT i,LEN(a$),a$
b$ = MID$(txt$,i,LEN(txt$)-i+1)
PRINT ,LEN(b$),b$
NEXT
b$ = MID$(txt$,7,-2)
PRINT "*",LEN(b$),b$
END FN
--
Robin
====================================================
Genesearch Pty Ltd
E-mail: robinc@...
WWW: http://www.genesearch.com.au
====================================================