Altova StyleVision 2023 Professional Edition

The "Global Declarations" script is present by default in any scripting project; you do not need to create it explicitly. Any variables or functions that you add to this script are considered global across the entire project. Consequently, you can refer to such variables and functions from any of the project's macros and events. The following is an example of a global declarations script that imports the System.Windows.Forms namespace into the project. To achieve that, the code below invokes the CLR.Import command built into Scripting Editor.

 

// import System.Windows.Forms namespace for all macros, forms and events:
CLR.Import( "System.Windows.Forms" );

 

Note:Every time a macro is executed or an event handler is called, the global declarations are re-initialized.

© 2017-2023 Altova GmbH