D
Dante
I'm converting a C# program to VB.net, but i'm having
problems converting a integer to a byte in the same way as
the c# program does.
//C# program
int i = 137694;
byte b = (byte) i;
//b returns as value 222
'VB program
dim i as integer = 137694
dim b as byte = CByte(i)
'b returns Overflow Error
I understand that the CByte function only takes values
from 0 - 255, which is why the overflow error, but the c#
program casts from int to byte and gets a value of 222.
Anyone know how to get my VB.net app to do this?
problems converting a integer to a byte in the same way as
the c# program does.
//C# program
int i = 137694;
byte b = (byte) i;
//b returns as value 222
'VB program
dim i as integer = 137694
dim b as byte = CByte(i)
'b returns Overflow Error
I understand that the CByte function only takes values
from 0 - 255, which is why the overflow error, but the c#
program casts from int to byte and gets a value of 222.
Anyone know how to get my VB.net app to do this?