[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| VARREAD |
+---------------------------------+
VARREAD()
-----------------------------------
Returns name of the current field or object.
Return value - Character
-----------------------------------
This function returns the name of the memory variable, array element or
database field used to create the current GET field or object. If a
Browse, Change or Edit window is active, the name of the current field
is returned.
If a GET field or object is active, the name of the memory variable,
array element or database field is returned in upper case. If a Browse,
Change or Edit window is active, the name of the current field is
returned with just the first letter capitalized.
VARREAD() is identical to the SYS(18) function. Both may be used to
pass the current field or object name to a procedure. The procedure may
provide context sensitive help as in the following example.
+---------------------------------+
| Program Example |
+---------------------------------+
ON KEY LABEL F1 DO Help WITH VARREAD()
SET TALK OFF
USE customer
SCATTER TO temp
DEFINE WINDOW input FROM 6,10 to 18,70 PANEL
ACTIVATE WINDOW input
@ 1,3 SAY 'Customer: ' GET company
@ 3,3 SAY 'Address: ' GET address1
@ 5,3 SAY 'City: ' GET city
@ 7,3 SAY 'State: ' GET state
@ 7,18 SAY 'Zip: ' GET zip
@ 9,07 SAY 'Press <Escape> to cancel or <F1> for help'
READ
IF LASTKEY() = 27
GATHER FROM temp
ENDIF
DEACTIVATE WINDOW input
ON KEY LABEL F1
DISPLAY
RETURN
*** Help Procedure ***
PROCEDURE Help
PARAMETERS fieldname
DO CASE
CASE fieldname = 'COMPANY'
WAIT WINDOW 'Enter the company name' NOWAIT
CASE fieldname = 'ADDRESS1'
WAIT WINDOW 'Enter the entire street address' NOWAIT
CASE fieldname = 'CITY'
WAIT WINDOW 'Enter the city name' NOWAIT
CASE fieldname = 'STATE'
WAIT WINDOW 'Enter a two character state abbreviation' NOWAIT
CASE fieldname = 'ZIP'
WAIT WINDOW 'Enter the five digit Zip code' NOWAIT
ENDCASE
RETURN
-----------------------------------
See Also: @ ... SAY/GET, BROWSE, CHANGE, EDIT, SYS(18) Current
field/object
-----------------------------------
See Also:
@ ... SAY/GET
BROWSE
CHANGE
EDIT
SYS(18) Current
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson