LoginLogin

Array Literals

Root / Submissions / [.]

DFrostCreated:
just
USE
this.code:
DEF ISINSTR(string$,sub$)
 DIM INLIST%[0]
 VAR I%,J%
 FOR I%=0 TO LEN(string$)-1
  J% = INSTR(I%,string$,sub$)
  IF I% == J% THEN PUSH INLIST%,I%
 NEXT
 RETURN INLIST%
END
DEF ARRLIT(X)
 DIM TEST[0],RET[0]
 TEST = ISINSTR(X,",")
 DIM L = LEN(TEST),I
 FOR I = 0 TO L-1
  IF I==L-1 THEN N = INSTR(X,"]") ELSE N = TEST[I+1]
  A$=MID$(X,TEST[I]+1,N-TEST[I]-1)
  WHILE A$[0] == " "
   A$[0] = ""
  WEND
  PUSH RET,VAL(A$)
NEXT
RETURN RET
END

No posts yet (will you be the first?)