[Gambas-user] Gambas3 Pointers example - signal #6

John Spikowski support at ...2529...
Mon Jan 17 22:59:05 CET 2011


On Mon, 2011-01-17 at 21:36 +0200, Demosthenes Koptsis wrote:
> On Mon, 2011-01-17 at 13:33 +0100, Benoît Minisini wrote:

> Public Sub Main()
> 
>   Dim pFunc As Pointer
>   Dim sWorkingDirectory As String
> 
> 'get_current_dir_name
>   pFunc = get_current_dir_name()
>   Print pFunc
>   
>   sWorkingDirectory = Str@(pFunc)
>   Print sWorkingDirectory
> 
>   free_ptr(pFunc)
>   pFunc = 0
> 
> End

Isn't pFunc a Gambas variable (memory location) which is maintained by
the Basic? Why would you free it externally? I would think Gambas would
complain about that.







More information about the User mailing list