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 title 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
Note: If a procedure changes the state of one or more graphic objects (for example a Tab Panel, Text List or Matrix), the value of the info(“trigger”) function will change to reflect that object. If you want to continue to use the original trigger value you’ll need to save that value in a variable before running any code that changes the state of any graphic object. Here’s an example of how this could be done:
let mytrigger = info("trigger")
...
...
...
if mytrigger = "Button.Do It"
...
...
...
elseif mytrigger = "Button.Do The Other Thing"
...
...
...
endif
See Also
History
Version | Status | Notes |
10.0 | No Change | Carried over from Panorama 6.0 |