« Quay về University of Vienna - OMILAB

PROCEDURE without ITEM error

Xem kết hợp Flat Xem Xem cây
Luồng thảo luận [ Trước | Tiếp theo ]
toggle
PROCEDURE without ITEM error
Câu trả lời
13:48 22/09/2014
Hi,

I am trying to add a generic procedure to the External Coupling.
However if i add the AdoScript code, the platform throws the error "PROCEDURE without ITEM".
How is it possible to simply add procedures without coupling them to a menu item?

Thank you very much!

RE: PROCEDURE without ITEM error
Câu trả lời
05:29 23/09/2014 gửi bài phản hồi tới Cho phép người dùng chưa đăng ký.
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")

RE: PROCEDURE without ITEM error
Câu trả lời
06:12 23/09/2014 gửi bài phản hồi tới Wilfrid Utz.
Thank you.
I would have liked to add procedures without having to define them within an event or a menu item but your answer suggest that this is not possible (anymore)?