News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

another strange thing

Started by reno, January 13, 2008, 01:04:35 PM

Previous topic - Next topic

reno

Hi kevin,

Look at this code ; at part #3, PB return a SYNTAX ERROR (PB 1.71g) :



;#1
var=0

print var

;#2
var=-10

print var

;#3
var=-(10*2)

print var

Sync
WaitKey



So we have to do :

;#3
var=neg(10*2)

...just to know if it is normal or if it is a lack  ::)

Thank you !
More games ? Go to my website :)
http://www.thereeteam.com/

Silvh

Its a pure mathematical issue. if you put:

Var = (-(10*2))

It should work, mathematicly.
"All we have to do, is decide what to do. With the code that is given to us"

reno

More games ? Go to my website :)
http://www.thereeteam.com/

blackmeadow

#3
i'd just use the neg command or put a - in front of the variable used under print  :P

kevin

you're attempting to negate a exported constant,  which the parser apparently doesn't support.  This only applies to constants however.


a=10
b=2


c=-(a*2)
print c

c=-(10*b)
print c

c=-(a*b)
print c


Sync
waitkey




reno

More games ? Go to my website :)
http://www.thereeteam.com/