Problem with =+ and Types

BlitzMax Forums/BlitzMax Programming/Problem with =+ and Types

HCow33(Posted 2005) [#1]
Type oktype
Field a:Int
End Type

Local ok:oktype = New oktype
ok.a = 1
ok.a =+ 1
Print ok.a


It prints 1? Why?


Rimmsy(Posted 2005) [#2]
because you're basically saying:
ok.a=1

to increment it, you'll need a colon:
ok.a:+1

Easy mistake to make


Peter(Posted 2005) [#3]
Hi,

the correct operator for your operations is:

ok.a :+ 1

Note: It's :+, not =+

yours,
Petman


Leiden(Posted 2005) [#4]
HCow33 - you a cpp user ? ;D


HCow33(Posted 2005) [#5]
Yep. I didnt get an error and my program wasn't right. Thanks everyone.