02-03-2005, 02:09 AM
Code:
option escape
declare function str2short ( s as string ) as short
print str2short( "\1\64" ), 64 * 256 + 1
function str2short ( s as string ) as short
dim p as byte ptr
p = strptr( s )
str2short = p[0] or (p[1] shl 8)
end function
Still, "\0" won't work.[/code]
ew FreeBASIC forums: http://www.freebasic.net/forum/index.php