setprocedureoptions
DATABASE
,
PROCEDURE
,
OPTION
,
VALUE

The setprocedureoptions statement modifies one or more properties of a procedure (source code, Action menu options, etc.).


Parameters

This statement has four parameters:

database – The database that contains the procedure you want to modify, or "" for the currently active database. The database must be open.

procedure – The name of the procedure you want to modify, or "" for the currently open procedure (if a procedure editor window is active).

option – The type of information you want to modify. See below for descriptions of each option. The option can be specified in either upper or lower case.

value – The new value for this option.


Description

This function modifies information about any procedure in any open database.

Note: You can specify multiple option/value pairs in a single setprocedureoptions statement, like this:

setprocedureoptions dataabase,procedure,option1,value1,option2,value2,option3,value3

SOURCE

This option modifies the source code of the specified procedure. If the procedure is currently open you’ll see the the change immediately. This example creates a new procedure called Aloha.

makenewprocedure "Aloha"
setprocedureoptions "","Aloha","SOURCE",{message "Aloha"}

The new procedure is ready to use.

Note: If the source code you specify is invalid (contains a syntax error, unknown statement, etc.) then the procedure will stop with an error. (Of course you can trap this error with if error, etc.)

NAME

This option changes the name of the specified procedure. This example changes the name of the procedure Aloha to Hello.

setprocedureoptions "","Aloha","NAME","Hello"

The database must not already contain a procedure with the new name. If it does, the setprocedureoption statement will stop with an error.

POSITION

This option moves the procedure to a new position in the list of procedures. This is primarily useful for changing the order in which procedures appear in the Action Menu.

This example moves the Add Invoice procedure so that it appears before the Delete Invoice procedure.

setprocedureoptions "","Add Invoice","POSITION","Delete Invoice"

Use "" to move a procedure to the end of the list, like this:

setprocedureoptions "","Display Contact","POSITION",""

DELETE

This option deletes the specified procedure.

setprocedureoptions "","Destroy Universe","DELETE",""

Notice that even though the option value is not used, you must still supply it.

EXCLUDEFROMVIEWMENU

If this option is false, the procedure is displayed in the View menu. If this option is true, the procedure will be excluded from the View menu.

TAG

This option assigns a tag to this procedure (if any). You can use the tag value for whatever you want, Panorama stores the tag for you but does not use or interpret it in any way.


### Menu Options ###

The following options modify the appearance and operation of the Action menu item associated with the specified procedure.

