WHAT IS GOING ON ANYMORE
Seriously, what happened to A%? It's supposed to be an array, but it's not?
DEF STR_TO_ARR S$ OUT A%[]
WHILE LEN(S$)!=LEN(A%)
PUSH A%,ASC(S$[LEN(A%)-1])
WEND
S$=""
END
Could you refer to the following program?
DEF STR2ARR S$,A%
VAR D
WHILE LEN(A%)>0:D=POP(A%):WEND
WHILE LEN(S$)>LEN(A%)
PUSH A%,ASC(S$[LEN(A%)])
WEND
END
DIM C%[100]
STR2ARR "SMILEBASIC",C%
FOR I=0 TO LEN(C%)-1:?C%[I]:NEXT I
I'd suggest using...
DEF FUNCNAME PARAM
RETURN RETVAL
...rather than...
DEF FUNCNAME PARAM OUT RETVAL
...for functions with a single return value. It's a lot more straightforward in terms of the return value's initialization and the value returned itself.
You should not use neither OUT nor RETURN for a reference of an array.
I recommend you to modify your program as follows.
DEF STR_TO_ARR S$ OUT A%[]
-> DEF STR_TO_ARR S$,A%[]