Page 1 of 1

PB4 - what´s wrong?

Posted: Fri Aug 11, 2006 4:28 pm
by denise_amiga

Code: Select all

tst=0
Debug tst+1
Debug tst+1
Debug tst+1
result:
1
1
1

Posted: Fri Aug 11, 2006 4:35 pm
by Kale

Code: Select all

tst=0

tst+1
Debug tst

tst+1
Debug tst

tst+1
Debug tst

Re: PB4 - what´s wrong?

Posted: Fri Aug 11, 2006 9:02 pm
by Psychophanta
denise_amiga wrote:

Code: Select all

tst=0
Debug tst+1
Debug tst+1
Debug tst+1
result:
1
1
1
What's wrong?
That's what i say.

Posted: Fri Aug 11, 2006 9:11 pm
by netmaestro
cat = 1
dog = cat+1
debug cat ; it would be a big problem if this were now 2 as a result of the last operation.

I believe cat+1 would have to be alone on its own line for cat to be modified.

Posted: Fri Aug 11, 2006 9:45 pm
by Num3
x+1 increases x in 1

debug x+1 just prints (x + 1) and does not increase it, because the debug command has priority and the result is not considered an operation just a print out of X variable + 1...

Posted: Fri Aug 11, 2006 10:06 pm
by Psychophanta
Hi, num3, not every times you are so explicit and gentlemen :P
Is it because Denise is a lady name?

Posted: Fri Aug 11, 2006 10:33 pm
by Bonne_den_kule
x+1 alone on one line is just a typo for x=x+1

Posted: Fri Aug 11, 2006 11:48 pm
by blueznl
well i wouldn't call x+1 a TYPO for x=x+1 :-)

and yeah, that debugger behaviour threw me of balance as well, but it makes sense: your program's behaviour should not change when you switch the debugger on or off, so if anything behind a 'debug' command is ignored, then that would make sense... kind of :-)

Posted: Sat Aug 12, 2006 2:15 am
by denise_amiga
Num3 wrote:x+1 increases x in 1

debug x+1 just prints (x + 1) and does not increase it, because the debug command has priority and the result is not considered an operation just a print out of X variable + 1...
ok, and thx

Posted: Sat Aug 12, 2006 11:21 am
by Num3
LOL Denise is a lady name for sure, but it's also a chip name :P from AMIGA !

Upsss....

Image

Posted: Sat Aug 12, 2006 11:54 am
by Psychophanta
Num3 wrote:LOL Denise is a lady name for sure, but it's also a chip name :P from AMIGA !
Yeah! the main VDP chip which controls the amiga sprites, etc.
Nice .gif 8)