Links are not active on this page.
 @ ... GET - Spinners Command

Included for backward compatibility. Use the Spinner Control instead.

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:

Creates a spinner.

@ row, column 
GET memvar | field
SPINNER expN1 [, expN2
[, expN3]]
	[FUNCTION expC1]
	[PICTURE expC2]
	[FONT expC3 [, expN4]]
	[STYLE expC4]
	[DEFAULT expN5]
	[SIZE expN6, expN7]
	[ENABLE | DISABLE]
	[MESSAGE expC5]
	[RANGE [expN8] [, expN9]]
	[VALID expL1 | expN10
		[ERROR expC6]]
	[WHEN expL2]
	[COLOR SCHEME expN11 
	| COLOR color pair list]

Parameters

row, column
 Row and column are numeric expressions with values of 0 or greater that determine where the spinner appears.

 The first row is number 0 in the main FoxPro window or a user-defined window. Rows are numbered from top to bottom. In FoxPro for Windows, row 0 is the row immediately under the FoxPro system menu bar. In FoxPro for Macintosh, row 0 is the row immediately under the FoxPro title bar.

 The first column is number 0 in the main FoxPro window or a user-defined window. Columns are numbered from left to right.

 When the spinner is directed to a user-defined window, the row and column coordinates are relative to the user-defined window, not the main FoxPro window.

 A position in the main FoxPro window or in a user-defined window is determined by the font of the main FoxPro window or the user-defined window. Most fonts can be displayed in a wide variety of sizes, and some are proportionally spaced. A row corresponds to the height of the current font; a column corresponds to the average width of a letter in the current font.

 You can position the spinner in a window with decimal fractions for row and column coordinates.

GET memvar | field

 The numeric value contained in memvar or field is the initial value displayed in the spinner before READ or READ CYCLE is issued.

 When you choose a value in the spinner, your choice is stored to the numeric memory variable or array element memvar or to the numeric field field.

SPINNER expN1 [, expN2 [, expN3]]
 The values displayed in the spinner are specified with expN1, expN2 and expN3.

 The value displayed in the spinner text box is incremented or decremented by the value specified with expN1. For example, if expN1 is 2 and you click the up or down arrow, the value in the text box increases or decreases by 2.

 The following example defines a spinner for the memory variable MCHOICE. The spinner increments by 1 with a lower limit of -5 and an upper limit of 24. The initial value displayed is 3.

 @ 2,2 GET mchoice SPINNER 1, -5, 24 DEFAULT 3

 The minimum value that can be displayed in the spinner is specified with expN2, and the maximum value that can be displayed is specified with expN3. However, using the keyboard you can enter a value in the text box that lies outside the range specified with expN2 and expN3. Use VALID or RANGE to control what values can be entered in the text box with the keyboard.

[FUNCTION expC1]
[PICTURE expC2]
 When creating spinners, you can include the FUNCTION clause, the PICTURE clause or both. There is no advantage to any of the three methods. The FUNCTION and PICTURE clauses control how memvar or field appears and edited in the text box.

 The following table shows how the FUNCTION clause expC1 determines how values are displayed in the spinner text box.

 expC1 Purpose
 ------- -------

  B Left-justifies the value in the text box.

  I Centers the value in the text box.

  J Right-justifies the value in the text box.

  K Selects the entire value for editing when the cursor is moved to the spinner.

  L Displays leading zeros before the value.

  Z Displays the value as blank if it is 0.

  ^ Displays the value using scientific notation.

  $ Displays the value in a currency format. The currency symbol appears to the left or right of the value depending on the setting of SET CURRENCY.

 The PICTURE clause character expression expC2 determines what values can be entered in the text box, how values are displayed and the appearance of the spinner. The PICTURE clause expression expC2 operates on individual characters in the spinner. You should include enough mask characters to allow entry of the highest value you anticipate in addition to any signs or symbols.

 The 2 (two-dimensional) and 3 (three-dimensional) specification codes are only available in FoxPro for Macintosh.

 expC2 Purpose
 ------- -------

  9 Allows you to enter digits and signs ().

  # Allows you to enter digits, blanks and signs ().

  $ Displays the current currency symbol (specified with SET CURRENCY).

  * Asterisks are displayed to the left of the value.

  . A period specifies the decimal point position.

  , Commas can be included to separate digits to the left of the decimal point.

  2 Creates a flat (two-dimensional) spinner identical to spinners in Macintosh dialogs. This is the default spinner type in FoxPro for Macintosh.

  3 Creates a three-dimensional spinner identical to spinners in FoxPro for Macintosh dialogs.

