4.28 FAQ-387 Is there a limit for LabTalk script length inside the brackets {} of an if, for, or loop statement?

Last Update: 9/21/2016

There is a limit to the length of script that can be included between a set of braces {}. The scripts between the {} are translated internally and the translated scripts must be less than 1140 bytes (after substitution).

This size limit applies to any script placed between brackets {} and to any highlighted block of script in the Script Window. When writing script, remember to always keep your code in manageable blocks. A good way to handle this size limitation is to use the run object, which can execute script in a particular section of a file.


Example:

If you have created a text file containing a section called [insidefor] and want to run the script of this section. Then, save the text file as MyFile.ogs in your Origin folder. The run.section command object will direct Origin to run the script located in the [insidefor] section of MyFile.ogs. The for command will allow the script to be run multiple times.

for(i=1;i<4;i+=1) { 
run.section(MyFile,insidefor); 
}



Keywords:script length, bracket