Statements are keywords that specify an action to be performed, followed by language elements appropriate to the statement. In general, it is preferable to implement programming language capabilities with functions rather than statements. But statements have two advantages that are sometimes very important.
Since they do not involve function call overhead, statements execute quicker. Where the action performed is limited, the speed advantage of statements is significant. Decisions and execution control, like IF , DO , FOR , and SELECT CASE, execute much faster than functions.
Since statements are not constrained by function syntax, each statement can define its own syntax to make the action performed as clear and readable as possible. The flexibility and readability of the FOR statement is a good example.
Multiple statements on the same line are separated by : characters, as in INC x : INC y : INC z .
Certain statements may be preceded on lines only by whitespace. In general, these are statements that declare, define, begin, or end block structures. They include the following:
|DECLARE FUNCTION||declare a module-shared function|
|INTERNAL FUNCTION||declare a private function|
|EXTERNAL FUNCTION||declare an external function|
|FUNCTION||begin a function block|
|END FUNCTION||end a function block|
|EXTERNAL||declare external variables|
|SHARED||declare shared variables|
|STATIC||declare static variables|
|AUTOX||declare autox variables|
|AUTO||declare auto variables|
|DO||begin a DO loop|
|LOOP||end a DO loop|
|FOR||begin a FOR loop|
|NEXT||end a FOR loop|
|SELECT CASE||begin a SELECT CASE block|
|CASE||check another CASE|
|END SELECT||end a SELECT CASE block|
|SUB||begin a subroutine|
|END SUB||end a subroutine|
|TYPE||begin a type definition|
|UNION||begin a union definition|
|END TYPE||end a TYPE definition|
|END UNION||end a UNION definition|
Intrinsics, short for intrinsic functions, are often-called functions like ABS(), INT(), LEFT$() that are built into the language and thus always callable without declaration or importing a function library.
Intrinsics take one or more arguments which are not changed, and return a value. The names of intrinsics are fully capitalized keyword symbols. Intrinsics execute quickly, and some handle variable number of arguments. The intrinsics are described in detail in the reference manual.