Compiling and Running a Script
Compiling and Running a Script
|
|
Prior to version 22 a memory textbox was available to set the memory allocated for garbage collection in the JavaScript engine. This has been removed in version 22 as the memory is now automatically expanded as required. Please see the garbage collection section for more details.
Initially the , ... buttons will be greyed out. If you type a script location into the text box or select the location using the 'folder' button they will be enabled. Alternatively left clicking on a script in the tree will automatically run the script. Right clicking on the script will bring up a popup menu with the , ... options.
Knowing which scripts are running
When scripts are running in PRIMER, they are shown in the Running submenu.
Use the button to toggle between the list of scripts that are currently running, and the tree of available scripts.
To kill/terminate a running script, highlight the script(s) in the tree and press .
Alternatively, to kill all the scripts that are currently running use .
File encodings for scripts
Version 10.0 of PRIMER introduced the ability for unicode text to be used on widgets created in a script. Previous versions of PRIMER only supported English text so the default ASCII encoding was used for script files (this is still the default encoding for script files).
If you want to use unicode text in widgets then you must use a file encoding that is capable to representing the unicode 'characters' you require. The popup allows you to change the file encoding used when reading the script file. PRIMER supports the following file encodings:
| Encoding | Description |
| LATIN-1 | Default 'ASCII' encoding |
| BIG5 | Taiwan/Hong Kong (traditional) |
| EUC-CN | Extended unix code (Simplified Chinese) |
| EUC-JP | Extended unix code (Japanese) |
| EUC-KR | Extended unix code (Korean) |
| GB | Chinese (simplified) |
| GBK | Chinese |
| ISO-2022-CN | Chinese |
| ISO-2022-CN-EXT | Chinese (extended) |
| ISO-2022-JP | Japanese |
| ISO-2022-JP-2 | Japanese (extended) |
| ISO-2022-KR | Korean |
| JOHAB | Korean |
| SHIFT-JIS | Japanese |
| UTF-8 | Should NOT have a byte order mark (BOM). |
| UTF-16 | Should have a byte order mark (BOM). If not present assumes big endian |
| UTF-16LE | Little endian with or without byte order mark (BOM) |
| UTF-16BE | Big endian with or without byte order mark (BOM) |
| UTF-32 | Should have a byte order mark (BOM). If not present assumes big endian |
| UTF-32LE | Little endian with or without byte order mark (BOM) |
| UTF-32BE | Big endian with or without byte order mark (BOM) |
Please contact Oasys Ltd Support if you have problems or require another encoding to be supported.
To show the unicode text the appropriate font must be used. This can be set using the preferences primer*cjk_unix_font and primer*cjk_windows_font .