View Single Post
  #3  
Old 06-02-2002, 12:11 PM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Try this for int32

int16 = 2 ^ 16 = 256 ^ 2 ( 2 ascii value)
int32 = 2 ^ 32 = 256 ^4 (4 ascii values)

so,
something like this should work..

(pos is the 1st bit of the value string)

((ascii(mid(profile,pos,1))*1)+(ascii(mid(profile, pos+1,1))*256))
+ ((ascii(mid(profile,pos+2,1))*256*256)+(ascii(mid( profile,pos+3,1))*256*256*256))

Give that a shot and see if it gets ya..

For signed int's, Im not sure, you need to get the value and subtract half the max value of the int range, so it would be something like this..

int8 = 2 ^ 8 = 256 , so sint8 =

ascii(mid(profile, pos, 2)) - 128
Reply With Quote