FONT expC3 [, expN4]
 The character expression expC3 is the name of the font, and the numeric expression expN4 is the font size. For example, the following command displays the text in the spinner in 16-point Courier font:

 @ 2, 2 GET mchoice SPINNER 1, 1, 10 DEFAULT 3 FONT 'Courier', 16

 If you include the FONT clause but omit the font size expN4, a 10-point font is used.

 If the FONT clause is omitted and the spinner is placed in the main FoxPro window, the main FoxPro window font is used. If the FONT clause is omitted and the spinner is placed in a user-defined window, the user-defined window font is used.

 If the font you specify is not available, a font with similar font characteristics is substituted.

STYLE expC4
 In FoxPro for Windows and FoxPro for Macintosh, include the STYLE clause to specify a font style for the spinner. If the font style you specify is not available, a font style with similar characteristics is substituted.

The font style is specified with expC4. If the STYLE clause is omitted, the standard font style is used.

 Character Font Style
 --------- ----------
 
  B  Bold

  C  Condense*

  E  Extend*

  I  Italic

  N  Normal

  O  Outline

  Q  Opaque

  S  Shadow

  -  Strikeout*

  T  Transparent

  U  Underline

 * The Condense and Extend styles are only available in FoxPro for Macintosh. The Strikeout style is only available in FoxPro for Windows.

 You can include more than one character to specify a combination of font styles. For example, the following command displays the text in the spinner in Bold Italic:

 @ 2, 2 GET mchoice SPINNER 1, 1, 10 DEFAULT 3 STYLE 'BI'

DEFAULT expN5
 When you exit a spinner, the value in the spinner is saved to the memory variable, array element or field you specify. If you specify a memory variable that doesn't exist, it is automatically created and initialized to expN5 if you include DEFAULT. However, an array element isn't created if you specify an array element in a DEFAULT clause. The DEFAULT clause is ignored if the memory variable already exists or you specify a field.

 -------------------------------
 Note - If the DEFAULT clause isn't included and memvar doesn't exist, the error message "Variable not found" appears.
 -------------------------------

SIZE expN6, expN7
 The SIZE expN6 expression specifies the height of the spinner. The height of the spinner is a multiple of the height of the current font or the font you specify when you create the spinner. For example, if expN6 is 2, the height of the spinner is twice the height of the current font or the font you specify.

 The numeric expression expN7 specifies the width of the spinner. The width of the spinner is a multiple of the average width of a letter in the current font or the font you specify when you create the spinner. For example, if expN7 is 2, the width of the spinner is twice the width of the average width of a letter in the current font or the font you specify.

 The spinner font determines the size of the spinner. The spinner font is specified with the FONT clause. If the FONT clause is omitted, the spinner uses the font of its parent window (the main FoxPro window or a user-defined window).

ENABLE | DISABLE
 Spinners are enabled when READ or READ CYCLE is issued. You can prevent a spinner from being selected by including DISABLE. The spinner is disabled when READ or READ CYCLE is issued.

 Disabled spinners cannot be selected and are displayed in the disabled colors. Use SHOW GET ENABLE to enable a disabled spinner.

MESSAGE expC5
 The optional MESSAGE clause character expression expC5 appears when the spinner is selected. The message is placed in the graphics-based status bar. If the graphics-based status bar has been turned off with SET STATUS BAR OFF, the message is placed on the last line of the main FoxPro window.

RANGE [expN8] [, expN9]
 Use the RANGE clause to specify a range of acceptable spinner values. If the value entered in the spinner text box isn't within the specified range, a message showing the correct range appears. To override the default range message, create a routine using ON READERROR.

 The lower boundary of the range is specified with expN8, the upper boundary with expN9. Either expN8 or expN9 can be omitted, but not both. If one bound is omitted, that end of the range isn't checked.

 The range isn't checked if you press Enter without changing the initial spinner value.

