getprocedureoption(
getprocedureoption(
DATABASE
,
PROCEDURE
,
OPTION
)

The getprocedureoption( function returns information about a procedure.

Parameters

This function has three parameters:

database – The database that contains the procedure you want information about, or `""` for the current database.

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

option – The type of information you want to retrieve. See below for descriptions of each option. This parameter is optional, if left off, the `ALL` option will be used.

Description

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

#### ALL

This option returns a dictionary that contains all of the option values associated with this procedure. You can extract individual options with the getdictionaryvalue( function. (You can also get this dictionary by simply omitting the option parameter.) This example displays information about a procedure’s syntax error (if it has one).

    local pinfo
    pinfo = getprocedureoption("","SomeProcedure")
    if getdictionaryvalue(pinfo,"ERROR") <> ""
        message "Error in procedure "+getdictionaryvalue(pinfo,"NAME")+cr()+cr()+
            getdictionaryvalue(pinfo,"ERROR")+cr()+
            "CODE:"+getdictionaryvalue(pinfo,"SOURCE")[getdictionaryvalue(pinfo,"ERRORSTART"),
                                                       getdictionaryvalue(pinfo,"ERROREND")]
    endif

#### SOURCE

This option returns the source code of the specified procedure. This example uses this option to create a list of procedures in the current database that contain the word message.

    local proclist
    proclist = dbinfo("procedures","")
    proclist = arraystrip(arrayfilter(proclist,cr(),
        {?(getprocedureoption("",import(),"SOURCE") contains "message",import(),"")}),cr())
    message proclist

#### ERROR

This option checks to see if the procedure has a syntax (compile time) error, and if so, reports the error. If there is no error, `""` is returned. This example returns a list of the procedures in the current database that contain an error.

    local proclist
    proclist = dbinfo("procedures","")
    proclist = arraystrip(arrayfilter(proclist,cr(),
        {?(getprocedureoption("",import(),"ERROR") <>"",import()+
            ":"+getprocedureoption("",import(),"ERROR"),"")}),cr())
    message proclist

The output of this procedure will be something like this:

    AddInvoice:Unknown statement:totals
    VoidInvoice:Missing Right Parenthesis

#### ERRORSTART

If the specified procedure contains an error, this option will return the starting position of the error within the source code.

#### ERROREND

If the specified procedure contains an error, this option will return the ending position of the error within the source code.

#### LABELS

This option returns a carriage return delimited list of labels defined in the specified procedure (if any).

#### POSITION and SIZE

The “windowleftedge”, “windowtopedge”, “windowrightedge” and “windowbottomedge” options return the saved dimensions of the procedure window (whether it is currently open or not). The “windowrectangle” function returns a rectangle with all four coordinates.

#### TAG

This option returns the tag you have assigned 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.

### Window Options

The following options return information about the window associated with the specified procedure (if there is an open window).

#### WINDOWNAME

If the window for this procedure is open, this option returns the name of the window (if not open, returns empty text).

#### WINDOWNUMBER

If the window for this procedure is open, this option returns the ID number of the window (if not open, returns zero). See Window ID Numbers to learn more about using this option.

### Menu Options

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

#### MENUCOLOR

This option returns the color the Action menu item associated with the specified procedure.

    colorHue = hue(getprocedureoption("","FedEx","MENUCOLOR"))

See Colors for more information about using colors with Panorama.

#### MENUDISABLED

This option checks whether the Action menu item associated with this procedure is disabled (dim).

    RushAvailable = getprocedureoption("","Rush","MENUDISABLED") = false()

#### MENUDISPLAYLEADINGPARENTHESES

Panorama normally has special treatment for procedure names that start with the ( symbol, but this special treatment can be turned off on a menu item by item basis. This option checks to see whether the special ( treatment is enabled or not.

    getprocedureoption("","(213) 555=1212","MENUDISPLAYLEADINGPARENTHESES")

#### MENUFONT

This option returns the font assigned to the Action menu item associated with the specified procedure.

    if getprocedureoption("","People","MENUFONT") = "Marker Felt"
        message "Really?"
    endif

Note: If the item uses the system menu font this function will return `""`.

#### MENUFONTSIZE

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

    if getprocedureoption("","Big Big People","MENUFONTSIZE") > 24
        message "Wow, that's big!"
    endif

#### MENUINDENT

This option returns the indent level of the Action menu item associated with this procedure.

#### MENUINVISIBLE

This option returns true if the specified procedure is invisible (not included in the Action menu). Note: This option does not return true for procedures with names beginning with a period, or procedures following a () procedure, even though those are also invisible.

#### MENUKEY

This option returns the command key equivalent, if any, for the Action menu item associated with this procedure.

    if getprocedureoption("",someProcedure,"MENUKEY") <> ""
        message "This item has a command key equivalent"
    endif

#### MENUKEYMODIFIERS

This option returns any modifier keys for the command key equivalent associated with this procedure. The available modifier keys are `"SHIFT"`, `"OPTION"` and `"CONTROL"`. You can use these options separately or in combination.

    if getprocedureoption("","Color","MENUKEYMODIFIERS","shift") contains "OPTION"

#### MENUSTATE

This option returns whether or not the Action menu item associated with the procedure has a checkmark.

    if getprocedureoption("","Shipped","MENUSTATE") = "ON" // checked
        // shipped
        ...
    endif
    if getprocedureoption("","Shipped","MENUSTATE") = "" // not checked
        // not shipped
        ...
    endif
    if getprocedureoption("","Shipped","MENUSTATE") = "MIXED" // dash
        // partially shipped
        ...
    endif

#### MENUSTYLE

This option returns the style used by the Action menu item associated with the specified procedure.

    if getprocedureoption("","People","MENUSTATE") contains "italic"
        ...
    endif
    if getprocedureoption("","People","MENUSTATE") = ""
        // plain text
        ...
    endif

See Also

- activeobjectaction -- allows a procedure to communicate with the object on the current form that is currently being edited (if any).
- automaticprocedurename( -- returns an available procedure name.
- changeobject -- modifies the properties of one object in a form.
- changeobjects -- modifies the properties of one or more objects in a form.
- changetimer -- modifies a repeating task that will be performed periodically when Panorama is not otherwise busy.
- cloneform -- copies all of the objects in a form (optionally, with modifications) into the active form.
- cloneobjects -- duplicates objects in a form (with modifications).
- closeactiveobject -- closes any object whose text is currently being edited.
- closedatabaseactiveobjects -- stops all text editing associated with the current database.
- dbinfo( -- gets information about a database: what forms it contains, what fields, what flash art pictures, etc.
- downloadpartialdatabase -- downloads specified components of the current database from the server. The current database must be shared.
- exportallprocedures -- saves all the procedures in an editable text format.
- exportprocedure( -- exports a procedure and the procedure's meta data as a binary object that can be imported with the importprocedure statement.
- fileglobalvalue( -- accesses a fileglobal or permanent variable from other databases.
- formxy -- programmatically scrolls a form to a new position.
- getfieldproperties( -- returns a dictionary containing all of the properties of the specified field. (See the setfieldproperties statement if you want to change one or more field properties.)
- getformoption( -- returns information about a form.
- getmaxwindow -- retrieves the position and size of the of the largest possible window on the main screen.
- getproceduretext -- gets the contents (source) of a procedure and places it in a variable.
- getproceduretext( -- gets the contents (source code) of a procedure.
- getwindow -- retrieves the position and size of the current window.
- globalvalue( -- returns the value of a global variable.
- Implicitly Triggered Procedures -- Procedures that are triggered automatically when the user performs some normal Panorama action are said to be "implicitly triggered."
- importdatabase -- imports data from another database into the current database.
- importdictprocedures -- converts source code exported by the ExportAllProcedures statement into a dictionary.
- importjson -- imports a JSON array into the current database.
- importjsonline -- imports a JSON record into the current record.
- importline -- imports a line of text into the current record.
- importprocedure -- imports a procedure into a database.
- importrawdata -- imports raw binary data into an existing database.
- importtext -- imports text into an existing database.
- info( -- returns miscellaneous bits of information about the system, the current database, the current window, etc.
- info("accessorypanelwidth") -- returns the current width of the current window's accessory panel, if any.
- info("activesuperobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("angleunits") -- returns the current angular measurement units.
- info("applicationsfolder") -- returns the path to the current user's Applications folder.
- info("applicationsupportfolder") -- returns the path to the current user's Application Support folder (inside the Library folder).
- info("arraybuildstatus") -- returns the status of the most recently executed superarraybuild statement.
- info("availablescreenrectangle") -- returns a rectangle defining the edges of the main screen, after deducting for the space of the menu bar and dock (if visible).
- info("bof") -- returns true if the active record is currently on the first visible (selected) record.
- info("buttonrectangle") -- returns a rectangle defining the edges of the most recently clicked button.
- info("cachefolder") -- returns the path to the current user's Cache folder (in the Library folder).
- info("click") -- returns the location of the last mouse click in screen relative coordinates.
- info("clickedobjectid") -- returns the object ID of the clicked object.
- info("clickedobjectname") -- returns the name of the button that was just clicked.
- info("clickedwindownumber") -- returns the window number of that was just clicked.
- info("clonewindow") -- returns true if the current window was opened as a "clone" window.
- info("collapsible") -- checks to see if the current record is collapsible.
- info("countrycode") -- returns the country code for the current location.
- info("csvseparator") -- returns the current CSV field separator character (comma or semicolon).
- info("currencycode") -- returns the currency code for the current location.
- info("currencysymbol") -- returns the currency symbol for the current location.
- info("customfunctions") -- returns a list of all available custom functions.
- info("customstatements") -- returns a list of all available custom statements.
- info("databasefilename") -- returns the name of the current database.
- info("databasename") -- returns the name of the current database excluding any filename extension (if any).
- info("datasheetwindownumbers") -- returns the unique ID numbers of all open data sheet windows.
- info("datatype") -- returns the data type of the current field.
- info("decimalseparator") -- returns the current decimal separator character (period or comma).
- info("defaultdatepattern") -- returns the default date pattern used for displaying dates.
- info("defaultmaxdatasheetcolumns") -- default maximum number of allowed data sheet columns.
- info("defaultvoice") -- returns the current default system voice.
- info("desktopfolder") -- returns the path to the user's desktop folder.
- info("dialogsheet") -- returns true if the currently active window is a dialog sheet.
- info("dialogtrigger") -- returns the name of the last button pressed in an alert or dialog.
- info("disablebackgroundsearch") -- returns true if all background searches have been disabled.
- info("documentsfolder") -- returns the path to the current user's Documents folder.
- info("downloadsfolder") -- returns the path to the current user's Downloads folder.
- info("dropdatabase") -- returns the name of the database that contains the form data was dropped on.
- info("dropfiles") -- returns a list of files dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("dropform") -- returns the name of the form data was dropped on.
- info("dropobject") -- returns the name of the object that data was dropped on.
- info("droptext") -- returns text dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("droptypes") -- returns a list of all the data types dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("dropvcard") -- returns the text of any VCards dragged onto a *Drag Receiver* form object (see Drag and Drop).
- info("dropwindow") -- returns the name of the window that contains the form data was dropped on.
- info("dropwindownumber") -- returns the number of the window that contains the form data was dropped on.
- info("empty") -- returns true or false depending on the result of the last select operation. If no records were selected the function will return true, otherwise it will return false.
- info("eof") -- returns true if the active record is currently the last visible (selected) record.
- info("error") -- returns the most recent error message.
- info("errorparameter") -- returns the parameter that caused a runtime error.
- info("errorstack") -- returns the contents of the procedure stack after an error.
- info("errorstatement") -- returns the name of the statement that Panorama was trying to run at the time an error occurred.
- info("eventtype") -- returns the type of the last event (mouse click, keyboard press, etc.).
- info("executeerrorsource") -- can be used in Error Handling code when an error occurs in code running via the execute statement or its siblings.
- info("expandable") -- checks to see if the current record is expandable.
- info("expressionstacksize") -- returns the fake size of expression stack.
- info("fieldcount") -- returns the number of fields in the current database.
- info("fieldname") -- returns the name of the current field.
- info("fieldnumber") -- returns the number of the current field (starting from 1).
- info("fields") -- returns a carriage return delimited list of fields in the current database.
- info("files") -- returns a list of all open database files.
- info("filevariables") -- builds a carriage return separated text array containing a list of the currently allocated fileglobal variables in the current database.
- info("focusobject") -- returns the name of the currently active text editor or word processor object, if any.
- info("focusobjectid") -- returns the object ID of the currently active text editor or word processor object, if any.
- info("foldersepchar") -- returns the separator character used between folders.
- info("formevent") -- returns the last event that occurred to the current form.
- info("formname") -- returns the name of the current form.
- info("formwindownumbers") -- returns the unique ID numbers of all open form windows.
- info("found") -- returns true or false depending on whether the last *find* or *next* statement was successful.
- info("globalvariables") -- builds a carriage return separated text array containing a list of the currently allocated global variables.
- info("guid") -- returns a unique identifier string.
- info("hiddenfields") -- returns a carriage return delimited list of fields that are currently hidden in the current data sheet.
- info("horizontalscrollbar") -- returns true if the current window's horizontal scrollbar is enabled, false if it is disabled.
- info("keyboard") -- returns the last key that was pressed.
- info("keycode") -- returns a special numeric code that represents the last key that was pressed.
- info("labels") -- lists the labels in the current procedure.
- info("languagecode") -- returns the language code for the current location.
- info("libraryfolder") -- returns the path to the current user's Library folder.
- info("localvariables") -- builds a carriage return separated text array containing a list of the currently allocated local variables.
- info("loggedinaccountemail") -- returns the currently logged in account ID (email address).
- info("loggedinaccountrole") -- returns the currently logged in account role.
- info("magnification") -- returns the current magnification of the current form.
- info("matrixcell") -- returns the current cell number within a matrix object.
- info("matrixcelldata") -- returns the data associated with the current matrix object cell.
- info("matrixcellrecordid") -- returns the record id of the cell in a matrix that was clicked on.
- info("matrixcellselected") -- returns the selection status of the current matrix object cell.
- info("matrixclickedframeform") -- returns the form that contains the matrix frame, or `""` if the current form contains the frame.
- info("matrixclickedobjectid") -- returns the object id of the object in a matrix that was clicked on (or zero if none).
- info("matrixcolumn") -- returns the current column number within a matrix object.
- info("matrixdata") -- returns the data associated with the current matrix object.
- info("matrixname") -- returns the name of the matrix object being drawn, if any.
- info("matrixrow") -- returns the current row number within a matrix object.
- info("matrixseparator") -- function returns the separator associated with the current matrix.
- info("measurementsystem") -- returns the measurement system for the current location.
- info("menuidentifier") -- returns the identifier of the most recently chosen menu item (if any).
- info("milliseconds") -- returns the number of milliseconds (1/1000th second) since the system started up.
- info("modaldialogopen") -- returns true if a modal dialog window is currently open.
- info("modifiedfield") -- returns the name of the field that was just modified.
- info("mousedown") -- returns true or false depending on whether the mouse is currently down.
- info("moviesfolder") -- returns the path to the current user's Movies folder.
- info("musicfolder") -- returns the path to the current user's Music folder.
- info("noshow") -- returns true if noshow is currently turned on, false if it is not.
- info("notification") -- returns information about the just clicked notification.
- info("osversion") -- returns the operating system version and build number.
- info("pagecount") -- calculates the total number of pages that will be printed.
- info("pagenumber") -- returns the current report page number.
- info("pagesetuporientation") -- returns the printing page orientation for the current database.
- info("pagesetuppaperheight") -- returns the printing paper height for the current database.
- info("pagesetuppaperwidth") -- returns the printing paper width for the current database.
- info("pagesetupscale") -- returns the printing scale factor for the current database.
- info("panoramafolder") -- returns the location of the folder containing the currently running copy of Panorama.
- info("panoramaname") -- returns the name of the currently running copy of Panorama.
- info("panoramauptime") -- returns the number of seconds since Panorama launched.
- info("parameters") -- returns the number of parameters passed to a subroutine.
- info("picturesfolder") -- returns the path to the current user's Pictures folder.
- info("preferences") -- returns a list of all currently active preference settings.
- info("printsequence") -- returns the record sequence number of the record being printed.
- info("proceduredatabase") -- returns the name of the database that contains the currently running procedure.
- info("procedurename") -- returns the name of the currently running procedure.
- info("procedurestack") -- returns the contents of Panorama's procedure call stack.
- info("procedurewindownumbers") -- returns the unique ID numbers of all open procedure windows.
- info("publicfolder") -- returns the path to the current user's Public folder.
- info("quitinprogress") -- returns true if Panorama is in the process of quitting.
- info("ram") -- returns the amount of physical RAM in this computer.
- info("rawdatabasedata") -- returns the binary data of the current database.
- info("records") -- returns the total number of records in the current database.
- info("runningatomic") -- returns true if the current procedure is running as a "atomic" procedure.
- info("runninghandler") -- returns true if the current procedure is running as a "handler" procedure.
- info("screenrectangle") -- returns a rectangle defining the edges of the main screen.
- info("searchformula") -- returns the most recent search formula used in a *find* statement, if any.
- info("selected") -- returns the number of selected records in the current database.
- info("serverconnection") -- returns true if the currently active database is connected to the server.
- info("serverrecordid") -- returns the unique ID number for the current record.
- info("serverrecordts") -- returns the internal time stamp associated with the current record.
- info("serverupdate") -- returns true if the server update option is currently turned on (this is the default).
- info("speaking") -- returns true if talking is occuring right now.
- info("speechrate") -- returns the current Panorama speech rate (words per minute).
- info("speechvoice") -- returns the current default system voice.
- info("speechvolume") -- returns the current Panorama speech volume.
- info("stopped") -- returns true or false depending on the whether the last uprecord, downrecord, left or right statement succeeded or failed.
- info("summary") -- returns the summary level of the current record, from 0 (data record) to 7.
- info("taperecorder") -- returns information about the current procedure recording (if any).
- info("tempfolder") -- returns the path to the current user's temporary folder (for files you plan to use only for a short time).
- info("texteditortrigger") -- returns the reason why a Text Editor object triggered a procedure.
- info("thousandsseparator") -- returns the current thousands separator character (period or comma).
- info("tickcount") -- returns the number of ticks (1/60th second) since the system started up.
- info("timelimitremaining") -- returns the amount of time available (in seconds) before a loop will time out.
- info("toolbar") -- returns true if the current window's toolbar is visible, false if it is hidden.
- info("toolbarvisible") -- returns true if the current window has a visible tool bar.
- info("trigger") -- returns information about how the current procedure was triggered.
- info("typeofwindow") -- determines what type of view the current window contains.
- info("unixusername") -- returns the short user name of the logged in user.
- info("unsharedrecordid") -- returns the minimum ID for unshared records.
- info("uptime") -- returns the number of seconds since the computer was last booted.
- info("user") -- returns the name of the user of this computer.
- info("userfolder") -- returns the path to the current user's home folder.
- info("verticalscrollbar") -- returns true if the current window's vertical scrollbar is enabled, false if it is disabled.
- info("visible") -- returns true if the current record is visible and false if it is invisible.
- info("visiblefields") -- returns a carriage return delimited list of fields that are currently visible in the current data sheet.
- info("voices") -- returns a list of available speech synthesis voices on this system.
- info("volumes") -- returns a list of all of the currently mounted volumes (disks) on the computer.
- info("webbrowserlinklabel") -- returns the url of the link right clicked in a Web Browser object.
- info("webbrowserlinkurl") -- returns the url of the link right clicked in a Web Browser object.
- info("windowdepth") -- returns the color depth of the current window.
- info("windowname") -- returns the name of the current window.
- info("windownumber") -- returns the unique ID number of the current window.
- info("windownumbers") -- returns the unique ID numbers of all open windows.
- info("windowoptions") -- returns the names of any currently enabled window options,
- info("windowrectangle") -- returns a rectangle defining the edges of the current window. The rectangle is in screen relative coordinates.
- info("windows") -- builds a carriage return separated text array containing a list of all the currently open windows.
- info("windowtype") -- returns a numeric value based on what type of view the current window contains.
- info("windowvariables") -- returns a carriage return separated text array listing the windowglobal variables defined for the current window.
- info("windowview") -- determines what type of view the current window contains.
- join -- joins data from another database into the current database.
- joinonerecord -- joins matching data from another database into the current record.
- loadallprocedures -- loads all the procedures from a dictionary into the current database. If a procedure doesn't exist it will be created.
- localvalue( -- returns the value of a local variable.
- makenewform -- creates a new form in the current database.
- makenewprocedure -- creates a new procedure in the current database.
- Mark Menu -- allows you to set bookmarks in source code to help navigate to specific spots in a long program.
- newdatabase -- creates a new database.
- newformobject -- creates a new graphic object in a form.
- objectaction -- allows a procedure to communicate with an object on the current form.
- parameter( -- is used to transfer data between a main procedure and a subroutine.
- partialdatabaseupdate -- updates one or more components of an existing database.
- printonemultiple -- prints a form over and over again without advancing from record to record. Instead of advancing from record to record, a variable is incremented each time the form is printed. This statement is designed for printing calendars or thumbnails.
- printtopdf -- prints the current database to a PDF file.
- printusingform -- allows the current database to be printed using a different form than the one currently being displayed.
- procedureexists( -- checks to see whether a procedure exists or not.
- procedureinsertfieldname -- inserts a field name into a procedure, adding chevrons if necessary.
- procedureinsertformname -- inserts a form name into a procedure, adding quotes.
- procedureinsertprocedurename -- inserts a procedure name into a procedure, adding quotes if necessary.
- proceduresearch -- searches for text in a procedure.
- proceduresearchexact -- searches for text in a procedure.
- proceduresearchnext -- searches for text in a procedure, starting from the current location.
- proceduresearchnextexact -- searches for text in a procedure, starting from the current location.
- Program Menu -- assists with running and debugging code, and with developing custom dialogs.
- Programming -- basics of programming with Panorama X.
- recompile -- recompiles all procedures in a database.
- saveallprocedures -- saves all the procedures in the specified database into a dictionary.
- saveoneprocedure -- saves a specific procedure in the specified database into a dictionary.
- saveopenprocedures -- saves all the open procedures in the specified database into a dictionary.
- savepartialdatabase -- saves specified components of the current database, leaving other components out.
- scopes( -- returns the current scope of a variable, as well as any hidden scopes.
- scopevalue( -- returns the value of a variable in the specified scope.
- serverupdate -- temporarily disables record locking and server updates when using a shared database.
- setdatabaseoptions -- modifies one or more properties of a database.
- setformoptions -- modifies one or more properties of a form (name, viewing mode, etc.).
- setprocedureoptions -- modifies one or more properties of a procedure (source code, Action menu options, etc.).
- setproceduretext -- changes the text of the currently open procedure.
- setwindow -- specifies the dimensions (size and location) of the next window that is opened (with openform, opensheet, openprocedure etc.).
- Source Menu -- used to assist in editing program code.
- startbonjour -- starts monitoring the local network for available hosts.
- starttimer -- sets up and starts a repeating task that will be performed periodically when Panorama is not otherwise busy.
- stopbonjour -- cancels monitoring of the local network for available hosts.
- windowbox -- specifies the dimensions (size and location) of the next window that is opened (with openform, opensheet, openprocedure etc.).
- windowglobalvalue( -- accesses a windowglobal variable from other windows.

History

Version | Status | Notes
10.2 | Updated | Added the windowname and windownumber options.
10.0 | New | This function is new in this version.