Action menu items are normally black, but can be changed to any color using this item. The color can be specified using rgb(, hsb( or other color functions (see Colors), or simply by specifying text containing an HTML color.

setprocedureoptions "","Red","MENUCOLOR",rgb( 65535 , 0 , 0 )
setprocedureoptions "","Red","MENUCOLOR","FF0000"

This option specifies that the Action menu item associated with this procedure should be disabled (dim).

setprocedureoptions "","Destroy Universe","MENUDISABLED",true() // don't allow this option!
setprocedureoption "","Destroy Universe","MENUDISABLED","Yes" // other alternatives are "True" and "On"

Panorama normally has special treatment for procedure names that start with the ( symbol. This option tells Panorama to skip the special treatment (but for this procedure only) and display the procedure name as-is, including the leading ( symbol.

setprocedureoptions "","(213) 555=1212","MENUDISPLAYLEADINGPARENTHESES",true()

This option specifies a custom font for the Action menu item associated with the specified procedure.

setprocedureoptions "","People","MENUFONT","Papyrus"

You can use this option on its own or in combination with the MENUFONTSIZE and MENUSTYLE options.

setprocedureoptions "","Run","MENUFONT","Optima","MENUSTYLE","ITALIC"

This option specifies a custom font size for the Action menu item associated with the specified procedure. The size is specified in points.

setprocedureoptions "","Big Big People","MENUFONTSIZE",36

You can use this option on its own or in combination with the MENUFONT and MENUSTYLE options.

setprocedureoption "","Run","MENUFONT","Helvetica","MENUFONTSIZE",7

This option indents the procedure name in the Action menu. You could achieve the same effect by adding spaces to the front of the procedure name, but this option allows the same effect without changing the name (which means that call statements to this procedure will not be broken). This example shows how to indent various shipping options under a main Shipping menu item.

setprocedureoptions "","Shipping","MENUINDENT",0
setprocedureoptions "","FedEx","MENUINDENT",1
setprocedureoptions "","US Mail","MENUINDENT",1
setprocedureoptions "","UPS","MENUINDENT",1

This option specifies that this procedure should not be included in the Action menu. (Note: Procedures with names beginning with period, or following a () procedure, will also be invisible.)

setprocedureoptions "","Reset","MENUINVISIBLE",true() // user can't even see this option!

This option specifies the command key equivalent, if any, for the Action menu item associated with this procedure. If an alphabetic character is used, it should be lower case unless you want the SHIFT key to be part of the key equivalent.

setprocedureoptions "","Create Universe","MENUKEY","u" // Command-U
setprocedureoptions "","Create Universe","MENUKEY","U" // Command-Shift-U

Note: If the command key equivalent you specify conflicts with one of Panorama’s built-in menu items, your key equivalent will not appear. If you notice that your command key equivalent is not working, carefully check all of Panorama’s built-in menus and you’ll probably find that there is a conflict.

Note: See the MENUKEYMODIFIERS option for an alternative method to specify the SHIFT key as part of the command key equivalent.

This option specifies any modifier keys for the command key equivalent specified by the MENUKEY option. The available modifier keys are "SHIFT", "OPTION" and "CONTROL". You can use these options separately or in combination.

setprocedureoptions "","Color","MENUKEY","y,"MENUKEYMODIFIERS","shift" // ⌘-Shift-Y
setprocedureoptions "","Color","MENUKEY","y,"MENUKEYMODIFIERS","shift option" // ⌘-Shift-Option-Y
setprocedureoptions "","Color","MENUKEY","y,"MENUKEYMODIFIERS","shiftoption" // ⌘-Shift-Option-Y

Note: You can also use the "NOCOMMAND" option to specify a key equivalent without the command key. Be very careful when doing this, however, since they combination you specify will no longer be available for regular typing.

This option allows you to add a checkmark to the Action menu item associated with the procedure.

setprocedureoptions "","Shipped","MENUSTATE",true() // show checkmark
setprocedureoptions "","Shipped","MENUSTATE","on" // or "yes" or "true"
setprocedureoptions "","Shipped","MENUSTATE",false() // don't show checkmark
setprocedureoptions "","Shipped","MENUSTATE","off" // or "no" or "false"

You can also specify a mixed state, both on and off. This is displayed as a minus sign (dash) just to the left of the procedure name in the menu. For example, this could be used to indicate a partially shipped order.

setprocedureoptions "","Shipped","MENUSTATE","mixed" // show dash
setprocedureoptions "","Shipped","MENUSTATE","on off" // show dash
setprocedureoptions "","Shipped","MENUSTATE","onoff" // or "yesno", "truefalse", "offon" etc.

This option specifies a style for the Action menu item associated with the specified procedure.

setprocedureoptions "","People","MENUSTYLE","italic"
setprocedureoptions "","People","MENUSTYLE","bold"
setprocedureoptions "","People","MENUSTYLE","bold italic"

In the last example, the space is optional, and you can specify the styles in any order.

You can use this option on its own or in combination with the MENUFONTSIZE and MENUSTYLE options.

setprocedureoptions "","Run","MENUFONT","Optima","MENUSTYLE","ITALIC"

Note: Not all fonts support bold and/or italic styles. If the style doesn’t appear, check to make sure that the fonts supports the requested style. (Note: The standard system menu font does not support italic. However, if you are using the standard system menu font Panorama will automatically switch to Helvetica if the menu item has an italic style.)


See Also


History

VersionStatusNotes
10.2NewNew option excludefromviewmenu.
10.0NewThis statement is new in this version.