Dear UNIVIE Team,
to add an AdoScript PROCEDURE in your implementation, you need to load the AdoScript that holds the procedure to make it locally or globally available. This can happen on a menu item or on an event (see the section on
AdoScript Triggers on the Documentation page for all possibilities).
To make a PROCEDURE implementation globally available, I would propose you add the PROCEDURE in the event "AppInitialized", loading the implementation during startup. The example below shows how to open an output windows during the initialization and provide a globale procedure to log information to that window.
1
2ON_EVENT "AppInitialized" {
3 # create the dockable window for the output stream
4 CC "AdoScript" CREATE_OUTPUT_WIN winid:"EVENTLOG" title:"Event Logging"
5
6 # load a global procedure as a helper implementation for timestamped logging
7 PROCEDURE global EVENT_LOG msgType:string message:string {
8 CC "Application" GET_DATE_TIME date-format:"dd/mm/yyyy" time-format:"hh:mm:ss"
9 SET currentDateTime: ((date) + " " + (time))
10 CC "AdoScript" OUT winid:"EVENTLOG" text: ("[" + (msgType) + "@" + currentDateTime + "]: " + (message) + "\n")
11 }
12}
13
14# Call the procedure anywhere in your AdoScript implementation
15# ...
16EVENT_LOG msgType:"EVENT_LOG" message: ("AppInitialized")