Field names vs. field numbers (OpenInsight 16-Bit Specific)
At 28 NOV 2002 02:10:17PM Cliff Harris wrote:
I am wondering if it is normal to use field numbers (such as @record) rather than names (such as {PRICE}). In the application that I have inherited, numbers are always used. The manual says that using numbers improves performance. Is it a significant improvement? Would the code be significantly more maintainable if names were used? Are there any other reasons to choose one method over the other?
At 28 NOV 2002 02:24PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Numbers save a dictionary lookup, - with resultant speed gains. Another way is to generate inserts from the dictionaries:
EQU PRICE$ TO 7
* then
somevar=@record
World Leaders in all things RevSoft
At 28 NOV 2002 11:43PM [email protected] wrote:
True that direct access is much faster .. but at the cost of tying yourself to the definition.
With the speed of todays machines and networks I wonder if for the normal user the difference is that great.
[email protected] onmouseover=window.status=the new revelation technology .. a refreshing change;return(true)"
David Tod Sigafoos ~ SigSolutions
Phone: 971-570-2005
OS: Win2k sp2 (5.00.2195)
OI: 4.1.1
PII 300 laptop
At 29 NOV 2002 07:06AM Don Miller - C3 Inc. wrote:
Also, in OI forms, this practice can lead you into real troubles since maintaining @record within the context of a form is problematical. If the code is referring to a different table that is not being maintiained within a form, it can be done, just done use @record. You could do something like this within an event:
READ INV_RECORD FROM INVENT,INV_KEY THEN
INV_REC=INV_REC-{QTY_SHIP}WRITE INV_REC .. , etc.INV_FLAG=1END ELSE
CALL MSG(@WINDOW,'No Inventory Record Found')ERR_FLAG=0 ;* ErrorEND
But @record within a sales form, for example, is not guaranteed to be accurate.
Don Miller
C3 Inc.
Don Miller
At 29 NOV 2002 05:59PM Cliff Harris wrote:
Thanks to everyone for your helpful responses!
At 29 NOV 2002 05:59PM Cliff Harris wrote:
Thanks to everyone for your helpful responses!