ec1Ans -> Str0 inString(Ans,":"+1 -> Y
Cool, I made something similar in Res.
I will try to get you the routine I used for dialogue in my game...
QuoteBegin-"BASIC Code"+-->QUOTE ("BASIC Code") | :4→Y :1→C:2→W :While W=2 :Text(X,Y,sub(Str0,C,1 :C+1→C:Y+4→Y :If sub(Str0,C,1)="/ :Then :C+1→C:X+6→X:4→Y:End :If sub(Str0,C,1)="+ :Then :Repeat getKey :End :For(Z,4,20 :Line(4,Z,90,Z,0 :End :41→X:4→Y:C+1→C :End :If sub(Str0,C,1)="* :1→W :End Generated by http://www.cemetech.net/projects/basicelite/sourcecoder.php,
tifreak8x's is a great routine for displaying text, i highly recommend it! Anyways,i think what pyro xp2k is trying to do is just a regular string parser/divider right? Well the only thing i see that can be quickened up is in the end,instead of the "0"->str0,just make it Delvar X,or some random variable.Then in the loop,make it While X,so right when x becomes 0,it exits the loop :)
I changed it again. I combined it with the other parser so now you can choose wheter you want to parse the whole thing and make an index or parse only the first item in the string (put a colon before the string).
You can put this right into TI-GRAPH LINK (chane the file location though below) and import it. c1-->CODE | ec1 \start83P\ \comment=Single file received by TiLP \protected=FALSE \name=ZPARSE \file=D:\TISTUF~1\0PROGR~1\ZPARSE.TXT If sub(Ans,length(Ans),1)\!=\": Ans+": Ans\->\Str0 If sub(Ans,1,1)=": Then sub(Ans,2,length(Ans)-1\->\Str0 0\->\W:Else:1\->\W End If W:Then {1\->\L\2\:1\->\W:0\->\\theta\ While WinString(sub(Str0,W,length(Str0)-W+1),": Ans+W\->\W \theta\+1\->\\theta\ W-Ans\->\L\2\(1+dim(L\2\ End While length(Str0)\!=\inString(Str0,": inString(Str0,": sub(Str0,1,Ans-1)+sub(Str0,Ans+1,length(Str0)-Ans\->\Str0 End 1+length(Str0\->\L\2\(1+dim(L\2\ Else inString(Str0,":")+1\->\Y If Ans(Anssub(Str0,1,Ans-2\->\Str9 sub(Str0,Y,length(Str0)-Y+1\->\Str0 Else sub(Str0,1,length(Str0)-1\->\Str9 "0\->\Str0 End End \stop83P\ c2 |
ec2
sound cool, do you want me to move this in the calc project and idea section tho? as it was posted in the calc help^and support forums :P
Sure.
there we go
|
|