SHOW GETS Command
|Visual FoxPro 9.0 SP2|
|SHOW GETS Command|
Included for backward compatibility. Use the Refresh method to redisplay all controls on a form or formset after changing the control's properties.
This command is undocumented in the original VFP9 help file,
but the following documentation was found in the FoxPro for Windows 2.6 help, and may still be valid:
Redisplays all @ ... GET controls.
SHOW GETS [ENABLE | DISABLE] [LEVEL expN1] [OFF | ONLY] [WINDOW window name] [LOCK] [COLOR SCHEME expN2 | COLOR color pair list ]
SHOW GETS redisplays all controls (check boxes, fields, invisible, push or radio buttons, lists; popups, spinners or text-editing regions). When values in @ ... GET fields change (the cursor moves to a new record, for example), SHOW GETS updates the values of the @ ... GET fields. Controls can be enabled or disabled when they are redisplayed.
A routine containing SHOW GETS can be used to redisplay @ ... GET controls. A GET LEVEL VALID or WHEN, or a READ LEVEL ACTIVATE or DEACTIVATE routine can contain SHOW GETS.
READ supports a SHOW clause that executes a routine whenever SHOW GETS is issued. A READ SHOW routine is often used to refresh output of @ ... SAYS.When SHOW GETS is issued, the SHOW routine is executed and all the controls are redisplayed.
Issuing SHOW GETS resets UPDATED() to false (.F.).
SHOW GETS vs. SHOW GET and SHOW OBJECT
All controls created with @ ... GET are redisplayed with SHOW GETS. Individual controls are redisplayed with SHOW GET or SHOW OBJECT. SHOW GETS executes the READ-level SHOW routine. SHOW GET and SHOW OBJECT don't.
SHOW OBJECT is similar to SHOW GET except that SHOW OBJECT references controls by their object number, and SHOW GET references controls by var, the memory variable, array element or field specified when the control is created. For more information on control numbering, see OBJNUM() or _CUROBJ.
ENABLE | DISABLE
Including ENABLE allows all controls to be selected or chosen. Including DISABLE prevents all controls from being selected or chosen and redisplays them in disabled colors.
You can nest READs by issuing @ ... GETS and a READ in a routine called in an active READ. READs can be nested to five levels.
If you don't include a LEVEL clause, SHOW GETS defaults to the current READ level. Include a LEVEL clause to redisplay controls on a level other than the current level. The numeric expression expN2 can assume the value 1, 2, 3, 4 or 5, corresponding to the READ level of the controls to redisplay. RDLEVEL() returns the current READ level.
OFF | ONLY
When OFF is included, SHOW GETS executes only the READ SHOW routine and doesn't refresh any controls. When ONLY is included, SHOW GETS refreshes only the controls and doesn't execute the READ SHOW routine.
WINDOW window name
Controls can be placed in different windows and activated with a single READ. The WINDOW clause lets you redisplay controls in a specific window without redisplaying controls in all windows. Specify the window name for the controls to redisplay with window name. SYS(2016) returns an asterisk (*) if you issue SHOW GETS without a WINDOW clause. SYS(2016) returns the name of the window if you issue SHOW GETS with a WINDOW clause.
When a READ is issued and a table is opened for shared access on a network, FoxPro might attempt to lock all records involved in the READ. If READ or READ LOCK is issued, FoxPro attempts to lock all the records involved in the READ. If READ NOLOCK is issued, FoxPro makes no attempt to lock the records and makes all fields involved in the READ read-only.
SHOW GETS assumes the record-locking behavior of the READ. If READ or READ LOCK is issued, SHOW GETS attempts to lock the records involved in the READ. If READ NOLOCK is issued, SHOW GETS makes no attempt to lock the records, and all fields involved in the READ are made read-only.
If LOCK is included in SHOW GETS, SHOW GETS always attempts to lock the records involved in the READ. Issuing SHOW GETS LOCK lets you override READ NOLOCK.
For further information on how record locking is attempted during a READ, see READ in this manual.
COLOR SCHEME expN2 | COLOR color pair list
Controls can be redisplayed in the colors you specify. You can specify a color scheme or a color pair list. For information about control colors, see @ ... GET and the Controls section in this manual.
The following example creates a data-entry window and a control window that uses DO to call procedures that move you through CUSTOMER.DBF.
CLOSE ALL SET TALK OFF DEFINE WINDOW customer FROM 3,3 TO 13,57 ; FLOAT SHADOW DOUBLE DEFINE WINDOW panel2 FROM 2, 61 TO 14,74 ; FLOAT SHADOW DOUBLE COLOR SCHEME 5 USE customer ACTIVATE WINDOW customer NOSHOW @ 3,3 SAY 'Company' @ 3,14 GET customer.company SIZE 1,35 @ 5,3 SAY 'Contact' @ 5,14 GET customer.contact SIZE 1,35 @ 7,3 SAY 'City/State' @ 7,14 GET customer.city SIZE 1,21 @ 7,36 GET customer.state @ 7,39 GET customer.zip @ 0,3 SAY 'Customer #' @ 0,15 SAY cno SIZE 1,6 @ 0,36 SAY 'Record #' @ 0,46 SAY RECNO() SIZE 1,3 ACTIVATE WINDOW panel2 @ 1,2 GET act PICTURE; '@*VN Top;Prior;Next;Bottom;\?Quit' ; SIZE 1,8,1 DEFAULT 0 VALID actvalid() READ CYCLE SHOW readshow() COLOR ,R/BG RELEASE WINDOWS customer,panel2 FUNCTION actvalid DO CASE CASE act = 1 GO TOP CASE ACT = 2 DO go_prev CASE ACT = 3 DO go_next CASE act = 4 GO BOTTOM CASE act = 5 CLEAR READ ENDCASE SHOW GETS RETURN 0 FUNCTION readshow STORE WOUTPUT() TO currwind IF SYS(2016) = 'customer' OR SYS(2016) = '*' ACTIVATE WINDOW customer SAME @ 0,15 SAY cno SIZE 1,6 @ 0,46 SAY RECNO() SIZE 1,3 ENDIF IF NOT EMPTY(currwind) ACTIVATE WINDOW (currwind) SAME ENDIF RETURN .T. PROCEDURE go_prev SKIP -1 IF BOF() GO TOP ENDIF RETURN PROCEDURE go_next SKIP 1 IF EOF() GO BOTTOM ENDIF RETURN
Comment or report problem with topic