Long

Archives Forums/MacOS X Discussion/Long

MacSven(Posted 2007) [#1]
Why do this not work:

Global l:Long
l=$8000000000000000
Print l


Brucey(Posted 2007) [#2]
Global l:Long
l=$8000000000000000:Long
Print l 


:o)


MacSven(Posted 2007) [#3]
OK.Bruce i have another question to you

I have a long in c like this


but it returns a 0


ImaginaryHuman(Posted 2007) [#4]
If you want to define a long as a constant you have to put :Long on the end otherwise it chops off the top 32 bits and converts it to an integer.


Brucey(Posted 2007) [#5]
For 0x1000000000000, surely you need to use a "long long", unless your code is 64bit (where I guess a long is 8 bytes?).
Generally in C, a long is the same size as an int these days - at least in 32bit land.

And once you are in the realms of "long long", then the fun with BlitzMax will really begin...