info(“trigger”)
info(“trigger”)

The info(“trigger”) function returns information about how the current procedure was triggered.

Description

The info(“trigger”) function returns information about how the current procedure was triggered. If the procedure was triggered by data entry this function will return the word Key followed by a period and then the key that actually triggered the procedure:

    Key.Return
    Key.Enter
    Key.Tab

If the procedure was triggered by a button, the function will return the word Button followed by a period and then the name of the button, for example:

    Button.Save
    Button.Calculate Tax
    Button.Show Chart

If the procedure was triggered by a custom menu, the function will return the word Menu followed by a period, the name of the menu, another period, and then the menu item. Here are some examples:

    Menu.Accounting.Aging
    Menu.Letter.New

The example below shows a .CustomMenu procedure written for two custom menus with two menu items apiece.

    if info("trigger") = "Menu.Organize.SortByName"
        field FirstName sortupwithin
    elseif info("trigger") = "Menu.Organize.SortByZip"
        field Zip sortup
    elseif info("trigger") = "Menu.Transaction.Add"
        addrecord
    elseif info("trigger") = "Menu.Transaction.Void"
        Description="Void"
        Amount=0
    endif

See Also

- Implicitly Triggered Procedures -- Procedures that are triggered automatically when the user performs some normal Panorama action are said to be "implicitly triggered."
- info("dialogtrigger") -- returns the name of the last button pressed in an alert or dialog.
- info("texteditortrigger") -- returns the reason why a Text Editor object triggered a procedure.
- setdialogtrigger -- changes the value returned by the info("dialogtrigger") function.
- settrigger -- changes the value returned by the info("trigger") function.

History

Version | Status | Notes
10.0 | No Change | Carried over from Panorama 6.0