@...GET - Popups

From Recital Documentation Wiki
Jump to: navigation, search


Create a FoxPro style popup


@<expN1>,<expN2> GET <memvar>

[FUNCTION <expC1> | PICTURE <expC2>] | [FROM <array> [RANGE <expN3> [,<expN4>]]]

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

[DEFAULT <exp>]


[FONT <expC4>[, <expN6>]]

[MESSAGE <expC5>]

[SIZE <expN7>,<expN8>]

[STYLE <expC7>]

[VALID <expL1> | <expN9>]

[WHEN <expL2>]

See Also



The @…GET command can be used to create FoxPro style popups. Popups offer a popup list of options for numeric or character values. The top left hand corner of the popup is positioned at row <expN1>, column <expN2>. When an item is selected from the list, <memvar> is updated. If the initial value of <memvar> is numeric, the position of the selected item is stored, if it is character, the prompt is stored. The cursor keys and can be used to navigate within the list and the [SPACEBAR] or [RETURN] key or mouse click to select an option. In Recital Terminal Developer environments, the [SPACEBAR] or [RETURN] key is used to popup the list.

The FUNCTION clause or the PICTURE clause is required. The circumflex character, '^' signals that the @…GET is a popup. The following options may also be included, immediately after the "^":

Picture/Function Option Description
N READ is not terminated when option is chosen.
T READ is terminated when option is chosen.

Unless the optional FROM <array> clause is being used, the FUNCTION or PICTURE clause must also contain the options for the popup. The options are preceded by a space, following the circumflex and any read termination option, and are separated with semi-colons.

@...GET mchoice FUNCTION "^ <option1>;<option2>;<option3> ..."...


@...GET mchoice PICTURE "@^ <option1>;<option2>;<option3> ..."...

FROM <array> [RANGE <expN3> [,<expN4>]]

As an alternative to defining the options in the FUNCTION or PICTURE clause, the popup can be based on the contents of a pre-declared one or two-dimensional array, specified in <array>. The optional RANGE clause can be used with array based popups to restrict the array elements that appear in the list. The <expN3> defines the number of the first array element to appear in the list and the optional <expN4> defines the number of elements to include. If <expN4> is not defined, all elements starting from <expN3> are included in the list.

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>[, <expN6>] The name of the font is specified in <expC5> and, optionally, the font size in <expN6>.
MESSAGE <expC5> Defines a message to be displayed in the message line when the popup is the active GET.
SIZE <expN7>,<expN8> By default, the width of the popup is determined by the width of the widest item and the height is determined by the number of options in the popup. The SIZE clause can optionally be used to override the width only. The height is specified in <expN7> (this is ignored but must be included) and the width in <expN8>.
STYLE <expC7> The STYLE clause can include the following in <expC7>:

B = Bold

I = Italic

U = Underline

- = Strikeout

<expN9> The VALID clause does not carry out validation in this case, since the <memvar> has already been updated, but can be used to call a UDF (User Defined Function). The VALID <expN9> 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 <expN9> is 0, the current GET remains in focus. When <expN9> 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 popup only allows selection when <expL2> evaluates to true (.T.).


store "Banana" to mchoice
@10,10 get mchoice function "^T Apple;Orange;Banana"
dialog box "You chose" + mchoice