[Gambas-user] MkXXX$() functions
Benoît Minisini
gambas at ...1...
Sat Jan 15 02:11:48 CET 2011
> Hello,
>
> i do not understand the MkXXX$() functions.
>
> How to use them and where?
>
> i tried to print the return of them but i did not understand the
> representation of memory as string.
>
> Print MkBool$(True)
> gives
> ^A
They are doing the same thing as the WRITE instruction from a memory stream,
except that they create a string from the written contents.
For example, MkInt$(X) will take the integer X and will return a 4 bytes
string, as an integer uses 4 bytes in memory.
MkBool$(True) returns Chr$(1), but maybe it should return Chr$(255), as, by
definition, True <=> -1 in Gambas.
These functions are not really useful, because they use the endianness of the
system. Whereas READ and WRITE on a stream can use any endianness with the
ByteOrder property of the stream.
Regards,
--
Benoît Minisini
More information about the User
mailing list