home *** CD-ROM | disk | FTP | other *** search
-
- >>> ASC - function to return the ascii code of an argument
-
- Example: PRINT "The ASCII code of A is" ASC "A"
-
- >>> ASCII - function to return the ascii code of an argument
-
- Same as ASC
-
- >>> BE - Placeholder for syntax. This command does nothing
-
- Placeholders are dummy commands that help make the syntax more
- natural. You can use this, as well as other placeholders anywhere
- in a statement and it will simply be ignored.
-
- Example: LET X BE 1
-
- >>> CALC - Calculates whatever expression follows.
-
- This command performs the same function as EVAL, CASE, and WHAT.
- BozoL will not automatically calculate arithmetic expressions in
- a statement. If you said
-
- PRINT 1+1
-
- BozoL will literally print "1+1". In order to evaluate an expression
- you must use CALC, EVAL, CASE or WHAT before the expression. These
- keywords can be intermixed and used multiple times in a statement.
- There is no difference between the four of them. Having a choice
- just makes the syntax easier to read and remember.
-
-
- Example: PRINT CALC 1+1 (would print 2)
-
- Example: IF EVAL A>B: GOSUB 10 (would jump to 10 if
- IF CASE A=B: GOSUB 10 the expression is true)
-
- Example: PRINT WHAT A+B IS (would print A+B. The
- keyword IS is also a
- placeholder and does
- nothing)
-
- >>> CASE - Calculates whatever expression follows.
-
- Same as CALC
-
- >>> CHR - Returns the character string of an ASCII code
-
- Example: PRINT CHR 7
-
- >>> CLS - Clears the screen
-
- Example: IF finished:CLS:END
-
- >>> COLOR - Sets the current color selection
-
- Just like BASIC.
-
- >>> CR - Returns a carriage return
-
- Example: PRINT "Hello" CR CR CR "Goodbye!"
-
- >>> END - Exits the BozoL interpreter.
-
- End exits the subroutine PROGRUN and terminates the program.
-
- >>> EQUAL - Placeholder for syntax. This command does nothing
-
- LET and SET are used to assign values to variables. They only
- need two arguments, the variable, and the value for it. Since
- LET A B would be unclear, you can use a placeholder, such as
- EQUAL to make the syntax a little more readable:
-
- Example: LET A EQUAL B
-
- >>> EQUALS - Tests two string values, returns true if they are the same
-
- This function does not make for a readable syntax. It is identical
- to the function SAME
-
- Example: QUIT IF EQUALS UCASE INKEY "X" (quit if X is in keyboard)
-
- Example: BE UNTIL NOT EQUALS INKEY "" (wait for a key to be pressed)
-
- >>> EVAL - Calculates whatever expression follows.
-
- Same as CALC
-
- >>> FALSE - Returns a logical false (0)
-
- Example: PRINT "Wheeeeeee" WHILE WHAT LEN INKEY = IS FALSE
-
- >>> GOSUB - Jumps to a subroutine which terminates with RETURN
-
- This works the same as BASIC's GOSUB statement. You can nest up
- to 32 GOSUBs. GOSUB must be followed by a line number or a label.
-
- Example: PRINT "Starting here"
- GOSUB Middle
- PRINT "Ending here!"
- END
- Middle:
- PRINT "This is the middle!" : RETURN
-
- >>> GOTO - Jumps to a line number or label.
-
- This works just like the BASIC GOTO statement. You must be aware
- that BozoL does not inherantly label line numbers, so unless you
- are sure that the line number is not going to change (by adding
- or deleting a line above it) you should use labels.
-
- Example: PRINT "Starting here."
- GOTO TheEnd
- PRINT "Never gets here!"
- TheEnd:
- PRINT "This is the end!"
-
- >>> IF - Test and expression and continue if true
-
- This is similar to the BASIC IF statement, however it has some
- strict limitations and differences. First, there is no THEN
- statement. Simply follow IF with an expression and then a colon.
- If the expression is true, the remainder of the line will be
- executed. There is also no ELSE keyword.
-
- Example: IF EVAL A=B: GOSUB 100
-
- A second use for IF is to place the IF expression at the very
- end of the line. If the expression is false, the preceeding
- statements not separated by colons will be aborted.
-
- Example: GOSUB 100 IF EVAL A=B
-
- >>> IN - Placeholder for syntax. This command does nothing
-
- Example: SAVE IN "TEST.PRG"
-
- >>> INKEY - Returns next character in keyboard buffer, if any
-
- INKEY does not pause. If one or more characters are waiting in
- the keyboard buffer INKEY will return that character. If no
- characters are waiting INKEY will return a null.
-
- Example: BE UNTIL LEN INKEY
-
- Remember that BE is just a placehoder. The expression
- UNTIL LEN INKEY would work just the same.
-
- >>> INPUT - Gets a line of input from the user into a variable
-
- You can follow INPUT by a valid sequence of items to print.
- The final parameter of INPUT must be a variable to contain the
- input line after it has been typed. Unlike BASIC, the INPUT
- expression may contain variables and functions.
-
- Example: INPUT "What is your name? ",NAME
-
- This would prompt the user (What is your name?) and then wait
- while the user responds. When the user presses ENTER, the
- response would be contained in the variable NAME. You can
- use placeholders or a space to delimit this line.
-
- Example: INPUT "What is your name? " TO NAME
-
- >>> IS - Placeholder for syntax. This command does nothing
-
- Example: GOTO 100 IF IS SAME A,B
-
- >>> LCASE - Returns the lower case of an argument
-
- Example: IF SAME LCASE INKEY,"y": END
-
-
-
- >>> LEFT - Returns specified number of characters from left of string
-
- Example: PRINT LEFT "Erik",3
-
- This would print "Eri" on the screen. Not that a comma is also
- just a placeholder and can be substituted with a space or a
- semicolon.
-
- >>> LEN - Returns the length of a string expression
-
- Example: BE UNTIL LEN INKEY
-
- This statement would loop until the length of INKEY was no longer
- zero.
-
- >>> LET - Assigns a value to a variable (same as SET)
-
- Example: LET A EQUAL B
-
- Note that you cannot use the equals sign (=) to assign a value
- to a variable. The equals sign is only used in arithmetic
- expressions to test whether one number is equal to another.
-
- example: LET A BE EQUAL TO B
-
- LET only requires two parameters, a varable and a value. You
- can use placeholders, a comma, or just a space to separate them.
- The above example is identical to LET A,B
-
- >>> LIST - lists the program currently in memory to the screen
-
- LIST by itself will type the whole program to the screen. LIST
- followed by a line number will display that line. List followed
- by two line numbers will display all of the numbers in between.
-
- Example: LIST 1 TO 100
-
- Note the placeholder TO. You could also just say LIST 1 100 or
- LIST 1,100 and it would work the same.
-
- >>> LOAD - Reads a program file from disk into memory.
-
- Example: LOAD "TEST.PRG"
-
- >>> LOCATE - Positions the cursor on the screen.
-
- Example: LOCATE 10,10 : PRINT "Hi there!"
-
- >>> LOWER - Returns the lower case of a string expression
-
- Same as LCASE
-
- >>> LTRIM - Trims leading spaces from a string expression.
-
- Example: PRINT LTRIM RTRIM " Hello! "
-
- >>> MID - Returns a middle portion of a string expression
-
- Example: PRINT MID "testing",2,4
-
- This example would print "stin" on the screen. The syntax for
- MID is the same as BASIC's MID$ function. If the third
- parameter is ommitted, MID will return the remainder of the
- string.
-
- Example: PRINT MID "testing",2
-
- Would print "esting" on the screen.
-
- >>> NOT - Returns a logical NOT value of an argument.
-
- Example: PRINT NOT TRUE
-
- This would print 0 (opposite of TRUE, which is -1) on the screen.
-
- Example: IF NOT SAME A,B: PRINT "They don't match!"
-
- >>> PRINT - Prints an expression on the screen
-
- Print can be followed by any number of arguments separated by
- spaces, commas, or placeholders.
-
- Example: PRINT "This" "is" "a" "test"
-
- would print "Thisisatest" on the screen. PRINT always outputs
- a carriage return at the end of the print line. To print without
- a carriage return, use PROMPT.
-
- >>> PROMPT - Prints to the screen without a carriage return
-
- PROMPT works the same as print except the cursor is not advanced
- to the next line after the line to be printed has been output.
-
- Example: PROMPT "Please enter your name:"
-
- >>> QUIT - Exits the BozoL interpreter
-
- Same as END
-
- >>> RETURN - Exits a subroutine entered with GOSUB
-
- Up to 32 GOSUB-RETURN pairs can be nested in BozoL. RETURN jumps
- to the line immediately following the most recent GOSUB.
-
- >>> RIGHT - Returns a number of characters from the right of a string.
-
- Example: PRINT RIGHT "Erik",2
-
- This would print "ik" in the screen.
-
- >>> RTRIM - Removes trailing spaces from a string.
-
- See LTRIM
-
- >>> RUN - Executes an interpreted program
-
- RUN by itself will execute the program currently in memory from
- the beginning. If RUN is followed by the name of a BozoL program
- file, the file will be loaded and then run.
-
- >>> SAME - Returns true if two string expressions match.
-
- Same as EQUALS
-
- >>> SAVE - Writes the current program in memory to disk.
-
- SAVE must be followed by a file name.
-
- Example: SAVE "test.prg"
-
- >>> SET - Assigns a value to a variable (same as LET)
-
- Example: SET Name TO "Erik Olson"
-
- See the entry for LET
-
- >>> SUBSTR - Returns the middle portion of a string expression
-
- Same as MID
-
- >>> TAB - Returns a TAB character.
-
- Using TAB in an expression would be just like using CHR 9.
-
- Example: PRINT "Hello" TAB "World"
-
- Would print "Hello World" on the screen.
-
- >>> TO - Placeholder for syntax. This command does nothing
-
- Use TO wherever you like to make the syntax of BozoL more readable.
-
- Example: SET A TO 1
-
- >>> TRUE - Returns a logical TRUE (-1)
-
- Example: SET A TO TRUE
-
- >>> UCASE - Returns the upper case of a string expression
-
- Example: TO BE UNTIL IS SAME UPPER INKEY "X"
-
- This would wait until the user presses "x" or "X"
-
- >>> UNTIL - Continues to iterate until an expression is true.
-
- Place UNTIL at the beginning of a line with multiple statements
- separated by colons (:) or at the end of a set of statements that
- are not separated by colons. The entire line will continue to
- iterate until the expression which follows UNTIL evalutes true.
-
- Example: UNTIL CALC A=10: SET A TO CALC A+1: PRINT A
-
- This would print the numbers 1 through 10 on the screen. Using
- the "no-colon" syntax, this expression would look like this:
-
- PRINT A SET A TO CALC A+1 UNTIL CALC A=10
-
- >>> UPPER - Returns the upper case of a string expression
-
- Same as UCASE
-
- >>> WHAT - Same as CALC, EVAL, and CASE
-
- >>> WHILE - Continues to iterate while an expression is true.
-
- This is very similar to UNTIL, except it iterates until the
- expression evaluates to false.
-
- Place WHILE at the beginning of a line with multiple statements
- separated by colons (:) or at the end of a set of statements that
- are not separated by colons. The entire line will continue to
- iterate while the expression which follows WHILE evalutes true.
-
- Example: WHILE CALC A<10: SET A TO CALC A+1: PRINT A
-
- This would print the numbers 1 through 9 on the screen. Using
- the "no-colon" syntax, this expression would look like this:
-
- PRINT A SET A TO CALC A+1 WHILE CALC A<10
-
- >>> WITH - Placeholder for syntax. This command does nothing
-
- Example: REPLACE "BozoL" WITH "My Language" IN "BOZOL.DOC"
-
- REPLACE is not a command in BozoL, but if you wanted to make it
- one all you would have to do is add it to the language. In this
- example we have a command called REPLACE which is used to perform
- a search and replace in a file on disk. The use of WITH and IN
- is arbitrary but makes the syntax of this statement much more
- memorable.
-
-
-