User

Type

Text

The User switch adds a custom menu item to the PWB Run menu.

Syntax

User: title,path,[[arg]],[[out]],[[dir]],[[help]],[[prompt]],[[ask]],[[back]],[[key]]

If any argument to the User switch contains spaces, it must be enclosed in double quotation marks.

title

Menu title for the program to be added. No other command can have the same title. Prefix the character to be highlighted as the access key with a tilde (~) or ampersand (&). If you do not specify an access key, the first letter of the title is used.

path

Full path of the program. If the program is on the PATH environment variable, you can specify just the filename of the program.

arg

Command-line arguments for the program. To pass the name of the current file to the program, specify %s in the command line. Default: no arguments.

out

Name of a file to store program output. If no file is specified and the program is run in the foreground, the current file in PWB receives the output. Default: no output file.

dir

Current directory for the program. Default: PWB's current directory.

help

Text that appears on the status bar when the menu item is selected. Default: no help text.

prompt

Determines if PWB prompts for command-line arguments. The value of arg is the default response. Specify Y to prompt or any other character to run the program without prompting for arguments. Default: no prompt.

ask

Determines if PWB is to prompt for a keystroke before returning to PWB. Specify Y to prompt or any other character to return to PWB immediately after running the program. Default: return without prompting.

back

Determines if the program is run in the background under a multithreaded environment. Specify Y to run the program in the background or any other character to run it in the foreground. If you run the program in the background, you must also specify output. Default: run the program in the foreground.

key

A single digit from 1 to 9, specifying a key from ALT+F1 to ALT+F9 as the shortcut key for the command. Default: no shortcut key.

Default

By default, no custom menu commands are defined.

Example

The User switch setting

User : "~Print", XPRINT, "/2 %s", LPT1, , \

"Print the current file with XPRINT", y, n, n, 8

specifies the following custom Run menu command:

Option Description

title The menu title is Print with the accelerator P.
path The XPRINT program is expected to be on the PATH.
arg The default command line specifies the /2 option and the current filename.
out The program output is redirected to the LPT1 device.
dir The XPRINT program is run in the current directory.
help The Help line is Print the current file with XPRINT.
prompt PWB prompts for additional arguments.
ask PWB doesn't prompt before returning from XPRINT.
back The XPRINT program is to run in the foreground.
key ALT+F8 runs the XPRINT program after prompting.

The backslash at the end of the first line of the definition is a TOOLS.INI line continuation.

See

Printcmd, _pwbusern, Usercmd