User Tools

Site Tools


add_incomingvalue_last_lineofscript

This is an old revision of the document!


incomingValue; must be added to the end of all scripts

Why?

To avoid a script running multiple times when there is an error in the script (especially at runtime) the script will not complete execution unless there is an incomingValue; (or any other output, such as a calculated value) as the very last line of a script.

For example if you do this:

if (incomingValue.getQuality()==0) {
  //do something here
} else {
  //do nothing
}

There is no final value calculated so this script will execute exactly one time after the application starts up

If you do this:

if (incomingValue.getQuality()==0) {
  //do something here
} else {
  //do nothing
}
incomingValue;

this script will execute every time a new value is received by the script which is likely what you intend to happen.

This is a change which was implemented in early 2024 so if you have old projects without this final “incomingValue;” you can add this last line in the script manually to every script, or you can use the steps below (please make a copy of your project before doing this in case there is a corruption of the file after the process).

Expert Only, Be careful when manually editing project files. Backup your work!

How to add incomingValue; to every script in a .tsx (TransSECS project file)

  1. Ordered List Item

1. make a copy of your project tsx as a backup 2. make sure the project is not loaded in TransSECS and make sure TransSECS is not running (exit TransSECS) 3. On Windows use Notepad++ to load the project tsx. You can change the file type to xml if you like, but this is not necessary

add_incomingvalue_last_lineofscript.1747755506.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki