Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
NewBie
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Re: NewBie
Miscellaneous
Thread ID:
00915404
Message ID:
00915422
Views:
10
Hi Steve,

You got it. However if you want to do it right, you would first create class "person" with all the properties and methos. After that you can subclass it into Bob, Sally, e.t.c classes. It easier to demonstrate with PRG based classes.
PUBLIC oBob
oBob = NEWOBJECT("bob")
oMary = NEWOBJECT("mary")
oBob.SayHello()
oMary.SayBye()
RETURN

DEFINE CLASS Bob AS person
	FirstName = "Bob"
	LastName = "Smith"
	Sex = "M"
ENDDEFINE

DEFINE CLASS Mary AS person
	FirstName = "Mary"
	LastName = "Jones"
	Sex = "F"
ENDDEFINE

DEFINE CLASS person AS custom
	FirstName = ""
	LastName = ""
	Sex = ""

	PROCEDURE SayHello()
		WAIT WINDOW This.Firstname + ":Hello"
	ENDPROC  

	PROCEDURE SayBye()
		WAIT WINDOW This.Firstname + ":GoodBye"
	ENDPROC  
ENDDEFINE
>**OK so first
>
>loBob = NEWOBJECT("bob", "people")
>
>**then call any methods you want
>
>loBob.SayHi()
>loBob.SayGoodBye()
>etc.
>Thanks
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform