Author Topic: GDB and output problem  (Read 3923 times)

0 Members and 1 Guest are viewing this topic.

Offline tilky

  • LV0 Newcomer (Next: 5)
  • Posts: 4
  • Rating: +0/-0
    • View Profile
GDB and output problem
« on: October 17, 2012, 04:47:39 pm »
I have this code
Code: [Select]
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: 

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: GDB and output problem
« Reply #1 on: October 18, 2012, 10:00:45 am »
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.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: GDB and output problem
« Reply #2 on: October 18, 2012, 10:05:12 am »
I don't get it. Why would you need GBD3? You aren't doing anything with it.
I'm not a nerd but I pretend:

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: GDB and output problem
« Reply #3 on: October 18, 2012, 10:09:48 am »
he's just messing around to try to figure out how things work, i think.

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: GDB and output problem
« Reply #4 on: October 18, 2012, 10:11:43 am »
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)
I'm not a nerd but I pretend:

Offline tilky

  • LV0 Newcomer (Next: 5)
  • Posts: 4
  • Rating: +0/-0
    • View Profile
Re: GDB and output problem
« Reply #5 on: October 18, 2012, 02:42:47 pm »
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!

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: GDB and output problem
« Reply #6 on: October 18, 2012, 03:26:48 pm »
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 :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s