Replying to:mystman12
Is the best way to save large amounts of data, or should I take a different route?
oof uhh you could ask others how to use DAT files, they seem to work but i dont like them
kinda late whoops
Root / Submissions / [.]
LOAD "PRG1:SAVEFILE"The you can use PRGEDIT to select where your memory is. Then use PRGGET$ to retrieve what's on the line. Like this: SLOT 0
LOAD "PRG1:SAVE" PRGEDIT 1,2 CASH=VAL(PRGGET$) ?CASHSLOT 1
CASH FILE 500That takes the 500 from the second SLOT, converts from a string to a value, and prints it in the main SLOT.
SAVE "TXT:MEMOFILE",TX$as well as load a text-type file directly into a string.
TX$=LOAD("TXT:MEMOFILE")Loading to a program slot does have the nice advantage of being able to read line-by-line but this can be accomplished with a SPLIT$() function anyway.
'12me21 new (fast) SPLIT 'http://scratch.smilebasicsource.com/chatlogs/17-01-04.txt@[17:56] 'claims at least 435ms per 10000 DEF SPLIT$(S$,D$) VAR LD%=LEN(D$) DIM R$[1] VAR N%=INSTR(S$,N%) IF N%==-1 THEN R$[0]=S$ RETURN R$ ENDIF R$[0]=LEFT$(S$,N%) @L VAR L%=N%+LD% N%=INSTR(L%,S$,D$) IF N%==-1 THEN PUSH R$,MID$(S$,L%,&H7FFFFFFF) RETURN R$ ENDIF PUSH R$,MID$(S$,L%,N%-L%) GOTO @L END