TBASIC Statements, Functions and Delimiter - Definitions
1. STATEMENT
A STATEMENT is a group of keywords used by TBASIC to perform certain action. A statement may take 0,1,2 or more arguments. The following are some TBASIC statements: PRINT, LET, IF, WHILE, SETLED ...etc.
2. FUNCTION
A FUNCTION acts on its supplied arguments and return a value. The returned value may be an integer or a string. A function can usually be embedded within an expression as if it is a variable or a constant, since its content will be evaluated before being used in the expression. e.g.
A$ = "Total is $"+STR$(B+C)
3. DELIMITERSTR$(n) is a function which returns a string and therefore can be used directly in the above string assignment statement.
The most distinguishable feature of a FUNCTION is that its arguments are enclosed within parenthesis "(" and ")". e.g. ABS(n), ADC(n), MID$(A$,n,m), STRCMP(A$,B$).
Note: Statements or functions and their arguments are NOT case-sensitive. This means that commands such as PRINT and PriNt are identical. However, for clarity seek we use a mix of upper and lower case characters in this manual.
A TBASIC program consists of many statements. Each statements are usually separated by a different line. The new line therefore acts as a "delimiter" which separate one statement from another. Some statements such as IF..THEN..ELSE..ENDIF span multiple statements and should be separated by proper delimiters.
To make a program visually more compact, the colon symbol ":" may be used to act as delimiter. e.g.
IF A > B THEN
C = D*5
ELSE
C = D/5
ENDIFmay be written more compactly as
IF A >B : C=D*5:ELSE:C=D/5:ENDIF