Microsoft KB Archive/99913

{| = Example of @ ... GET FUNCTION M =
 * width="100%"|

ID: Q99913

The information in this article applies to:


 * Microsoft FoxPro for Windows, versions 2.5 and 2.5a
 * Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

SUMMARY
There is no example of the M function code of the @ ... GET command in the FoxPro documentation. The example below illustrates its syntax and usage.

Method 1
The following code displays a GET field in which pressing the SPACEBAR cycles through the names in the comma-separated list. Pressing the RETURN key stores the currently displayed name to the variable MARX.

PRIVATE marx @2,2 GET marx ; FUNCTION 'M Groucho,Chico,Harpo,Zeppo' ; SIZE 1,7 ; DEFAULT SPACE(7) READ NOTE: The space between &quot;M&quot; and the beginning of the list is critical. If there is no space, the GET field displays garbage.

Method 2
In the Format box for a screen GET object, type the following:

@M Choice1,Choice2,Choice3[,...] FUNCTION codes can be included in a PICURE clause (which is what the Format option generates). In this case, the PICTURE clause must start with &quot;@&quot;. NOTE: If the GET object is a memory variable, its assigned value length will determine how many characters of the list items will be displayed. If no value is assigned to the memory variable, then the DEFAULT value of &quot; &quot; (a blank space of one character length) is used and will then only display the first character of the items in the list.