Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Classlib To
Message
From
14/05/2002 20:37:02
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
14/05/2002 19:20:13
Gavin Reid
L & M Marketing Pty Ltd
Frenchs Forest, Australia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00656588
Message ID:
00656619
Views:
8
This message has been marked as a message which has helped to the initial question of the thread.
How about making yourself a little utility prg? I wrote this off the top of my head and didn't test it, but it should give you the general idea.

Use it like this...

IF !SETCLASS("yourclasslibrary")
RETURN .F.
ENDIF
*Proceed to instantiate an object from yourclasslibrary.


SETCLASS.prg
lParameters tcClassLib
tcClassLib = upper(alltrim(m.tcClassLib))
IF !".VCX"$m.tcClassLib
tcClassLib = m.tcClassLib + ".VCX"
ENDIF
IF "\" + m.tcClassLib $ set("CLASSLIB")
RETURN .T.
ENDIF
LOCAL lcOnError
lcOnError = ON("ERROR")
LOCAL llError
ON ERROR llError = .T.
SET CLASSLIB TO (m.tcClassLib) additive
ON ERROR &lcOnError.
IF m.llError
RETURN .F.
ENDIF
RETURN .T.

>Hi All,
>
> I'm using VFP6.0 and issuing SET CLASSLIB TO blahblah ADDITIVE. Is there a way of checking if the class library is already open?
>
>Thanks,
>Gavin...
Previous
Reply
Map
View

Click here to load this message in the networking platform