HI there, IÃ,´ve got a question, about how pass variables from a client GLbasic to host made too whit glbasic.
I donÃ,´t know if I stay wronged, but this is can make whit the comand netsendmsg?Ã,¿, the trouble I think is when make netgetmsg$(), this is a string, and donÃ,´t have numeric values.
Thanks.
Yes, it sends strings. If you want to write binary data, just convert your data into a string:
LOCAL out$ = PackInt$(1234) + PackInt$(1000000)
STDOUT "pop: "+UnPackInt(out$)+"\n"
STDOUT "pop: "+UnPackInt(out$)+"\n"
KEYWAIT
FUNCTION PackInt$: i%
LOCAL a$
INLINE
*(int*)a_Str.getbuffer(5) = i;
a_Str.setlength(4);
ENDINLINE
RETURN a$
ENDFUNCTION
FUNCTION UnPackInt%: BYREF str$
INLINE
int i = *(int*)(str_Str.getbuffer(4)+LEN(str_Str)-4);
str_Str = MID_Str(str_Str, 0, LEN(str_Str)-4);
return i;
ENDINLINE
ENDFUNCTION
Tags: binary, integer to string
ENDFUNCTION
Thanks Gernoot, I will try after, thanks for the code.
Best Regards
Iván J.