@...GET - Check Boxes

From Recital Documentation Wiki
Revision as of 16:21, 5 July 2011 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Create a FoxPro style check box for data input


@<expN1>,<expN2> GET <memvar> FUNCTION <expC1> | PICTURE <expC2>

[COLOR SCHEME <expN3> | COLOR <expC3>]

[DEFAULT <expr>]


[FONT <expC4>[, <expN4>]]

[MESSAGE <expC5>]

[SIZE <expN5>,<expN6>]

[STYLE <expC7>]

[VALID <expL1> | <expN7>]

[WHEN <expL2>]

See Also



The @...GET command can be used to create FoxPro style check box controls. Check boxes have two states, checked, which corresponds to a logical true (.T.) or a numeric 1, or unchecked, which corresponds to a logical false (.F.) or a numeric 0. Check boxes are displayed on the screen at the row <expN1>, column <expN2> coordinates as a pair of square brackets followed by a character string label. If the check box is checked, an asterisk is displayed inside the brackets. If the check box is unchecked, the brackets are empty. The check box can be checked/unchecked using the [SPACEBAR] or the [RETURN] key. To move off a check box, use the cursor keys. The status of the check box is returned to the <memvar>, which must be of logical or numeric data type.

The FUNCTION or PICTURE clauses are used to define the GET as a check box. The definition must include the check box code, "*C", and the text label for the check box. The check box code must be preceded with an "@" in the PICTURE clause. The following options may also be included, immediately after the "*C":

Picture/Function Option Description
N READ is not terminated when check box is checked.
T READ is terminated when check box is checked.

The following clauses can optionally be used:

Keyword Description
COLOR <expC3> COLOR SCHEME clause then the @...GET is displayed in the default Color of Fields. The color that is specified overrides the SET COLOR command, but only for the output of the current @…GET command.
DEFAULT <expr> The DEFAULT clause specifies a default value for <memvar>.
ENABLE If the DISABLE clause is included, the GET is not active and cannot be selected or modified. GETs are enabled by default. READ will exit immediately if all GETs are marked DISABLE.
FONT <expC4>[, <expN4>] The name of the font is specified in <expC4> and, optionally, the font size in <expN4>.
MESSAGE <expC5> Defines a message to be displayed in the message line when the checkbox is the active GET.
SIZE <expN5>,<expN6> Defines the size of the control, <expN5> is the height and <expN6> is the width. Check boxes always have a height of one.
STYLE <expC7> The STYLE clause can include the following in <expC7>:

B = Bold

I = Italic

U = Underline

- = Strikeout

<expN7> The VALID clause is used to validate data entry. When the selected checkbox changes, the validation is called. If the <expL1> evaluates to true (.T.), the input is considered correct and the checkbox is exited. If it evaluates to false (.F.), the selection is rejected. The VALID <expN7> option may be used with a function that returns a numeric value to select a GET for input. GET numbers are assigned in the order that they appear on the screen. The GETNO() function returns the number of the currently active get. The numeric value returned can have three different effects. When <expN7> is 0, the current GET remains in focus. When <expN7> is positive, the value is used to advance the GET focus the number of GETS specified. When <expN7> is negative, the value is used to move back the GET focus the number of GETS specified.
WHEN <expL2> The checkbox only allows selection when <expL2> evaluates to true (.T.).

NOTE: The @...GET...BUTTON syntax can also be used to create check box controls.


mContinue = .F.
@20,0 get mContinue function "*CT Do you want to continue?"
// Another example
mContinue = .F.
@20,0 get mContinue picture "@*CT Do you want to continue?";
  message "Press Return key or Spacebar to continue, cursor key to exit";
  size 1,79
if mContinue
    // Continue
    // Exit