Try these examples in immediate window:
print 32766 + 1
print 32766 + 2
print 32768 + 1
The second one causes overflow!
Why does the variant act like this? I thought Variant was more flexible. And how do i solve this e = Asc(d) * Asc(d) without using new variables?Code:a = 256 * 256 'This does not work. b& = 256& * 256& 'This works cuz i set them to long c = 256@ * 256 'This works too c = 256 * 256@ 'This works too 'This doesn't work and I can't set them as currency(@). And the variant thinks they are integers so it gets an overflow error! d = Chr(255) e = Asc(d) * Asc(d)




Reply With Quote