Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-13 Thread Benoît Minisini
On 09/12/2011 10:24 PM, Benoît Minisini wrote: ' Create data string. DataPointer = Alloc(8) Mem = Memory DataPointer For Read Write Write #Mem, (Server.DateCurrent + Server.DateUTC) As Float Data = Read #Mem As Float Print Original: (Server.DateCurrent + Server.DateUTC) Print From

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-13 Thread Kevin Fishburne
On 09/13/2011 04:59 AM, Benoît Minisini wrote: On 09/12/2011 10:24 PM, Benoît Minisini wrote: ' Create data string. DataPointer = Alloc(8) Mem = Memory DataPointer For Read Write Write #Mem, (Server.DateCurrent + Server.DateUTC) As Float Data = Read #Mem As Float Print Original:

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-12 Thread Kevin Fishburne
On Sun, Sep 11, 2011 at 07:40, Kevin Fishburne kevinfishbu...@eightvirtues.com wrote: My code looks like this: ' For writing outgoing UDP data to memory. Public data As String Public mem As Stream ' Create data string for outgoing transaction queue. data = Space(8) mem = Memory

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-12 Thread Benoît Minisini
On Sun, Sep 11, 2011 at 07:40, Kevin Fishburne kevinfishbu...@eightvirtues.com wrote: My code looks like this: ' For writing outgoing UDP data to memory. Public data As String Public mem As Stream ' Create data string for outgoing transaction queue. data = Space(8) mem

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-12 Thread Kevin Fishburne
On 09/12/2011 09:19 PM, Benoît Minisini wrote: On Sun, Sep 11, 2011 at 07:40, Kevin Fishburne kevinfishbu...@eightvirtues.com wrote: My code looks like this: ' For writing outgoing UDP data to memory. Public data As String Public mem As Stream ' Create data string for outgoing

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-12 Thread Benoît Minisini
On 09/12/2011 09:19 PM, Benoît Minisini wrote: On Sun, Sep 11, 2011 at 07:40, Kevin Fishburne kevinfishbu...@eightvirtues.com wrote: My code looks like this: ' For writing outgoing UDP data to memory. Public data As String Public mem As Stream ' Create data string for

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-12 Thread Benoît Minisini
' Create data string. DataPointer = Alloc(8) Mem = Memory DataPointer For Read Write Write #Mem, (Server.DateCurrent + Server.DateUTC) As Float Data = Read #Mem As Float Print Original: (Server.DateCurrent + Server.DateUTC) Print From Mem: Float@(Data) Print Reversed:

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-12 Thread Kevin Fishburne
On 09/12/2011 10:24 PM, Benoît Minisini wrote: ' Create data string. DataPointer = Alloc(8) Mem = Memory DataPointer For Read Write Write #Mem, (Server.DateCurrent + Server.DateUTC) As Float Data = Read #Mem As Float Print Original: (Server.DateCurrent + Server.DateUTC) Print From Mem:

Re: [Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-11 Thread Jussi Lahtinen
Not sure what happen there, but try this: Public pData As Pointer Public mem As Stream pData = Alloc(SizeOf(gb.Float)) mem = Memory pData For Write mem.Begin Write #mem, (Server.DateCurrent + Server.DateUTC) As Float mem.Send Print Float@(pData) Jussi On Sun, Sep 11, 2011 at 07:40, Kevin

[Gambas-user] gb3: writing variables to a string using a memory stream and pointer

2011-09-10 Thread Kevin Fishburne
My code looks like this: ' For writing outgoing UDP data to memory. Public data As String Public mem As Stream ' Create data string for outgoing transaction queue. data = Space(8) mem = Memory VarPtr(data) For Write mem.Begin Write #mem, (Server.DateCurrent + Server.DateUTC) As Float mem.Send