HLA predefines several different signed integer types including int8, int16, and int32, corresponding to 8-bit (1-byte) signed integers, 16-bit (2-byte) signed integers, and 32-bit (4-byte) signed integers, respectively.[3] Typical variable declarations occur in the HLA static variable section. A typical set of variable declarations takes the form shown in Figure 1-2.
In the static declaration section, you can also give a variable an initial value that the operating system will assign to the variable when it loads the program into memory. Figure 1-3 provides the syntax for this.
Example 1-2 provides a simple HLA program that demonstrates the use of variables within an HLA program.
In addition to static variable declarations, this example introduces three new concepts. First, the stdout.put
statement allows multiple parameters. If you specify an integer value, stdout.put
will convert that value to its string representation on output.
The second new feature introduced in Example 1-2 is the stdin.get
statement. This statement reads a value from the standard input device (usually the keyboard), converts the value to an integer, and stores the integer value into the NotInitialized
variable. Finally, Example 1-2 also introduces the syntax for (one form of) HLA comments. The HLA compiler ignores all text from the //
sequence to the end of the current line. (Those familiar with Java, C++, and Delphi should recognize these comments.)