VALID expL1 | expN10 [ERROR expC6]
 You can include an optional VALID expression expL1 or expN10 that is evaluated when you attempt to exit the spinner.

 -------------------------------
 Note - Unlike the RANGE check, the VALID check is always performed when you attempt to exit the spinner, unless you exit by pressing Esc. The RANGE check is only performed when a change is made to the initial spinner value.
 -------------------------------

 Typically, expL1 or expN10 is a user-defined function. With a user-defined function you can select, enable or disable other objects, open a Browse window, open another data-entry screen or move to a new record. CLEAR READ can be included in the user-defined function to terminate the READ.

 expL1
  If expL1 evaluates to a logical true (.T.), the value in the spinner is considered correct and the spinner is exited.

 If expL1 evaluates false (.F.), the value entered in the spinner is considered incorrect and the spinner remains the active control. A message appears in the graphics-based status bar directing you to reenter the data after pressing the Spacebar.

 expN10

 A VALID clause that includes a numeric expression is used to specify which object is activated after a spinner is chosen. Objects include @ ... GET input fields, check boxes, lists, popups, spinners, text-editing regions and each individual button in a set of push, radio and invisible buttons.

  When expN10 = 0, the spinner remains the active object and the MESSAGE expC5 and ERROR expC6 messages are suppressed. A special error message routine can be written as part of a user-defined function called by the VALID clause.

  When expN10 is positive, expN10 specifies the number of objects to advance. For example, when the spinner is selected and VALID returns 1, the next object is activated. If expN10 is greater than the number of remaining objects, the READ is terminated (unless READ CYCLE is issued to activate the objects).

  When expN10 is negative, expN10 specifies the number of objects to move back. For example, when the spinner is selected and VALID returns -1, the previous object is activated. If expN10 moves back past the first object, the READ is terminated (unless READ CYCLE is issued to activate the objects).

ERROR expC6
 The ERROR clause lets you specify a custom error message that appears when the VALID clause evaluates to false (.F.). expC6 appears in place of the default error message.

WHEN expL2
 The optional WHEN clause allows or prohibits the selection of a spinner based on the logical value of expL2, which must evaluate to a logical true (.T.) before the spinner can be selected. If expL2 evaluates to a logical false (.F.), the spinner cannot be selected and is skipped over if placed between other objects.

COLOR SCHEME expN11 | COLOR color pair list
 If you do not include a COLOR clause, spinner colors are determined by the color scheme for the main FoxPro window; if a spinner is placed in a user-defined window, the window's color scheme determines the spinner's colors.

 The colors of a spinner can be specified by including the number of an existing color scheme in the COLOR SCHEME clause or a set of color pairs in the COLOR clause.

 A color scheme is a set of 10 predefined color pairs. The color pairs in a color scheme can be changed with SET COLOR OF SCHEME.

 A color pair is a set of two letters separated by a forward slash. The first letter specifies the foreground color and the second letter specifies the background color.

 For example, this color pair specifies a red foreground on a white background:

 R/W

 For a list of colors and their corresponding color letters, see SET COLOR Commands Overview or Color Table by Color Pair.

 A color pair can also be specified with a set of six RGB (Red Green Blue) color values separated by commas. The first three color values specify the foreground color and the second three color values specify the background color. The color values can range from 0 through 255.

 The R/W color pair in the example above can also be specified with this RGB color pair:

 RGB(255,0,0,255,255,255)

Expand imageRemarks


@ ... GET Spinners is supported in FoxPro for Windows and FoxPro for Macintosh.

A spinner is a control that lets you "spin" through a set of numeric values displayed in a text box.

If you use the Screen Builder to create your data-entry screens, you might not have to use this command at all. The Screen Builder automatically generates the commands that create spinners.

Clicking the up and down arrows changes the numeric value. You can also enter a value directly into the spinner text box. When the value you want appears in the text box, press Enter or Tab to move to the next object.

Using the spinner syntax in FoxPro for MS-DOS creates a numeric @ ... GET editing region. You must enter a numeric value into the editing region with the keyboard. The increment value (expN1), the lower and upper limit values (expN2, expN3) and the FONT and STYLE clauses are ignored.

Expand imageSee Also