Re: Procedures and Functions In a Class by Eric
Eric
Mon Oct 25 00:56:56 CDT 2004
Hello, Yong!
You wrote on Sun, 24 Oct 2004 21:27:04 -0700:
YM> Good day! I've been creating classes to simplify the coding in my
YM> projects, i was surprised that procedures and functions are not allowed
YM> in classes? howcome? is there alternative ways to implement this?
YM> classes are great for the debugging of codes are contained within the
YM> class itself. what is the new procedure if to place a procedure or
YM> function within a class? please help, thank you and more power...
Not sure what you mean by "procedures and functions are not allowed in
classes". I think you have some kind of coding errors. Procedures and
functions are allowed and are in fact "methods". Here's a sample class
definition:
DEFINE CLASS sample AS Custom
PROCEDURE Init()
* do something
ENDPROC
PROCEDURE MyCustomMethod(tnSomeParameter As Integer) AS String
RETURN TRANS(tnSomeParameter)
ENDPROC
ENDDEFINE
In the visual class designer, you would go to Class | New Method.
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8