Example of @ ... GET FUNCTION M

ID: Q99913

The information in this article applies to:

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.

MORE INFORMATION

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 "M" 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 "@".

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 " " (a blank space of one character length) is used and will then only display the first character of the items in the list.

REFERENCES

"Commands & Functions," version 2.0, see "@ ... SAY/GET FUNCTION Code" "Language Reference," version 2.5, page L3-33

Additional reference words: FoxDos FoxWin 2.50 2.00 2.50a docerr KBCategory: kbprg kbdocerr KBSubcategory: FxprgGeneral

Last Reviewed: June 27, 1995