« Πίσω στην CIDOC-CRM Project

Library attribute "External coupling" is limited to 32000 characters

Αποψη συνδυασμού Επίπεδη άποψη Αποψη δέντρων
toggle
Library attribute "External coupling" is limited to 32000 characters
community documentation development environment
Απάντηση
27/3/2014 11:29 πμ
The library attribute "External coupling" is limited to 32000 characters. How can I implement scripts that are longer than that?

RE: Library attribute "External coupling" is limited to 32000 characters
fread setg execute on_event file
Απάντηση
26/6/2013 12:18 μμ as a reply to Ανώνυμος.
If the functionality that your are implementing involves more than 32000, we recommend that you save the implementation for each event handler (ON_EVENT) and each menu item (ITEM) in text files and use the AdoScript commands to run those scripts.

Example:

1. copy the AdoScript code in the file "event_BeforeCreateRelationInstance.asc" and save the file in the folder "C:\example"

2. change the contents of the library attribute External coupling

 1ON_EVENT "BeforeCreateRelationInstance"
 2{
 3[color=#b0b0b0]#save event parameters in GLOBAL variables[/color]
 4SETG id_fromInstID: (frominstid)
 5SETG id_toInstID: (toinstid)
 6SETG id_relationClassID: (relationclassid)
 7SETG id_modelID: (componentid)
 8
 9CC "AdoScript" FREAD file: ("C:\\example\\event_BeforeCreatingRelationInstance.asc)
10[color=#b0b0b0] # --> RESULT ecode: intValue text: strValue[/color]
11EXECUTE (text)
12}

RE: Library attribute "External coupling" is limited to 32000 characters
file include external coupling
Απάντηση
26/6/2013 12:35 μμ as a reply to Ανώνυμος.
Another solution would involve storing the whole content of the library attribute "External Coupling" (event handlers and menu item definitions) in a file and using the INCLUDE keyword for referencing the content of this file in the library attribute "External coupling":

1. copy the contents of the library attribute "External coupling" in the file "ExternalCoupling.asc" and save the file in the folder "C:\example"

2. change the contents of the library attribute External coupling as follows:

1@INCLUDE "c:\\example\\ExternalCoupling.asc"