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

Benoît Minisini gambas at ...1...
Tue Sep 13 04:24:30 CEST 2011


> > 
> > ' 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: " & Float@(Convert.Reverse(Data))
> 
> Your code cannot work : Data receives a Float ( Read #Mem As Float ), and
> later is used as a Pointer ( Float@(Data) ).

Please provide some real code that I can compile!

-- 
Benoît Minisini




More information about the User mailing list