var
postalcode : string(6) says that postalcode is a string variable that is 6 characters longvar i : int :=1 says that i is an integer variable and is initially set to equal 1
Input Statements: (from keyboard)
get variablename get information from the keyboard
and store it in location variablename
get variablename : * means get a whole line of input
getkey waits until any key is pressed
include "u-string.t" (you can include code/subroutines that you use frequently - to change case, for example).
Output Statements: (to screen)
put "text" prints the text inside
the quotes on the screen
put name, " lives at ", address
prints the variables name and address with the text "lives at"
in between them
put "Enter number: " ..
prints the text, then leaves the cursor after the text, so that the next
characters appear there
locate (row, col) positions the cursor to the row and column specified
cls clears the screen
Assignment Operators:
variablename := expression
:= is used to assign the results of some expression to the
variable on the left.
(e.g. days := years * 365 )
counter += 1 adds one to the variable called counter.
j - = 5
This is identical to counter := counter + 1
loop
This loop will loop continuously until it executes an "exit"
statement (if ever)
statements if xxxx then exit end if
statements
end loop
String Functions:
Concatenation: use a '+' sign
name:= surname + ", " + firstname
would set name equal to something like
Harwood, Michael
length(stringvar) returns the length of the string
tolower(stringvar) returns the lowercase version of the string (include "u-string.t")
toupper(stringvar) returns the uppercase version of the string (include "u-string.t")
index(stringvar,patt) returns the starting location of the pattern in the string.