arraymenuitems(
ARRAY
,
OPTION
,
VALUE
)

The arraymenuitems( function converts a carriage return delimited array into a series of menu items.


Parameters

This function has three parameters:

array – a carriage return separated array of values to be included in the menu (see Text Arrays.

option – one or more options that modify the appearance of the generated menu items. See below for descriptions of each option. The option name can be specified in either upper or lower case.

value – the value for the option specified in the previous parameter.


Description

This function converts a carriage return delimited array (see Text Arrays) into a series of menu items (see Custom Menus and LMSL. In it’s simplest form this function takes a single parameter, a text array. This example will create a menu that contains all of the cities that have been entered into the current database (of course this might be a very long menu).

menu("Cities")+
   arraymenuitems(listchoices(City,cr())

In addition to the array parameter, you can also specify one or more option/value pairs that modify the menu appearance, like this:

menuitem(title,option1,value1,option2,value2,option3,value3)

Here is an example that creates an Cities menu that is displayed in blue, using the font Futura Condensed.

menu("Cities")+
   arraymenuitems(listchoices(City,cr()),"FONT","Futura Condensed","COLOR","0000FF")

The arraymenuitems( function supports the appearance options FONT, SIZE, STYLE, COLOR and INDENT. For more information about these appearance options see the menuitem( function.

Use the CODE option to set up one or more procedure statements to run when a menu item is chosen (see the menuitem( function for details on this option). Within the code, any occurrence of «» will be replaced with the name of the menu item. In this example, the menu again lists the cities in the database. Choosing one of the cities causes Panorama to select the records containing that city.

menu("Cities")+
   arraymenuitems(
       listchoices(City,cr()),
       "CODE",{
           select City="«»"
       })

You can also use the IDENTIFIER option to set up an identifier for each generated menu option (see the menuitem( function for details on this option). Like the CODE option, within the identifier any occurrence of «» will be replaced with the name of the menu item. Here is an alternate example that also allows the user to select records containing a city.

menu("Cities")+
   arraymenuitems(
       listchoices(City,cr()),
       "IDENTIFIER","«»",
       "CODE",{
           select City=info("menuidentifier")
       })

If no CODE option is set up, the generated menu items will be assigned a default menu action. See the menuitem( function for details.

Using a Different Separator Character

The arraymenuitems( function normally assumes that each element in the array is separated by a carriage return character. The SEPARATOR option allows you to specify a different separator character (or series of characters).

arraymenuitems("Gold|Silver|Bronze","SEPARATOR","|")

Extra Arrays

You can specify two extra arrays for use with this function, ExtraArray1 and ExtraArray2. If used, these arrays should be carriage return separated, and should have the same number of elements as the primary array. You can insert these arrays into the Code and/or Identifier options using «1» and «2». This example creates a menu that lists cities, but then performs a selection based on both the city and the state.

menu("People")+
    arraymenuitems(
        arraybuild(cr(),"",{City}),
        "EXTRAARRAY1",arraybuild(cr(),"",{City+State}),
        "CODE",{
            select City+State="«1»"
        })

History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now allows the font, size, style and color to be modified. (Note: In Panorama 6.0 and earlier versions this function was called arraymenu(. Now either arraymenuitems( or arraymenu( can be used.