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?
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.