Omnimaga
Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: tilky on October 17, 2012, 04:47:39 pm
-
I have this code
Repeat getKey(9)
0~K
If R<14
If getKey(47)
Output(R,0,"A"
R+1~R
1~{GDB3+1}
47~K
End
While getKey(K)=1
End
End
End
In case it wasn't self explanatory, ~ is the Sto>.
Now, what should happen if you repeatedly press math is that you get an output that it "AAAAAAAAAAAAAAA"
But what is really happening is a display like "Annnnnnnnnnnn" with the "n"s italicized.
It works properly if i leave out the line with the GDB write, or if i don't add a number to the pointer.
I am new to Axe, so most i just figured out by trial and error, but i can't firgure this one out :banghead:
-
did you ever declare GDB3 anywhere? STR, PIC, and GDB are used as pointers to positions in your program, so, if you start writing to them you will be overwriting parts of your program. it looks like you're probably overwriting the letter you're trying to output somehow, as character 01 is that italicised n.
-
I don't get it. Why would you need GBD3? You aren't doing anything with it.
-
he's just messing around to try to figure out how things work, i think.
-
Hmm, he did never declare GDB3. I think he's overwriting the $32 for A with $01 which is indeed n(I think it's $32)
-
that is the problem. i did declare it, but with Data()~GBD3, which was writing over the program i guess. I declared it as Data(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) and it works fine. Thanks so much shmibs!
-
If you declared it as Data()→GDB3, then the behaviour of your program is normal ;)
Here is your program, untouched:
Data()→GDB3
[??]
.I think you have declared some data inbetween, or
.maybe some code before that loop declared some data
.Else, the output would not be "Annnnn" but "AAnnnnn"
Repeat getKey(9)
0~K
If R<14
If getKey(47)
Output(R,0,"A"
R+1~R
1→{GDB3+1}
47~K
End
While getKey(K)=1
End
End
End
Here is how Axe translates it:
Data()→GDB3
[??]
"A"→Str0
Repeat getKey(9)
0~K
If R<14
If getKey(47)
Output(R,0,Str0)
R+1~R
1→{GDB3+1}
47~K
End
While getKey(K)=1
End
End
End
Which is basically the same as this, since there is nothing in the Data():
[??]→GDB3
"A"→Str0
Repeat getKey(9)
0~K
If R<14
If getKey(47)
Output(R,0,Str0)
R+1~R
1→{GDB3+1}
47~K
End
While getKey(K)=1
End
End
End
And now, Str0=GDB3+1, so when you do 1→{GDB3+1}, it replaces the A by a n, which is why you got the n :)