Skip to main content

Syntax

So far, you've learned about four commands: Write, Read, Set, and Do. It's time to learn about command syntax in general. The syntax of a command is: command (or its abbreviation), followed by a single space, followed by one or more arguments separated by commas. There can be spaces anywhere within the arguments.

You can also place more than one command on a line. There must be at least one space between the last argument of one command and the next command. Certain commands, which you'll learn about later, don't have arguments. If you want to place another command after an argumentless command, it must be followed by at least two spaces.

This example uses three commands, each with multiple arguments. It also uses the $Zdateh and $Zdate functions and the $Horolog system variable, which can be abbreviated as “$h” and which we'll cover later.

SAMPLES>read !, "DOB: ", dob  set days = $h - $zdateh(dob), today = $zdate(+$h)

DOB: 7/7/1921
SAMPLES>write !, "On ", today, ", you are ", days, " days old."

On 12/27/2001, you are 29393 days old.
SAMPLES>

FeedbackOpens in a new tab