Scripting

Some GXs cannot be run from a script. These include those that call GUI elements such as the histogram tool, or the colour symbol tool. However, most GXs can be recorded and run successfully in a batch mode, provided that the suggested program flow outline is adhered to. In particular, the following points are important:

  • Keep interactive elements sequestered from the processing code by using the “if (iInteractive_SYS())” statement.
  • Keep non-scripting style functions (EDB,EMAP) sequestered from scriptable code by using the “if (iScripting_SYS())” statement.
  • Make use of the workspace parameter block to store required values. The SetInfoSYS_DGW and GetInfoSYS_DGW functions use the workspace parameter block, so when the GX is run once interactively, the required parameters are set. The parameters are retrieved using the GetString_SYS, GetReal_SYS and GetInt_SYS functions.
  • Ensure that the parameters are properly checked and verified as an aid in debugging and running the GX.