Marc,
I see you are using Harbour and I use xHarbour. Try putting double colons in front of super.
::super():New(...
James
1) What are the important features of TData which we can not get with TDataBase?
2) What is that TRecord can do what TDataRow can not do?
We would be very much glad if you can show some illustrations of using TRecord to create single objects.
cCustNo:= "400"
oInvoice:= TInvoice():New( cCustNo )
cItemNo:="1000"
oItem:= TItem():New( cItemNo )
oInvoice:addItem( oItem )
oItem:end()
cItemNo:="1007"
oItem:= TItem():New( cItemNo )
oInvoice:addItem( oItem )
oItem:end()
oInvoice:save()
oInvoice:preview()
oInvoice:finalize()
oInvoice:end()
METHOD Finalize() CLASS TInvoice
::Final:= .t.
::save()
::oCustomer:balance = ::oCustomer:balance + ::total
::oCustomer:save()
RETURN nil
Were you able to get the Customer class example to compile after changing SELF to ::SELF?
Marc Venken wrote:1. Why do you use the :: and what does it stand for.
2. Every class you make has to be a single prg right ? or do you do this for better maintenance options ?
3. They have to linked in into the program (have to look where and how)
Enrico Maria Giordano wrote:Marc Venken wrote:1. Why do you use the :: and what does it stand for.
2. Every class you make has to be a single prg right ? or do you do this for better maintenance options ?
3. They have to linked in into the program (have to look where and how)
1. :: stands for "self" that is the current object.
2. No, you can put any class you want in a single PRG.
3. I didn't understand the question, sorry.
EMG
I suppose that I have to look into the source of Tdatabase to see what actions (like seek..) are possible? Or is there a manual for this?
CLASS TCustomers from TDatabase
Meaning that I create a new class Tcustomer and ALL actions inside Tdatabase will become available.
Yes, but not with that type of name. One of the great features of objects is that you can pass them around. Since they are encapsulated you only have to pass one item (the object) to get access to all the data and methods of the object. Encapsulation is one of the doctrines of OOP.Then you create your own methods.
METHOD printCustList()
I just miss the point of using this instead of a function.
Function printCustlist(cNum)
Code for printing report
Return NIL
I also can say : printcustlist(Cust->CNo)
I agree that with OOp everything is located in the class Tcustomer, and maintaining the code is better, since It stays together. I confess, that in a larger project with many functions, we loose time because we don't always know where they are ....
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 27 guests