That is not going to work. The global variable Q holds the address of TestQueue but when InProcedure exits TestQueue goes out of scope and the memory is unallocated.
So Q still has an address assigned but TestQueue doesn’t exist anymore.
I don’t know of anyway to detect that.
I know perfectly well about the scope of variables
Speech basically, about that that “the foul” reference by means of Clarion to not check up. And any attempt leads to GPF.
It would be nice to have a function in Clarion or be able to handle such an exception.
@bob.ricketts is registered here but I don’t think he is around much. SV are generally only responsive via private contact or the official newsgroups.
On a side note, this was recently posted to the newsgroups:
NEWD()
Versus keeping track of this stuff, sometimes it would be cool if we
could easily check to see if a reference’d object or variable was
declared or new’d.
Is there anything that us mortals can do to detect that?
So far responses are kinda just jokes and H5 jibes though.
Hi Brahn - I responded on the NG server with this:
Howdy Brahn -
That one’s a little different. He wants to know if the entity referred
to in the reference actually exists.
PROGRAM
MAP
END
QueueType Queue,TYPE
Yada1 String(10)
END
rQ &QueueType
rQ2 &QueueType
CODE
rQ &= NEW QueueType
rQ2 &= rQ
Dispose(rQ)
Message(Choose(NOT rQ &= NULL,'I think rQ still exists!',|
'rQ is NULL'))
Message(Choose(NOT rQ2 &= NULL,'I think the rQ2 still exists!',|
'rQ2 is NULL'))
He wants to be able to verify rQ2, unless I misunderstood.