Good Afternoon All,
I am using the following code:
The intent is to return an argument from a "comma separated variable list"
For the string "arg1,arg2,arg3,arg4,arg5" the call GetCSV(theString$,3) would return "arg3".
It works as expected except when there is a null argument eg: for the string "arg1,arg2,,arg4,arg5" the same call above will return "arg4", not the empty string (""). In this case a "count" of the list members (examined internally within the function) shows only 4 members in the list.
Is this result in accordance with the intent of the StrToList function or is there a bug.
I am using the following code:
- Code:
func GetCSV(aString$,index$)
List(lst$);
StrTolist(aString$,",",lst$);
index$--;
if ((index$ >= 0) & (index$ < count(lst$)))
goto (lst$,index$);
return (lst$);
else
return("");
end;
end;
The intent is to return an argument from a "comma separated variable list"
For the string "arg1,arg2,arg3,arg4,arg5" the call GetCSV(theString$,3) would return "arg3".
It works as expected except when there is a null argument eg: for the string "arg1,arg2,,arg4,arg5" the same call above will return "arg4", not the empty string (""). In this case a "count" of the list members (examined internally within the function) shows only 4 members in the list.
Is this result in accordance with the intent of the StrToList function or is there a bug.