[Gambas-user] Gambas3 Pointers example

Demosthenes Koptsis demosthenesk at ...626...
Sat Jan 8 09:32:08 CET 2011


Hello, 
i remake an example for pointers in Gambas3-svn3432, ubuntu 10.04 LTS,
AMD64

The example is the next:

-------------------------
' Gambas module file

Public Sub Main()

Dim pPointer As Pointer
Dim hMemory As Stream
Dim iA As Integer

pPointer = Alloc(SizeOf(gb.Integer))
hMemory = Memory pPointer For Read Write

Write #hMemory, 10 As Integer
iA = Read #hMemory As Integer

Print iA

Free(pPointer)

End
-------------------------

the iA var when it prints is not 10 but something else like 0 or 32621
or similar.

What am i doing wrong?



-- 
Regards,
Demosthenes Koptsis.





More information about the User mailing list