[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pointer question



Mark Hadfield wrote:

> pro test, a
> 
>     ; Do something with a
> 
>     if not arg_present(a) then if ptr_valid(a) then ptr_free, a
> 
> end

I am sorry, I have not had my first cup of coffe yet. How is that
supposed to work? If there is *no* argument present, *then* try to check
if the missing argument is a pointer? What am I missing? Should it be

if arg_present(a) then if ptr_valid(a) then ptr_free, a ;?

Also, in the example provided by Ted, the parameter is not going to be
recognized by Arg_present, because it is not passed by reference since
it is an expression.
But I think Paul answered already how to do this sort of thing properly.

Cheers,
Pavel