Script Window and the (newer) Command Window. Each window can execute single or multiple lines of script.
Two Windows exist for direct execution of LabTalk: the (older)![]() | Origin 2023 added a Scintilla-based Script Window with support for Unicode, auto-completion, syntax-coloring, font-size control (zoom using Ctrl + mouse). The change should improve usability, particularly for those with 4k monitors. Roll back to the original Script Window by setting @NSW=0. |
Below is an example script that expects a worksheet with data in the form of one X column and multiple Y columns. The code finds the highest and lowest Y values from all the Y data, then normalizes all the Y's to that range.
// Find the lowest minimum and the highest maximun double absMin = 1E300; double absMax = -1E300; loop(ii,2,wks.ncols) { stats $(ii); if(absMin > stats.min) absMin = stats.min; if(absMax < stats.max) absMax = stats.max; } // Now normalize each column to that range loop(ii,2,wks.ncols) { stats $(ii); wcol(ii)-=stats.min; // Shift to minimum of zero wcol(ii)/=(stats.max - stats.min); // Normalize to 1 wcol(ii)*=(absMax - absMin); // Normalize to range wcol(ii)+=absMin; // Shift to minimum }
To execute in the Script Window, paste the code, then select all the code with the cursor (selected text will be highlighted), and press Enter.
To execute the script in the Command Window, paste the code then press Enter. Note that if there were a mistake in the code, you would have it all available for editing in the Script Window, whereas the Command Window history is not editable and the line history does not recall the entire script.
![]() | The font in Script Window can be customized in this way:
ScriptWindowFontHeight=24 ScriptWindowCharset=0 ScriptWindowFaceName=Times New Roman For more charset value, see http://msdn.microsoft.com/en-us/library/cc250412.aspx |