IF...THEN bug

Previous topic - Next topic

ampos

The folowing code

Code (glbasic) Select
a=1
IF a=0 THEN PRINT "1",10,10; PRINT "2",10,50
PRINT "3",10,100
SHOWSCREEN;MOUSEWAIT;END


outputs
2
3

When it should be only "3"

Maybe it is not a bug, but the way GLB is, but as old as I know, all basics I have learned, only prints "3"
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Scott_AW

Only one command can follow a then, otherwise you need them in a if-endif
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

Scott_AW

This is true, you can always condense down the code when parts have been finalized.
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/

Scott_AW

I just do it so when I'm scrolling through code it's a little quicker.  Some functions can get long but can easily be condensed so I'm not hunting too long for what I need.
Current Project, Orbital Contract Defense
http://gamejolt.com/games/adventure/code-name-ocd/9887/

BlackShadow now open source/resource(requires duke3d)
http://gamejolt.com/games/adventure/black-shadow-3d/9885/