Programming Syntax

A LabTalk script is a single block of code that is received by the LabTalk interpreter. A LabTalk script is composed of one or more complete programming statements, each of which performs an action.

Each statement in a script should end with a semicolon, which separates it from other statements. However, single statements typed into the Script window for execution should not end with a semicolon.

Each statement in a script is composed of words. Words are any group of text separated by white space. Text enclosed in parentheses is treated as a single word, regardless of white space. For example:

type "Hello World";                  // Single LabTalk statement

ty s1; ty s2; ty s3;                      // Three statements

Parentheses are used to create long words containing white space. For example, in the script:

menu 3 (Long Menu Name);

the open parenthesis signifies the beginning of a single word, and the close parenthesis signifies the end of the word.

This section covers the following topics: