[Gambas-devel] ideas for two new string functions

Kevin Fishburne kevinfishburne at ...590...
Wed Nov 24 22:54:07 CET 2010


On 11/23/2010 08:33 PM, Benoît Minisini wrote:
> In revision #3318, you now have a function named Mem$() that returns a string
> representation of a value.
>
> For example:
>
> Mem$(10) will return the 4 characters string "\x0A\x00\x00\x00".
>
> Mem$(Pi) will return the 8 characters string representing the Pi number as it
> is stored in memory.
>
> And so on...
>
> To do the contrary, you now must use the Int@(), Float@()... functions that
> read a value directly into memory.
>
> For example:
>
> Dim sStr As String
> sStr = Mem$(Pi)
> Print Float@(VarPtr(sStr))
>
> -->  3.14159265...
That is extremely awesome. Things like that are going to give GAMBAS a 
serious advantage over many languages, especially considering how 
friendly it is. Sending multiple datatypes as a single UDP packet and 
re-assembling them on the other end will be super easy now. There are 
probably a million other uses people will eventually discover as well. 
Thanks again Benoît.

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...590...
phone: (770) 853-6271





More information about the Devel mailing list