× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Dave,

To deallocate the memory (i.e. tell the OS you're done with it so it can be reused) call the DEALLOC opcode.

dealloc myPointer;

If you just want to set it to null (so its not pointing anywhere) or compare it against null (to see if its been set to something) you can use the special value *NULL.

if myPointer <> *NULL;
  myPointer = *NULL;
endif;

However, please remember that this does NOT deallocate the memory -- the memory is still in use, and the OS doesn't know that it can be reused.   You just aren't pointing to it anymore.   So if this is memory that you are expected to deallocate, make sure you call DEALLOC before you set it to *NULL.

-SK

On 7/23/2021 3:59 AM, Dave wrote:
So what's the recommended way of "unpointing" the pointer or knowing if a
pointer has been set?

I'm checking for a null value simply by comparing the pointer with one that
is never used in the program.
myPointer *
NullPointer * inz(*null)

If myPointer <> NullPointer
myPointer = NullPointer
endif

But this doesn't seem right to me



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.