# menu

Displays a list of programs and lets the user launch one.

### Synopsis

`menu [program list]`

### Description

This program displays a list of programs on the screen, lets the user pick one, and runs it. After the selected program completes, the list of programs is displayed again and the user can make another selection.

When the list is on screen, the user can press the up and down arrows on the control pad to change the selected program, press A to select a program to run, and presses Stop to exit.

During startup, this program reads a file which defines the list of programs to display on screen. Every line in this file defines a program, using the following format:

["] label ["] cmd-line

label
  the string that represents this program in the screen display. Surround this string with quotes (") if it contains any spaces.

cmd-line
  used as a command-line. Whenever the user selects the entry, this command-line is executed as is.

Within the program list, empty lines are ignored. A semicolon indicates the start of a comment. Any text following a semicolon is ignored until the end of the line. Linefeed or a carriage return indicate the end of a line.

### Arguments

program list
  Name of a file containing a list of programs to run. If this argument is not supplied, the default name of menu.script is assumed.

### Associated Files

menu.c, gfxutils.h, gfxutils.c, programlist.h, programlist.c

### Location

examples/Miscellaneous/menu