In my program that I am working on, VisualTI, I am using Celtic 3 and its stream functions (that is, reading and writing to and from programs/AppVars) to read from the user's code file and place different code into a new program. However, I am having problems with it. Here is the entire code for the compile program so far:
:DispGraph :det(0,Str0,7 :If Ans=".P:NT:FN" :Then :0:Return :End :det(5,Str0,1→Str1 :If "^"≠sub(Ans,1,1) or Ans=".NULLINE :Then :1:Return :End :DelVar AinString(Str1," →A :If not(Ans:Then :sub(Str1,2,length(Str1)-1→Str9 :"NO→Str2 :Else :If length(Str1)>A :Then :sub(Str1,A+1,length(Str1)-(A→Str2 :sub(Str1,2,A-2→Str9 :Else :"NO→Str2 :sub(Str1,2,A-1→Str9 :End:End :det(0,Str9,5 :If Str2≠"NO :det(6,Str9,":"+sub(Str8,1,1)+Str2,1 :det(5,Str0,2→Str2 :If sub(Ans,1,1)≠"imag( :Then :1:Return :End :"det(3,"+sub(Str2,2,length(Str2)-1)+",0,1 :Pause Ans :det(6,Str9,Ans :DelVar Str2 :"Str0=APPVAR/CODE :"Str9=PRGM :3→I :While Str1≠".L:NT:FN" and Str1≠"Stop"+Str9 :det(5,Str0,I→Str1 :Pause Ans :det(6,Str9,Str1,I :I+1→I :End :det(7,Str9,I-1 :det(6,Str9,"Return",I-1 :2:Return
0:Return means that the code file cannot be found, 1:Return means that there is an error in the code file, and 2:Return means that compilation was successful and error-free. If the code file I am reading from looks like this:
:^APPLE A SamPLE prgm :imag(25 :Disp "Hey noW :StopAPPLE
Then according to my compiler, it should look like this in prgmAPPLE:
::"A SamPLE prgm :det(3,25,0,1 ;show picture 25 :Disp "Hey noW :Return :
The program actually did look like this, until I added the RecallPic function (of Celtic 3) because I forgot that I needed it. Can someone explain to me what I am doing wrong?
NOTE: Celtic 3 syntax I am using
det(0,"NAME",7) gets item information
det(0,"NAME",5) creates item
det(5,"NAME",LINE) reads line LINE of :NAME"
det(6,"NAME","STRING",START) writes "STRING" to "NAME" at START
det(7,"NAME",LINE) erases line LINE in "NAME"
EDIT: Sorry, but I deleted the .zip file in the documentation. I really didn't think it necessary to post it if it was incomplete. If you want a copy of the source from now until its official release, just send me a private message here or email me. (Subject: VisualTI Source)
Projects: BexIDE (hold), Hadean.NET, Legend of Zelda: Link to the Future