To decrease the amount of repeated code, we can write a function to help out: DEF NEXT_TOKEN S$,I OUT TOKEN$,J J=INSTR(I,S$,",") IF J<0 THEN J=LEN(S$) TOKEN$=MID$(S$,I,J-I) INC J IF J>LEN(S$) THEN J=-1 END I=0 NEXT_TOKEN GAMESAVE$,I OUT HP$,I NEXT_TOKEN GAMESAVE$,I OUT SP$,I