[Gambas-user] write #pointer
Benoit Minisini
gambas at ...1...
Sat Dec 23 19:30:49 CET 2006
On Tuesday 19 December 2006 16:18, Gaël Le Hec'H wrote:
> Hi,
>
> is it normal to get "" in sBuff ?
>
> DIM pBuff AS Pointer
> DIM sBuff AS String
> pBuff = Alloc(10)
> WRITE #pBuff, "123" & Chr$(0), 4
> sBuff = StrPtr(pBuff)
> Free(pBuff)
> PRINT "sBuff = " & sBuff
>
StrPtr() does not make a copy of the string, so do not free pBuff in the
background.
Regards,
--
Benoit Minisini
More information about the User
mailing list