Hi
Does anyone know how to make a typed array variable LEN = 0 if it's
empty? The problem I'm having is that if the array is atually empty
the length of the string is 40 so the test below doesn't work. Testing
on LEN = 40 is not safe either if the variable actually happens to
hold 40 valid characters. Tested on SPACE$(40) didn't work either.
TYPE Business_Table
Company AS STRING * 40
First AS STRING * 40
Last AS STRING * 40
END TYPE
DIM BusList(1:100) as Business_Table
first$ = TRIM$(BusList(i&).First) ' : IF first$ = SPACE$(40) THEN first$ = ""
last$ = TRIM$(BusList(i&).Last) ' : IF last$ = SPACE$(40) THEN last$ = ""
IF last$ <>"" THEN fullname$ = last$
IF first$ <> "" THEN
IF last$ <> "" THEN
fullname$ = fullname$ + ", " + first
ELSE
fullname$ = first$
END IF
END IF
------------------
Henning
Does anyone know how to make a typed array variable LEN = 0 if it's
empty? The problem I'm having is that if the array is atually empty
the length of the string is 40 so the test below doesn't work. Testing
on LEN = 40 is not safe either if the variable actually happens to
hold 40 valid characters. Tested on SPACE$(40) didn't work either.
TYPE Business_Table
Company AS STRING * 40
First AS STRING * 40
Last AS STRING * 40
END TYPE
DIM BusList(1:100) as Business_Table
first$ = TRIM$(BusList(i&).First) ' : IF first$ = SPACE$(40) THEN first$ = ""
last$ = TRIM$(BusList(i&).Last) ' : IF last$ = SPACE$(40) THEN last$ = ""
IF last$ <>"" THEN fullname$ = last$
IF first$ <> "" THEN
IF last$ <> "" THEN
fullname$ = fullname$ + ", " + first
ELSE
fullname$ = first$
END IF
END IF
------------------
Henning
Comment