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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nonvisual class

Status
Not open for further replies.

generlam

Programmer
Jun 13, 2001
75
US
I have a program written in FPW2.6 that does cost calculations. I am re-writing most 2.6 apps to VFP and would like to create a class from this program to be used in various apps, but am having trouble creating it. Anyone have any suggestions or tips?
 
What are you having trouble with? What kind of class?
Dave S.
 
It depends. You could go two ways.
1. Create a non-visual class (like you said)
or If the other applications you want to use this with are not VFP you could create a DLL.
But I'll explain the first way.
1.From the menu select new->class
2. Name you class and choose "custom"
3. Name you class library to be stored in (choose soemthing that doesn't exist if you want to isolate it)
4. Modify you new class lib and select the custom class.
5. From the menu you have the choice of adding either properties or methods.

And to run it :
IF !"myClassLib" $ SET("CLASSLIB")
SET CLASSLIB TO myClassLib.vcx ADDITIVE
ENDIF
oCustom = CREATEOBJECT("myCustomclass")
And to refer to it:
oCustom.myFunction1()
oCustom.myFunction3(date()) && With a parameter


Mike Gagnon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top