? Array Literals ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
💀

Array Literals

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
Author
dfrost2
Updated
Rating
0 votes
Categories
Keywords
  • array
  • literal
  • ISINSTR
  • ARRLIT
  • dfrost2
0 Comment(s)