[Gambas-user] MkXXX$() functions

Demosthenes Koptsis demosthenesk at ...626...
Sat Jan 15 08:59:43 CET 2011


Thanks it is more clear now, because the example of UDP usage of these
functions i did not understand it.

On Sat, 2011-01-15 at 02:11 +0100, Benoît Minisini wrote:
> > 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,
> 

-- 
Regards,
Demosthenes





More information about the User mailing list