Alright, i could just be an idiot, cuz i can't seem to find any help on the matter (i'm sure it's gotta be there, i just don't know where!!)
(yo, forgive any syntax errors, i'm writing this fairly quickly..)
The idea i have is this. Let's say i have a class clientbase
DEFINE CLASS clientbase AS CUSTOM
PROCEDURE init
SELECT client
SCATTER MEMVAR ;
FIELDS id, name, age
ENDPROC
PROCEDURE getName
RETURN m.name
ENDPROC
PROCEDURE getID...etc. etc.
..
ENDDEFINE
Let's say i also have another class, which is based on a form. Which can either be vcx or a prg with a DEFINE CLASS.
For argument's sake, we'll set up a DEFINE.
DEFINE CLASS clientinterface AS FORM
** add controls here, set the control sources to m.name, m.id, etc
ENDDEFINE
Now, if i wanted to create an object that has both the interface and the base, how would i combine them?
The solutions i've found was
a) instead of creating clientbase, only create clientinterface and then :
DEFINE CLASS client AS clientinterface
PROCEDURE init
PARAMETERS _number
SELECT client
LOCATE FOR id = _number
SCATTER MEMVAR ;
FIELDS id, name, age
ENDPROC
..the rest follows like clientbase
or b)
DEFINE CLASS clientinterface AS FORM
** add controls here
** set the control sources to m.name, m.id, etc
clientaccess = CREATEOBJECT("clientbase", "123"
ENDDEFINE
Of the two, i like the second better, because then i still have my access to the tables in their own object, seperate from anything else.
My question : is there a way that i can merge two classes into one? ie can i inherit from two parents classes instead of just one?
Thanks..
(yo, forgive any syntax errors, i'm writing this fairly quickly..)
The idea i have is this. Let's say i have a class clientbase
DEFINE CLASS clientbase AS CUSTOM
PROCEDURE init
SELECT client
SCATTER MEMVAR ;
FIELDS id, name, age
ENDPROC
PROCEDURE getName
RETURN m.name
ENDPROC
PROCEDURE getID...etc. etc.
..
ENDDEFINE
Let's say i also have another class, which is based on a form. Which can either be vcx or a prg with a DEFINE CLASS.
For argument's sake, we'll set up a DEFINE.
DEFINE CLASS clientinterface AS FORM
** add controls here, set the control sources to m.name, m.id, etc
ENDDEFINE
Now, if i wanted to create an object that has both the interface and the base, how would i combine them?
The solutions i've found was
a) instead of creating clientbase, only create clientinterface and then :
DEFINE CLASS client AS clientinterface
PROCEDURE init
PARAMETERS _number
SELECT client
LOCATE FOR id = _number
SCATTER MEMVAR ;
FIELDS id, name, age
ENDPROC
..the rest follows like clientbase
or b)
DEFINE CLASS clientinterface AS FORM
** add controls here
** set the control sources to m.name, m.id, etc
clientaccess = CREATEOBJECT("clientbase", "123"
ENDDEFINE
Of the two, i like the second better, because then i still have my access to the tables in their own object, seperate from anything else.
My question : is there a way that i can merge two classes into one? ie can i inherit from two parents classes instead of just one?
Thanks..