home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Samples / BOZOL2 / BOZOL2.ZIP / BOZOL.REF < prev    next >
Encoding:
Text File  |  1994-02-08  |  13.3 KB  |  388 lines

  1.  
  2. >>>     ASC      - function to return the ascii code of an argument
  3.  
  4.         Example: PRINT "The ASCII code of A is" ASC "A"
  5.  
  6. >>>     ASCII    - function to return the ascii code of an argument
  7.  
  8.         Same as ASC
  9.  
  10. >>>     BE       - Placeholder for syntax.  This command does nothing
  11.  
  12.         Placeholders are dummy commands that help make the syntax more
  13.         natural.  You can use this, as well as other placeholders anywhere
  14.         in a statement and it will simply be ignored.
  15.  
  16.         Example: LET X BE 1
  17.  
  18. >>>     CALC     - Calculates whatever expression follows.
  19.  
  20.         This command performs the same function as EVAL, CASE, and WHAT.
  21.         BozoL will not automatically calculate arithmetic expressions in
  22.         a statement.  If you said
  23.  
  24.                 PRINT 1+1
  25.  
  26.         BozoL will literally print "1+1".  In order to evaluate an expression
  27.         you must use CALC, EVAL, CASE or WHAT before the expression.  These
  28.         keywords can be intermixed and used multiple times in a statement.
  29.         There is no difference between the four of them.  Having a choice
  30.         just makes the syntax easier to read and remember.
  31.  
  32.  
  33.         Example: PRINT CALC 1+1                    (would print 2)
  34.  
  35.         Example: IF EVAL A>B: GOSUB 10             (would jump to 10 if
  36.                  IF CASE A=B: GOSUB 10             the expression is true)
  37.  
  38.         Example: PRINT WHAT A+B IS                 (would print A+B.  The
  39.                                                    keyword IS is also a
  40.                                                    placeholder and does
  41.                                                    nothing)
  42.  
  43. >>>     CASE     - Calculates whatever expression follows.
  44.  
  45.         Same as CALC
  46.  
  47. >>>     CHR      - Returns the character string of an ASCII code
  48.  
  49.         Example: PRINT CHR 7
  50.  
  51. >>>     CLS      - Clears the screen
  52.  
  53.         Example: IF finished:CLS:END
  54.  
  55. >>>     COLOR    - Sets the current color selection
  56.  
  57.         Just like BASIC.
  58.  
  59. >>>     CR       - Returns a carriage return
  60.  
  61.         Example: PRINT "Hello" CR CR CR "Goodbye!"
  62.  
  63. >>>     END      - Exits the BozoL interpreter.
  64.  
  65.         End exits the subroutine PROGRUN and terminates the program.
  66.  
  67. >>>     EQUAL    - Placeholder for syntax.  This command does nothing
  68.  
  69.         LET and SET are used to assign values to variables.  They only
  70.         need two arguments, the variable, and the value for it.  Since
  71.         LET A B would be unclear, you can use a placeholder, such as
  72.         EQUAL to make the syntax a little more readable:
  73.  
  74.         Example: LET A EQUAL B
  75.  
  76. >>>     EQUALS   - Tests two string values, returns true if they are the same
  77.  
  78.         This function does not make for a readable syntax.  It is identical
  79.         to the function SAME
  80.  
  81.         Example: QUIT IF EQUALS UCASE INKEY "X"  (quit if X is in keyboard)
  82.  
  83.         Example: BE UNTIL NOT EQUALS INKEY ""    (wait for a key to be pressed)
  84.  
  85. >>>     EVAL     - Calculates whatever expression follows.
  86.  
  87.         Same as CALC
  88.  
  89. >>>     FALSE    - Returns a logical false (0)
  90.  
  91.         Example: PRINT "Wheeeeeee" WHILE WHAT LEN INKEY = IS FALSE
  92.  
  93. >>>     GOSUB    - Jumps to a subroutine which terminates with RETURN
  94.  
  95.         This works the same as BASIC's GOSUB statement.  You can nest up
  96.         to 32 GOSUBs.  GOSUB must be followed by a line number or a label.
  97.  
  98.         Example: PRINT "Starting here"
  99.                  GOSUB Middle
  100.                  PRINT "Ending here!"
  101.                  END
  102.                  Middle:
  103.                  PRINT "This is the middle!" : RETURN
  104.  
  105. >>>     GOTO     - Jumps to a line number or label.
  106.  
  107.         This works just like the BASIC GOTO statement.  You must be aware
  108.         that BozoL does not inherantly label line numbers, so unless you
  109.         are sure that the line number is not going to change (by adding
  110.         or deleting a line above it) you should use labels.
  111.  
  112.         Example: PRINT "Starting here."
  113.                  GOTO TheEnd
  114.                  PRINT "Never gets here!"
  115.                  TheEnd:
  116.                  PRINT "This is the end!"
  117.  
  118. >>>     IF       - Test and expression and continue if true
  119.  
  120.         This is similar to the BASIC IF statement, however it has some
  121.         strict limitations and differences.  First, there is no THEN
  122.         statement.  Simply follow IF with an expression and then a colon.
  123.         If the expression is true, the remainder of the line will be
  124.         executed.  There is also no ELSE keyword.
  125.  
  126.         Example: IF EVAL A=B: GOSUB 100
  127.  
  128.         A second use for IF is to place the IF expression at the very
  129.         end of the line.  If the expression is false, the preceeding
  130.         statements not separated by colons will be aborted.
  131.  
  132.         Example: GOSUB 100 IF EVAL A=B
  133.  
  134. >>>     IN       - Placeholder for syntax.  This command does nothing
  135.  
  136.         Example: SAVE IN "TEST.PRG"
  137.  
  138. >>>     INKEY    - Returns next character in keyboard buffer, if any
  139.  
  140.         INKEY does not pause.  If one or more characters are waiting in
  141.         the keyboard buffer INKEY will return that character.  If no
  142.         characters are waiting INKEY will return a null.
  143.  
  144.         Example: BE UNTIL LEN INKEY
  145.  
  146.         Remember that BE is just a placehoder.  The expression
  147.         UNTIL LEN INKEY would work just the same.
  148.  
  149. >>>     INPUT    - Gets a line of input from the user into a variable
  150.  
  151.         You can follow INPUT by a valid sequence of items to print.
  152.         The final parameter of INPUT must be a variable to contain the
  153.         input line after it has been typed.  Unlike BASIC, the INPUT
  154.         expression may contain variables and functions.
  155.  
  156.         Example: INPUT "What is your name? ",NAME
  157.  
  158.         This would prompt the user (What is your name?) and then wait
  159.         while the user responds.  When the user presses ENTER, the
  160.         response would be contained in the variable NAME.  You can
  161.         use placeholders or a space to delimit this line.
  162.  
  163.         Example: INPUT "What is your name? " TO NAME
  164.  
  165. >>>     IS       - Placeholder for syntax.  This command does nothing
  166.  
  167.         Example: GOTO 100 IF IS SAME A,B
  168.  
  169. >>>     LCASE    - Returns the lower case of an argument
  170.  
  171.         Example: IF SAME LCASE INKEY,"y": END
  172.  
  173.  
  174.  
  175. >>>     LEFT     - Returns specified number of characters from left of string
  176.  
  177.         Example: PRINT LEFT "Erik",3
  178.  
  179.         This would print "Eri" on the screen.  Not that a comma is also
  180.         just a placeholder and can be substituted with a space or a
  181.         semicolon.
  182.  
  183. >>>     LEN      - Returns the length of a string expression
  184.  
  185.         Example: BE UNTIL LEN INKEY
  186.  
  187.         This statement would loop until the length of INKEY was no longer
  188.         zero.
  189.  
  190. >>>     LET      - Assigns a value to a variable (same as SET)
  191.  
  192.         Example: LET A EQUAL B
  193.  
  194.         Note that you cannot use the equals sign (=) to assign a value
  195.         to a variable.  The equals sign is only used in arithmetic
  196.         expressions to test whether one number is equal to another.
  197.  
  198.         example: LET A BE EQUAL TO B
  199.  
  200.         LET only requires two parameters, a varable and a value.  You
  201.         can use placeholders, a comma, or just a space to separate them.
  202.         The above example is identical to LET A,B
  203.  
  204. >>>     LIST     - lists the program currently in memory to the screen
  205.  
  206.         LIST by itself will type the whole program to the screen.  LIST
  207.         followed by a line number will display that line.  List followed
  208.         by two line numbers will display all of the numbers in between.
  209.  
  210.         Example: LIST 1 TO 100
  211.  
  212.         Note the placeholder TO.  You could also just say LIST 1 100 or
  213.         LIST 1,100 and it would work the same.
  214.  
  215. >>>     LOAD     - Reads a program file from disk into memory.
  216.  
  217.         Example: LOAD "TEST.PRG"
  218.  
  219. >>>     LOCATE   - Positions the cursor on the screen.
  220.  
  221.         Example: LOCATE 10,10 : PRINT "Hi there!"
  222.  
  223. >>>     LOWER    - Returns the lower case of a string expression
  224.  
  225.         Same as LCASE
  226.  
  227. >>>     LTRIM    - Trims leading spaces from a string expression.
  228.  
  229.         Example: PRINT LTRIM RTRIM "  Hello!  "
  230.  
  231. >>>     MID      - Returns a middle portion of a string expression
  232.  
  233.         Example: PRINT MID "testing",2,4
  234.  
  235.         This example would print "stin" on the screen.  The syntax for
  236.         MID is the same as BASIC's MID$ function.  If the third
  237.         parameter is ommitted, MID will return the remainder of the
  238.         string.
  239.  
  240.         Example: PRINT MID "testing",2
  241.  
  242.         Would print "esting" on the screen.
  243.  
  244. >>>     NOT      - Returns a logical NOT value of an argument.
  245.  
  246.         Example: PRINT NOT TRUE
  247.  
  248.         This would print 0 (opposite of TRUE, which is -1) on the screen.
  249.  
  250.         Example: IF NOT SAME A,B: PRINT "They don't match!"
  251.  
  252. >>>     PRINT    - Prints an expression on the screen
  253.  
  254.         Print can be followed by any number of arguments separated by
  255.         spaces, commas, or placeholders.
  256.  
  257.         Example: PRINT "This" "is" "a" "test"
  258.  
  259.         would print "Thisisatest" on the screen.  PRINT always outputs
  260.         a carriage return at the end of the print line.  To print without
  261.         a carriage return, use PROMPT.
  262.  
  263. >>>     PROMPT   - Prints to the screen without a carriage return
  264.  
  265.         PROMPT works the same as print except the cursor is not advanced
  266.         to the next line after the line to be printed has been output.
  267.  
  268.         Example: PROMPT "Please enter your name:"
  269.  
  270. >>>     QUIT     - Exits the BozoL interpreter
  271.  
  272.         Same as END
  273.  
  274. >>>     RETURN   - Exits a subroutine entered with GOSUB
  275.  
  276.         Up to 32 GOSUB-RETURN pairs can be nested in BozoL.  RETURN jumps
  277.         to the line immediately following the most recent GOSUB.
  278.  
  279. >>>     RIGHT    - Returns a number of characters from the right of a string.
  280.  
  281.         Example: PRINT RIGHT "Erik",2
  282.  
  283.         This would print "ik" in the screen.
  284.  
  285. >>>     RTRIM    - Removes trailing spaces from a string.
  286.  
  287.         See LTRIM
  288.  
  289. >>>     RUN      - Executes an interpreted program
  290.  
  291.         RUN by itself will execute the program currently in memory from
  292.         the beginning.  If RUN is followed by the name of a BozoL program
  293.         file, the file will be loaded and then run.
  294.  
  295. >>>     SAME     - Returns true if two string expressions match.
  296.  
  297.         Same as EQUALS
  298.  
  299. >>>     SAVE     - Writes the current program in memory to disk.
  300.  
  301.         SAVE must be followed by a file name.
  302.  
  303.         Example: SAVE "test.prg"
  304.  
  305. >>>     SET      - Assigns a value to a variable (same as LET)
  306.  
  307.         Example: SET Name TO "Erik Olson"
  308.  
  309.         See the entry for LET
  310.  
  311. >>>     SUBSTR   - Returns the middle portion of a string expression
  312.  
  313.         Same as MID
  314.  
  315. >>>     TAB      - Returns a TAB character.
  316.  
  317.         Using TAB in an expression would be just like using CHR 9.
  318.  
  319.         Example: PRINT "Hello" TAB "World"
  320.  
  321.         Would print "Hello   World" on the screen.
  322.  
  323. >>>     TO       - Placeholder for syntax.  This command does nothing
  324.  
  325.         Use TO wherever you like to make the syntax of BozoL more readable.
  326.  
  327.         Example: SET A TO 1
  328.  
  329. >>>     TRUE     - Returns a logical TRUE (-1)
  330.  
  331.         Example: SET A TO TRUE
  332.  
  333. >>>     UCASE    - Returns the upper case of a string expression
  334.  
  335.         Example: TO BE UNTIL IS SAME UPPER INKEY "X"
  336.  
  337.         This would wait until the user presses "x" or "X"
  338.  
  339. >>>     UNTIL    - Continues to iterate until an expression is true.
  340.  
  341.         Place UNTIL at the beginning of a line with multiple statements
  342.         separated by colons (:) or at the end of a set of statements that
  343.         are not separated by colons.  The entire line will continue to
  344.         iterate until the expression which follows UNTIL evalutes true.
  345.  
  346.         Example: UNTIL CALC A=10: SET A TO CALC A+1: PRINT A
  347.  
  348.         This would print the numbers 1 through 10 on the screen.  Using
  349.         the "no-colon" syntax, this expression would look like this:
  350.  
  351.         PRINT A SET A TO CALC A+1 UNTIL CALC A=10
  352.  
  353. >>>     UPPER    - Returns the upper case of a string expression
  354.  
  355.         Same as UCASE
  356.  
  357. >>>     WHAT     - Same as CALC, EVAL, and CASE
  358.  
  359. >>>     WHILE    - Continues to iterate while an expression is true.
  360.  
  361.         This is very similar to UNTIL, except it iterates until the
  362.         expression evaluates to false.
  363.  
  364.         Place WHILE at the beginning of a line with multiple statements
  365.         separated by colons (:) or at the end of a set of statements that
  366.         are not separated by colons.  The entire line will continue to
  367.         iterate while the expression which follows WHILE evalutes true.
  368.  
  369.         Example: WHILE CALC A<10: SET A TO CALC A+1: PRINT A
  370.  
  371.         This would print the numbers 1 through 9 on the screen.  Using
  372.         the "no-colon" syntax, this expression would look like this:
  373.  
  374.         PRINT A SET A TO CALC A+1 WHILE CALC A<10
  375.  
  376. >>>     WITH     - Placeholder for syntax.  This command does nothing
  377.  
  378.         Example: REPLACE "BozoL" WITH "My Language" IN "BOZOL.DOC"
  379.  
  380.         REPLACE is not a command in BozoL, but if you wanted to make it
  381.         one all you would have to do is add it to the language.  In this
  382.         example we have a command called REPLACE which is used to perform
  383.         a search and replace in a file on disk.  The use of WITH and IN
  384.         is arbitrary but makes the syntax of this statement much more
  385.         memorable.
  386.  
  387.  
  388.