PDA

View Full Version : Smart way to query the exisitence of proc in mem


Nenox
04-26-2006, 09:00 AM
Hi.

Can someone help me figure out what the most solid way of figuring out if a proc is in memory is?

I have ben using the whatIs command - something like this;

if(`whatIs kctPickWalkKeys`!="Unknown")
{
kctPickWalkKeys("up");
}

But then I found that I might also get a return like:
"Presumed Mel procedure; no definition seen yet.";

I would like to write a small proc that checks the existinsse of a proc in memory and returns an integer. Right now guess I would have it check for these two strigs:

"Unknown"
""Presumed Mel procedure; no definition seen yet.";

* Is the whatIs command the smart way to approach this?
* Are there other "negative" returns I should be aware off?
* Would it be smarter to look for "positive" returns instead ( eg. Mel procedure found in: blah.blah) and tokenize the return string?

Thanks,
Sune

goleafsgo
04-26-2006, 01:16 PM
You want the "exists" command. So you can do stuff like this:

string $myCommand="cone";
if (`exists $myCommand`) {
eval $myCommand;
}

Nenox
04-26-2006, 02:09 PM
Thanks a lot!

..I might want to buy my self a book on MEL!!

:-)

CGTalk Moderation
04-26-2006, 02:09 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.