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 >>

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 + S

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-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) > >

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 S

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 ' Cr

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 que

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)

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

2011-09-11 Thread Benoît Minisini
> 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.DateU

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

2011-09-11 Thread tobias
On 11.09.2011 06:40, Kevin Fishburne 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 VarPtr(data) For Write > mem.Begin > Wri

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