0 Members and 3 Guests are viewing this topic.
EDIT:Quote from: Runer112 on March 20, 2011, 07:11:10 pmCode: [Select]◄When do you use that?
Code: [Select]◄
◄
Darl, you could try something like this::"Test"->Str1:"Try":[00]:"Moar":[00]:"Text":[00]:"Trial":[00]:->A // Spot in Data, so it would be "Text" if A=3::Str1->C:For(B,1,A):length(C)+C+1->C:EndNow C should point to your string. Good luck!
.Data"This"→Str000"is"→Str001"a"→Str002"test."→Str003Data(Str000ʳ,Str001ʳ,Str002ʳ,Str003ʳ)→GDB0.Example call5sub(SF).String fetching routineLbl SF {*2+GDB0}ʳReturn
.Data"This"→Str0"is"[00]"a"[00]"test."[00].Example call5sub(SF).String fetching routineLbl SF →r₁ Str0 Goto SF0 While 1 -1→r₁ length(r₂)+r₂+1 Lbl SF0 →r₂ End!If r₁ r₂Return
.Will have a terminating zero"Test"→Str0.Will not have a terminating zero"Test"[]→Str0
.Data[]→Str0[04]"This"[02]"is"[01]"a"[05]"test.".Example call2sub(SF).String fetching routineLbl SF →r₁ Str0 Goto SF0 While 1 -1→r₁ r₂+{}+1 Lbl SF0 →r₂ End!If r₁ r₂Return
In other news, Frey continues kicking unprecedented levels of ass.
.UNSQUISH5->{L1}^^r"0123456789ABCDEF"->GDB0ClrHomeDisp "To unsquish: >prgm"!If sub(INP)Disp "Program not found!"ReturnEnd->PDisp "Save as:",[i],">prgm"If sub(INP)Disp "Program exists! Overwrite? (y/n)>"Input ->R!If {}-'Y'Goto YESEnd!If -|E20Goto YESEndReturnEndLbl YESGetCalc(L1,{P-2}^^r->S*2)->QFor(I,0,S-1){P+I}->J^16sub(GC)->{J/16sub(GC)->{I*2+Q}+1}EndDisp "Program has beensuccessfully unsquished."ReturnLbl GC{+GDB0}ReturnLbl INPFill(0->{(L1+1)},7)Copy(Input ->I,L1+1,{I-2}^^r)GetCalc(L1)Return