Blitz Variable Crash

BlitzMax Forums/BlitzMax Programming/Blitz Variable Crash

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi,

I still use the old Blitz Basic 2D.

I have a minor issue with a variable which I would like someone to explain why it is happening.

Take this...
a=1
a=a+1
print a
the answer is 2

fine - some of the time, yet in some parts of my programme, a+a=11

thus in a loop:
a=1
For n=1 to 100
a=a+1
print a
next

the screen thus becomes...
1
11
111
1111
11111
and so on.

Likewise a=1:b=3:print a+b the answer becomes 13
print b+a the answer becomes 31

I can see what it is doing, but why is it doing it?

Thus, I have had to resort to labels like APPLES=1
BANANAS=2
print Apples+bananas answer is 3

It's not an issue, just an annoying occurance of the editor.

Many thanks