Patrick,
>Hey thanks James, that worked perfectly!
Good. I don't fully understand the message bar message system. It seems that setMsg() only displays the new message until there is a refresh() or systemrefresh(). This does allow displaying a temporary message during a process, then it reverts back to the original message. Sometimes this might be useful, and other times not.
>Thank's also for your encouragement in using more Object Oriented coding techniques. I'm making use of it in some small experimental ways...
Well, I am glad to hear you are experiementing. There is so much to be gained from using OOP. It is a little daunting at first, but once you get the hang of it, your productivity skyrockets.
>So far what has impressed me most is the use of inheritance when I need to customize just one or two methods of a FiveWin class (such as the tget class).
Ah, yes inheritance is great. Polymorphism (same naming) is also. You can pass around various objects and call the same method (e.g. edit(), print(), delete(), etc.). Incredibly useful!
I also encourge you to try creating business objects. Unlike FW objects which are mostly interface objects, business objects emulate thier real-world counterparts like items, customers, invoices, etc. We are accustomed to thinking of these in terms of just data (fields in a database), but they also may have behaviors (methods) like an invoice might have an acceptPayment() method which updates the balance due and also maybe the customer file. Note that you could have an object embedded in another object, like a customer object could be embedded in the invoice object. The you could something like:
- Code: Select all Expand view
method acceptPayment( nAmount, dDate ) class TInvoice
local oCustomer
oCustomer:= TCustomer():new()
oCustomer:acceptPayment( nAmount, dDate )
oCustomer:end()
::balance:= ::balance - nAmount
::lastPaid:= dDate
::save()
return self
So, now to accept a payment on an invoice all you do is:
- Code: Select all Expand view
oInvoice:=TInvoice():new( cInvno)
oInvoice:acceptPayment( nAmount, dDate )
oInvoice:end()
Both the invoice file and the customer file are updated automatically.
Check out the book on business objects shown on my website. You can get it used sometimes for as little as one cent! Highly recommended.
http://ourworld.compuserve.com/homepage ... rogram.htmJames