Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is a class loaded in the CLASSLIB list?

Status
Not open for further replies.

jabhawk

Programmer
Apr 23, 2002
71
US
I need a code sample that can quickly tell is a specific class library has been loaded to the CLASSLIB array and is available. If not found I want to add it to the active libraries.

This is similar to the "USED()" function for tables and probably is a simple process but I cannot remember how it is done and need to get it into my application quickly.

Anyone with a solution please post it here. (This would be a good topic for a FAQ <hint-hint>)

Thanks in advance,
Jon B Jonthan A Black
 
Take a look at the ACLASS() and AMEMBERS() functions. I haven't used them so I can't give you examples.
Dave S.
[cheers]
 
Dave S,
Thanks for the quick response but from a quick look I don't see how I can get the global session list of loaded classes from this.
If I am mistaken someone please correct me.
Jon B Jonthan A Black
 
How about:
?&quot;MYCLASS&quot; $ UPPER(Set(&quot;CLASSLIB&quot;))

Dave S.
[cheers]
 
Dave,
That was IT! I created the following functions in my application to do the task:

FUNCTION Load_Proclib
PARAMETER lpprocname
IF !(ALLT(UPPER(lpprocname)) $ ALLT(UPPER(Set(&quot;PROCEDURE&quot;))))
SET PROCEDURE to &lpprocname ADDITIVE
ENDIF

FUNCTION Load_Classlib
PARAMETER lpclassname
IF !(ALLT(UPPER(lpclassname)) $ ALLT(UPPER(Set(&quot;CLASSLIB&quot;))))
SET CLASSLIB to &lpclassname ADDITIVE
ENDIF

I called the functions with this code sample:

IF !Load_Classlib(&quot;_dialogs&quot;)
DO <error processing>
ENDIF

You have to be sure that the correct pathing is set before calling the functions otherwise the SET commands will fail with not found errors.

Jon B Jonthan A Black
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top