home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / flink11.zip / FPLuser.doc < prev    next >
Text File  |  1995-05-12  |  150KB  |  4,081 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                                      FPL
  7.  
  8.  
  9.                                    Version
  10.                                      11.5
  11.  
  12.  
  13.  
  14.  
  15.                                Daniel Stenberg
  16.  
  17.  
  18.  
  19.                             1993-1995 by FrexxWare
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.                          Generated with Heddley v1.1
  37.                       Heddley v1.1 (C) Edd Dumbill 1994
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.                                   - Page 1 -
  77.  
  78.  
  79.  
  80. 1.      FPL Users Documentation
  81.  
  82.  FPL is Copyright ⌐ 1992-1995 by FrexxWare. Permission is granted to freely
  83. distribute this program for non-commercial purposes only. FPL is distributed
  84. "as is" without warranty of any kind.
  85.  
  86.  This documents the FPL language as it runs from version 11. If you happen to
  87. use any lower version, upgrade!
  88.  
  89. -------------------------------------------------------------------------
  90.  
  91.   FPL is very similar to C. If you know C, then FPL is very fast to learn!
  92.  
  93.         Parts of the language:
  94.  
  95.      General
  96.      Expressions
  97.      Functions
  98.      Keywords
  99.      Line control
  100.      Statements
  101.      Strings
  102.      Variables
  103.      Pragmas            (New from version 8)
  104.  
  105.      Funclibs           [Amiga only]
  106.  
  107.         Subsequent information:
  108.  
  109.      About this manual
  110.      Error messages
  111.      Examples
  112.      Hints and tricks
  113.      How to reach us
  114.  
  115. -------------------------------------------------------------------------
  116.  
  117. For more information about the FPL distribution:  General information
  118.  
  119. And for programmers that want to implement FPL library support:
  120.  FPL implementation
  121.  
  122. 2.      About this manual
  123.  
  124.  This is the FPL LANGUAGE documentation. This deals with about everything that
  125. can be said about FPL from the user's view. For information about how to
  126. implement fpl.library in your own code, see the FPLlib.guide and fpl.doc
  127. files.
  128.  
  129.  Many examples provided are from the FrexxEd environment, meaning that several
  130. of the used functions in the examples are FrexxEd specific and not a part of
  131. FPL. (FrexxEd is Copyright ⌐ 1992-1994 by FrexxWare.)
  132.  
  133.  There should be sufficient information in this manual to allow every user to
  134. fully understand and use FPL. If it should prove unsufficent, report it!
  135.  
  136.  TECH Notes exist in some parts of the manual, explaining why I solved things
  137. the way I did and sometimes also how.
  138.  
  139.  This documentation is written during a long time and during a lot of FPL
  140. updates. There might still be some old version thinking in this manual, but I
  141. hope it won't destroy your ability to create something good with FPL.
  142.  
  143.  This manual does only handle the language FPL. When FPL is used in real life,
  144. it will always be used in a software which is host to FPL. That software will
  145. affect FPL a lot and you should read the FPL chapters of that software's
  146.  
  147.                                   - Page 2 -
  148. 2.     About this manual
  149.  
  150. documentation closely!
  151.  
  152. 3.      How to reach me
  153.  
  154.  For private matters/discussions/questions/ideas, drop me a email/netmail at
  155. our own BBS: The Holy Grail (+46-(0)8-6121258, FidoNet 2:201/328, running
  156. 28800 bps V34), or reach me at email: Daniel.Stenberg@sth.frontec.se!
  157.  
  158.  Problems concerning FPL, the library, bug reports, other FrexxWare products
  159. or stuff like that, are dedicated to public message areas  making it possible
  160. for everyone to share, learn and participate.
  161.  
  162.  If you have any ideas about things you'd like FPL to support, handle or run,
  163. don't hesitate to contact me and share your visions. FPL is continuously
  164. developing and I need feedback to know in which directions you want it to go.
  165.  
  166.  Swedish users of FPL can take advantage of the FidoNet echo mail area named
  167. R20_FPL. Available on backbone.
  168.  
  169.  If there is enough interest shown, I will consider arranging a standard
  170. internet mailing list for FPL discussions.
  171.  
  172.  All forthcoming updates and releases will be uploaded as fast as possible to
  173. the public ftp site known as AmiNet. (Thanks to Mattias Axelsson for his
  174. offering to do this on a regular basis!)
  175.  
  176.  I'm very often on IRC, using the nick name 'Bagder', meet me there!
  177.  
  178.  Source code is very much available and if you didn't get it in the package,
  179. get in touch!
  180.  
  181.   Snail mail address:
  182.  
  183.         Daniel Stenberg
  184.         Ankdammsgatan 36, 4tr
  185.         S-17143 SOLNA
  186.         Sweden
  187.  
  188. 4.      General
  189.  
  190. * Every execution begins at the top of the program and interprets from
  191.   left to right, downwards.
  192.  
  193. * All statements must be separated with a semicolon (;).
  194.  
  195. * FPL is case sensitive. That makes the following two variable names
  196.   different:
  197.  
  198.     hello  Hello
  199.  
  200. * There is no maximum length of a script line. In fact, the entire
  201.   program is indeed as good in one single line as in several lines.
  202.  
  203. * There is no line orientation in the language at all. Programs can be
  204.   written in almost any way provided that you follow the syntax rules
  205.   of the  keywords  and  functions . Whitespaces, comments and new lines
  206.   can be inserted anywhere to make the code more appealing to you.
  207.  
  208. * Comments are allowed everywhere and are written exactly as in C and
  209.   Arexx as well as in C++; starting with a "/*" and ending with a "*/"
  210.   with no nesting possibilities(1):
  211.  
  212.     /* This is a comment */
  213.  
  214.   or starting with a "//" symbol and ending with a new line. Ex:
  215.  
  216.     // This is also a comment
  217.  
  218.                                   - Page 3 -
  219. 4.     General
  220.  
  221.  
  222.   (Kjell, I hope you're really happy with this feature!)
  223.  
  224.   (1) - Since version 7, FPL can be made to accept nested comments.
  225.  
  226. * Continuation of string lines is written with a backslash (\)
  227.   character followed by a newline. Ordinary statements don't need
  228.   any continuation character at all. Just as in C... ;-) Ex:
  229.  
  230.   a=b                   /* This is a fully working statement */
  231.    >
  232.    c;
  233.  
  234.   b="hello\
  235.   world";               /* Continues a string assign.*/
  236.  
  237.   output                /* Split the name and the arguments... */
  238.   ("hi");
  239.  
  240.  
  241.   /* The code below works just fine, but writing much of this */
  242.   /* kind might make your code rather confusing! */
  243.   output(\
  244.   "h\
  245.   ello\
  246.    wor\
  247.   ld"\
  248.   );
  249.  
  250.   (In 'C' you can continue *EVERYTHING* by simply writing a backslash
  251.   and continue on the next line (thanks to the preprocessor that merges
  252.   such lines into one for the compiler). FPL cannot perform the same
  253.   if you're not using FPL together with a preprocessor that replaces
  254.   such sequences (such as FPP, the FrexxWare Pre Processor).)
  255.  
  256. * All identifier names (labels/functions/variables) is limited to no
  257.   more than 64 significant characters. More characters can be used, but
  258.   identifiers with the same 64 first characters are considered
  259.   identical.
  260.  
  261. * Identifiers can consist of both letters, numbers and underscores
  262.   ("_") but must not begin with a number. Letters are the 26 characters
  263.   from a to z and the 26 characters from A to Z.
  264.  
  265. * There is no kind of unconditional jump or goto in FPL. In languages
  266.   like this (with different local levels), goto is most frequently
  267.   used in the wrong way and the use of it should anyhow have been very
  268.   limited (just look at the goto function in C). FPL doesn't need any
  269.   goto/jump keyword.
  270.  
  271. * Do not, I repeat, do not rely on undocumented features in the
  272.   language. FPL is constantly being changed and new error checks might
  273.   be implemented in the next release. The strange feature you may find
  274.   working in this version, might be a sever error in the next.
  275.   Code as stated in the manual and your FPL code will have a much
  276.   bigger change to stay accurate even when the version number ascends.
  277.  
  278. 5.      Funclibs
  279.  
  280.    Overview
  281.    ~~~~~~~~
  282.  To enable third party programs to add functions to already running FPL
  283. sessions, the 'funclib' concept was invented. The inspiration source when
  284. designing the interface was to make it work like when using shared libraries
  285. (known as dynamic linking in some systems).
  286.  
  287.  Using this technique, all FPL programmers can take advantage of functions
  288.  
  289.                                   - Page 4 -
  290. 5.     Funclibs
  291.  
  292. that is placed in funclibs. By simply opening the funclib all its functions
  293. will exist and can get called. Any FPL program can open any funclib.
  294.  
  295.  Funclibs could contain functions for bringing up requesters easier, for
  296. compression procedures, for serial port communication or for file handling.
  297. The limits are set by the funclib programmer, not by anyone else!
  298.  
  299.     How to?
  300.     ~~~~~~~
  301.  By opening the desired funclib with the  openlib  function, all function will
  302. be there. There's nothing more to it than that!
  303.   After you've called the functions you wanted the funclib for, you simply
  304. call  closelib  which concludes access to that funclib.
  305.  
  306.  In some occasions, the host program might have already opened a funclib for
  307. you, and then you won't need to open it and you shouldn't close it.
  308.  
  309. 6.      Line Control
  310.  
  311.  I encourage the use of preprocessors together with FPL. FPL interprets the
  312. ANSI C standard "#line" instruction as a line number/file name changer.
  313.  
  314.     #line
  315.     =====
  316.  
  317.  A line control directive that supplies line numbers for FPL messages. It
  318. causes the next source line to be treated as having the specified number.
  319.  
  320.  Syntax
  321.  
  322. # line { decimal_constant [ "file_name" ] }
  323.  
  324.  In order for FPL to produce meaningful references to line numbers in
  325. preprocessed source, the preprocessor inserts #line directives where necessary
  326. (for example, at the beginning at after the end of included text).
  327.  
  328.  A file name specification enclosed in double quotation marks can follow the
  329. line number. If a file name is specified, FPL views the next line as part of
  330. the specified file. If a file name is not specified, FPL views the next line
  331. as part of the current source file.
  332.  
  333.  Note that the keyword 'line' is optional.  The directive
  334.  
  335.         # line 300
  336.  
  337.  is equivalent to
  338.  
  339.         # 300
  340.  
  341.  Example:
  342.  
  343.  On Amiga, an FPL source could be preprocessed using SAS/C 6.x by entering the
  344. following line:
  345.  
  346.   "sc PPONLY KEEPLINES <FPL program>"
  347.  
  348.  (note that if 'KEEPLINES' isn't specified, SAS/C won't output any #line
  349.   instructions!)
  350.  
  351. 7.      Pragmas in FPL
  352.  
  353. Pragmas are specified by entering
  354.  
  355.         #pragma <keyword>
  356.  
  357. first in a line, and where the <keyword> is a compiler specific instruction.
  358. FPL supports the following pragmas:
  359.  
  360.                                   - Page 5 -
  361. 7.     Pragmas in FPL
  362.  
  363.  
  364. (NOTE: do only use the pragmas if you are very certain of what they are doing,
  365. they alter settings done by the FPL implementor.)
  366.  
  367.  Keyword
  368.  -------
  369.  cache          Make FPL keep this file in memory after execution for faster
  370.                 access (it may very well do it anyway, depending on the FPL
  371.                 setup).
  372.  
  373.  nocache        Opposite to 'cache'. Make FPL to *not* keep this file in
  374.                 memory after usage, even if symbols were exported. The file
  375.                 will be loaded into memory each time it is to be used, and is
  376.                 flushed from memory when not in use.
  377.  
  378.  reread         When executing cached files, the original file might be
  379.                 changed. This pragma will force this file to be reread if
  380.                 it is changed on disk while another version is cached and
  381.                 then executed.
  382.  
  383.  noreread       The opposite to 'reread'. Force FPL to ignore if the file has
  384.                 been changed on disk or not.
  385.  
  386. 8.      Variables
  387.  
  388. * There exist a few kind of variables in FPL:
  389.  
  390.   integer       - holds a 32-bit signed numerical value.
  391.                   (maximum: 2147483647, minimum: -2147483648)
  392.                   Declarator: `int' or `long'
  393.  
  394.   short         - holds a 16-bit signed numerical value.
  395.                   (maximum: 32767, minimum: -32768)
  396.                   Declarator: `short'
  397.  
  398.   char          - holds an 8-bit signed numerical value.
  399.                   (maximum: 127, minimum: -128)
  400.                   Declarator: `char'
  401.  
  402.   string        - holds a contiguous sequence of characters.
  403.                   No length limit.
  404.                   Declarator: `string'.
  405.  
  406.   Declare a varaible by using the declarator followed by the symbol name and
  407.   an optional initial assign. Multiple declarations can be done by comma
  408.   separating them.
  409.   Example:
  410.  
  411.   int a;
  412.   string b;
  413.   int a=2;
  414.   string foobar="ninja", foo, bar;
  415.  
  416.   Variables not assigned when declared, equals zero or zero length strings.
  417.  
  418. * FPL includes NO floating point variables at all. The secret of still
  419.   making proper calculations is the  remainder operator .
  420.   (Floating point numbers/expressions is expected to appear in a future FPL
  421.   version.)
  422.  
  423. * Variables can be declared to exist in a few different ways:
  424.  
  425.   `static'      - makes the variable to be remembered until the next time
  426. this
  427.                   function is invoked.
  428.   `const'       - constant variable. After the initialization assign, this
  429.                   cannot be changed.
  430.  
  431.                                   - Page 6 -
  432. 8.     Variables
  433.  
  434.   `auto' and
  435.   `register'    - make a varible declared as a global to exist as a non-
  436.                   global.
  437.   `volatile'    - volatile variables exist in C. They are written back to
  438.                   memory each time they are changed. FPL variables are always
  439.                   written back when changed. Implemented to make C ports
  440.                   easier.
  441.   `unsigned' and
  442.   `signed'      - not currently implemented. These words are simply read and
  443.                   ignored.
  444.  
  445.   These keywords can be used together with a declarator keyword in any
  446.   combination. Examples:
  447.  
  448.   static int foobar;
  449.   int auto register foobar;
  450.   string static foobar;
  451.  
  452. * Create declarator aliases by using the keyword `typedef'. Usage:
  453.   "typedef <declarator> <symbol>;". After such a typedef, the alternative
  454.   declarator can be used whereever the original declarator can be used.
  455.  
  456. * Scope of FPL Identifiers
  457.  
  458.   The region where an identifier is visible in a program is referred to
  459.   as the scope of the identifier.
  460.  
  461.   The scope of an identifier is determined by where the identifier is
  462.   declared.
  463.  
  464.   Block scope
  465.   -----------
  466.     The identifier's declaration is located inside a statement
  467.   block.  An identifier with block scope is visible from the point where
  468.   it is declared to the closing brace (}) that ends the block.
  469.  
  470.   You can nest block visibility. A block nested inside a block can
  471.   contain declarations that redeclare identifiers declared in the outer
  472.   block. The new declaration of the identifier applies to the inner
  473.   block. The original declaration is restored when program control
  474.   returns to the outer block. An identifier from the outer block is
  475.   visible inside inner blocks that do not redefine the variable.
  476.  
  477.   File scope
  478.   ----------
  479.     The identifier's declaration appears outside of any block, before the
  480.   start of the program.
  481.   An identifier with file scope is visible from the point where it is
  482.   declared to the end of the source file.
  483.  
  484.   Example:
  485.  
  486.     void cool(int);
  487.     void stupid(int);
  488.  
  489.     int a=-50;
  490.     int b=1000;
  491.     cool(a):
  492.     exit;
  493.  
  494.     void cool(int a)
  495.     {
  496.       stupid(a);
  497.     }
  498.  
  499.     void stupid(int a)
  500.     {
  501.  
  502.                                   - Page 7 -
  503. 8.     Variables
  504.  
  505.       {
  506.         int b=0;
  507.       }
  508.       output(b/a);
  509.     }
  510.  
  511. * All FPL variables must be declared before use and they must be
  512.   declared first in the block. (Blocks are always started with an
  513.   an open brace and ended with return() or a close brace.)
  514.   (NOTE: The technique is like the one used in common C)
  515.   Ex:
  516.  
  517.     int a;
  518.     for(a=0; a<10; a++) {
  519.       int b=0;
  520.       output(b);
  521.     }
  522.  
  523.   is correct, but NOT this:
  524.  
  525.     char a;
  526.     output(a);
  527.     short b=5;  /* the line above broke the chain of declarations */
  528.  
  529. * Variables declared within loop braces will be declared and
  530.   assigned every loop, this is anyhow not good for execution speed! Ex:
  531.  
  532.     int a;
  533.     for(a=0; a<6; a++) {
  534.       int b=a*2;
  535.       output(b, ", ");
  536.     }
  537.  
  538.   This example will output() "0, 2, 4, 6, 8, 10 " !
  539.  
  540. * Multi dimensional variable arrays are supported. To create e.g twenty
  541.   integers:
  542.  
  543.     int hello[20];
  544.  
  545.     (These will be accessible by the names hello[n], where n is a number
  546.     from 0 to 19.)
  547.  
  548.   or
  549.  
  550.     int hello[4][5];
  551.  
  552.     (These will be accessible by the names hello[n][m], where n is a number
  553.     from 0 to 3, and m is a number from 0 to 4.)
  554.  
  555. * Assign arrays using the {} operators. This example assigns var[3] to
  556.   100 and var[4] to 200:
  557.  
  558.     var[3]={100, 200};
  559.  
  560.   When declaring variables, the array assign always begins with the
  561.   first member of the array, this line assigns the four members a[0] to
  562.   a[3]:
  563.  
  564.     string a[4]={"hi", "how", "are", "you?"};
  565.  
  566.   The value of an array assign expression is always the last member of
  567.   the assign list. The following example will output the word "world"
  568.   on the screen:
  569.  
  570.     output(a[0]={"hello", "world"});
  571.  
  572.  
  573.                                   - Page 8 -
  574. 8.     Variables
  575.  
  576.   Compound assigns on arrays are also valid! The following line adds 2,
  577.   3 and 4 to the variables length[3], length[4] and length[5]:
  578.  
  579.     length[3]+={2, 3, 4};
  580.  
  581.   The value of this expression will be the last addition (length[5]+4).
  582.  
  583.   The string append operator is also array friendly. The following
  584.   example add strings to the strings names[1] and names[2].(The
  585.   returning string will be names[2]+=" (stupid)".):
  586.  
  587.     names[1]+={" (ill)", " (stupid)"};
  588.  
  589.   Of course, this works with array using more than one dimension too:
  590.  
  591.     int foo[2][3]={
  592.       {0, 1, 2},
  593.       {2, 3, 4}
  594.     };
  595.  
  596.   On the fly, things like this can (of course) be used:
  597.  
  598.     foo[1]^={{2}, {3, 4}};
  599.  
  600. * Attempts to create a variable with a name that is already being used
  601.   by another variable in the same local level will result in an error.
  602.  
  603. * FPL supports variable referencing, more familiar to C programmers as
  604.   pointers to variables. Currently, though, you cannot declare or assign
  605.   them in any other way than through the parameters of a function call:
  606.  
  607.     int foobar(int *barfoo) /* this function receives an integer reference */
  608.     {
  609.       *barfoo = 5; /* assign the variable 'barfoo' is referencing! */
  610.       barfoo = 5;  /* ILLEGAL /
  611.     }
  612.     int ninja;
  613.     foobar(&ninja); /* make foobar() assign the 'ninja' variable!
  614.  
  615.   The same procedure is indeed possible to perform when referencing strings.
  616.  
  617. 9.      Strings
  618.  
  619. SYNTAX  string varname [= str_expr];
  620.  
  621.           or
  622.  
  623.         string funcname ( [arg1] [, arg2] [...] );
  624.  
  625. DESCRIPTION
  626.         Declare a string variable and assign contents to it or declare a
  627.         function returning a string.
  628.  
  629.         For function declaration, see  functions ;
  630.  
  631. INPUTS  string varname  - Name of the variable
  632.         string str_expr - Initial string assign.
  633.  
  634.           or
  635.  
  636.         string
  637.  
  638.  
  639. SEE      int
  640.  
  641.  
  642.  
  643.  
  644.                                   - Page 9 -
  645. 9.     Functions
  646.  
  647.  
  648. 10.     Functions
  649.  
  650. If you are not aquinted to the use/calling of functions from FPL, read the
  651.  general function usage  paragraph.
  652.  
  653. In a standard FPL environment there is a lot of functions that the FPL
  654. programs can use. They are added to FPL in three different ways:
  655.  
  656. * The host program of FPL adds a lot of functions so that the programs really
  657.   can do anything fun with the software. Such functions are called "external"
  658.   functions and they can't be described in this document but will be found in
  659.   the host programs documentation.
  660.  
  661. *  Inside functions  that are declared and defined in an
  662.   FPL program. Any FPL program can create a function that can be called from
  663.   another function and that is treated and looks just like all the other
  664.   functions.
  665.  
  666. * The  Internal functions  are supplied by FPL itself. Such functions
  667.   will always be there, no matter what the name or the purpose of the host
  668.   program is.
  669.  
  670. 11.     Declare inside functions
  671.  
  672.  This chapter handles FPL function declarations and definitions. A function
  673. declararation declares the format and existence of a function prior to its
  674. use. A function definition defines a function.
  675.  
  676.  A function in FPL must always be declared (prototyped) or defined before it
  677. is used. Otherwise it doesn't know where to find the function and how to
  678. interpret its parameters.
  679.  
  680.     Function Declaration (prototyping)
  681.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  682.  A function declaration establishes the name of the function, the type of
  683. result that the function returns and the types of the arguments expected by
  684. the function when you call it.
  685.  
  686. If the function does not return a value, declare it as a function returning
  687. void.
  688.  
  689. If the function is to be accessed from other program than this, it should be
  690. declared `export <the rest>'.
  691.  
  692. Example:
  693.  
  694.       int func (int, string);
  695.  
  696.     Function Definition
  697.     ~~~~~~~~~~~~~~~~~~~
  698.  A function definition specifies the name, formal parameters, and body of a
  699. function. You must also specify the function's return type.
  700.  
  701. A function definition contains the following:
  702.  
  703. * A type specifier, which determines the type of value that
  704.   the function returns. A function returning no value should be declared
  705.   to return `void'. A function can have any type specifier.
  706.  
  707. * A function identifier, which provides the function with a name.
  708.  
  709. * A list of parameters that the function expects and their types.
  710.  
  711. * A block statement, which contains data definitions and code.
  712.  
  713.  A function can be called by itself or by any function that appears in the
  714.  
  715.                                  - Page 10 -
  716. 11.    Declare inside functions
  717.  
  718. same file as the function definition. If a function has been declared
  719. `export'ed, the function also can be called by functions that appear in other
  720. files, otherwise it can only be directly invoked from within the same source
  721. file.
  722.  
  723.  The function definition or a declaration for the function must appear before,
  724. and in the same file as, a call to the function.  All declarations for a given
  725. function must be compatible with the function definition. They must have the
  726. same return type and the same parameter types.
  727.  
  728.  The following example is a complete definition of the function sum:
  729.  
  730.       int sum(int x,int y)
  731.       {
  732.         return(x + y);
  733.       }
  734.  
  735.  The function sum returns int, and receives two values declared as x and y.
  736. The function body contains a single statement that returns the sum of x and
  737. y.
  738.  
  739.  To indicate that a function accepts no parameters, use the keyword void as
  740. the type specifier in place of the parameter.  For example:
  741.  
  742.       stop(void) { }
  743.  
  744.  In the following example, the function f() takes one integer parameter and
  745. returns no value, while g() expects no parameters and returns an integer.
  746.  
  747.       void f(int); int g(void);
  748.  
  749.     Function Body
  750.     ~~~~~~~~~~~~~
  751.  The body of a function is a  block statement.  The following function has an
  752. empty body:
  753.  
  754.      void stub1(void) { }
  755.  
  756. The body of the following function contains a definition for the integer
  757. variable big_num and a call to the function  printf:
  758.  
  759.       void largest(int num1, int num2) {
  760.          int big_num;
  761.  
  762.          if (num1 >= num2)
  763.            big_num = num1;
  764.          else
  765.            big_num = num2;
  766.  
  767.          printf("big_num = %d\n", big_num);
  768.          return 0;
  769.       }
  770.  
  771. Block statements are described in  Statements .
  772.  
  773. * Prototypes *MUST* be first in the program. Before any program starts and
  774.   outside all braces to be global. Prototyping within the braces of a
  775. function
  776.   makes the function only local accessible.
  777.  
  778. 12.     General function use
  779.  
  780.  Here follows the ground rules when using/calling a function in FPL programs.
  781.  
  782. * A function call has three major parts:
  783.   1 - The function identifier. The name of the function.
  784.   2 - A list of parameters. Most functions demands some kind of input.
  785.  
  786.                                  - Page 11 -
  787. 12.    General function use
  788.  
  789.   3 - A return code from the function call.
  790.  
  791.   In the example:
  792.  
  793.                         retval = foobar ( "hello", 100 ) ;
  794.  
  795.   Reference letter:        A        B   C    D   E   F G H
  796.  
  797.   A - The variable that received the return code of the function. It must be
  798.       be of the type that the function returns. If the function returns a
  799.       string, the variable that receives the return code must be a string.
  800.       A return code from a function can always be ignored. Often it is wise
  801.       to check for progress, but it is always the choice of the programmer.
  802.  
  803.   B - The function name. We call the "foobar" function in this example.
  804.  
  805.   C - Always write the parameter list within parentheses. They tell FPL that
  806.       this really is a function. Even functions without in any input
  807.       parameters must be called with parentheses (but then without any
  808.       parameters in between)!
  809.  
  810.   D - This is the first parameter to the function. Appearantly this function
  811.       accepts a string type as first parameter. Any string variable or string
  812.       expression is then a valid parameter.
  813.  
  814.   E - Separate all parameters with a comma ",".
  815.  
  816.   F - This is a second parameter. Appearantly this function accepts an
  817.       integer type as second parameter. Any integer variable or numerical
  818.       expression is then a valid parameter.
  819.  
  820.   G - Conclude the parameter list with a closing parenthesis. Obviously, this
  821.       function is happy with two parameters.
  822.  
  823.   H - End of statement is as always indicated with a semicolon ";".
  824.  
  825.  
  826. * Internal and external functions might have some arguments optional and some
  827.   functions may even accept parameter lists (an optional amount of parameters
  828.   of a certain type). All functions must always at least be called with the
  829.   number of required arguments as declared. Refer to the software docs.
  830.  
  831.  
  832. * There are four kinds of arguments possible to pass to a function :
  833.  
  834.   1. Strings - constant strings or expressions returning strings.
  835.  
  836.   2. Numeric arguments - are likewise read as  numerical expressions
  837.      including everything true expressions consist of. An integer argument
  838.      can be sent as any kind of "char", "int" or "short" and can be received
  839.      by any one of those. FPL is tolerant when speaking about the mix of
  840.      such.
  841.  
  842.   3. String variable references - pointer to a  string variable .
  843.  
  844.   4. Numeric variable references - pointer to an  integer variable .
  845.      Just as with integer arguments, the use of the integers can be any of
  846.      the three integer types "char", "short" and "int"/"long".
  847.  
  848.  
  849. * All arguments that should be sent to and received in the function must
  850.   be declared by comma separating "int", "string", "int *" or "string *".
  851.   (Using "char", "short" or "long" is of course working too.)
  852.  
  853.     "int"       - sends an integer result of an expression.
  854.     "string"    - sends a string result.
  855.     "int *"     - sends a named integer variable.
  856.  
  857.                                  - Page 12 -
  858. 12.    General function use
  859.  
  860.     "string *"  - sends a named string variable.
  861.  
  862.   Sending "int *" or "string *" makes the function able to change the
  863.   contents of the variables used in the calling function.
  864.  
  865.   All declared arguments are required. Optionals are not possible to declare.
  866.  
  867.   C programmers see the obvious inspiration programming language.
  868.  
  869. 13.     Constants
  870.  
  871.   Sepcifying constants in FPL can be done in several ways.
  872.  
  873.   Numeric expression constants can be written as:
  874.  
  875.   WHAT                  HOW                             EXAMPLE
  876.   ------------------------------------------------------------------
  877.  
  878.   * octal number        an octal number with a zero     012
  879.                         prefix
  880.  
  881.   * binary number       a binary number with a "0b"     0b011010
  882.                         prefix
  883.  
  884.   * hexadecimal number  a hexadecimal number with a     0xDEADBEEF
  885.                         "0x" prefix
  886.  
  887.   * decimal number      a number                        129
  888.  
  889.   * ASCII code          a character within apostrophes  'a'
  890.  
  891.  
  892.   String constants can also be written as:
  893.  
  894.   * octal numbers       "\nnn" where nnn is an 1-3      "\12"
  895.                         digit octal number
  896.  
  897.   * hexadecimal numbers "\xhh" where hh is a two digit  "\xea"
  898.                         hexdecimal number
  899.  
  900.   * a string            anything within quots           "k i ll^e(rn/injax"
  901.  
  902. 14.     Blockstatement
  903.  
  904.   A block statement lets you to group any number of data definitions,
  905. declarations, and statements into one statement.  All definitions,
  906. declarations, and statements enclosed within a single set of braces are
  907. treated as a single statement.  You can place a block wherever a single
  908. statement is allowed.
  909.  
  910.   All definitions and declarations occur at the beginning of a block before
  911. statements.  Statements must follow the definitions and declarations.  A block
  912. is treated as a single statement.
  913.  
  914.   If you redefine a data object inside a nested block, the inner object hides
  915. the outer object while the inner block is processed.  Defining several
  916. variables that have the same identifier can make a program difficult to
  917. understand and maintain.  Therefore, you should limit such redefinitions of
  918. identifiers within nested blocks.
  919.  
  920.   If a data object is usable within a block and its identifier is not
  921. redefined, all nested blocks can use that data object.
  922.  
  923.   Initialization of an auto or register variable occurs each time the block is
  924. run from the beginning.  If you transfer control from one block to the middle
  925. of another block, initializations are not always performed.  You cannot
  926. initialize an extern variable within a block.
  927.  
  928.                                  - Page 13 -
  929. 14.    Blockstatement
  930.  
  931.  
  932.   Examples
  933.  
  934. The following example shows how the values of data objects change in nested
  935. blocks:
  936.  
  937.   int main(void)
  938.   {
  939.      int x = 1;               /* Initialize x to 1 */
  940.      int y = 3;
  941.  
  942.      if (y > 0)
  943.      {
  944.        int x = 2;           /* Initialize x to 2 */
  945.        output("second x = ", x, "\n");
  946.      }
  947.      output("first x = ", x, "\n");
  948.   }
  949.  
  950. The example produces the following output:
  951.  
  952.   second x = 2
  953.   first x = 1
  954.  
  955.   Two variables named x are defined in main.  The definition of x on line 5
  956. retains storage throughout the execution of main.  However, because the
  957. definition of x on line 10 occurs within a nested block, line 11 recognizes x
  958. as the variable defined on line 10.  Line 13 is not part of the nested block.
  959. Thus, line 13 recognizes x as the variable defined on line 5.
  960.  
  961. 15.     Statements
  962.  
  963.   These are the statements that FPL includes:
  964.  
  965.         -  Block
  966.         -  break
  967.         -  continue
  968.         -  do
  969.         -  Expression
  970.         -  for
  971.         -  if
  972.         -  Null
  973.         -  return
  974.         -  switch      (New from version 7)
  975.         -  while
  976.  
  977. 16.     Null statement
  978.  
  979.   The null statement performs no operation;
  980.  
  981. SYNTAX
  982.         ;
  983.  
  984. EXAMPLE
  985.         int i;
  986.         for(i=0; i<100; function(i++))
  987.           ; /* null statement */
  988.  
  989. 17.     Expression statement
  990.  
  991.   Expression statements performs some kind of evaluation of expression(s).
  992.  
  993. * Statements must feature an action or cause an error.
  994.  
  995.   int a;        /***************************************/
  996.   a++;          /* These are examples of statements    */
  997.   a=2;          /* that include some kind of "action". */
  998.  
  999.                                  - Page 14 -
  1000. 17.    Expression statement
  1001.  
  1002.   go(a);        /***************************************/
  1003.  
  1004.   2+2;          /************************************************/
  1005.   a;            /* These lines are NOT valid stand aloners      */
  1006.   (c>22)*3;     /* since they don't perform any kind of change. */
  1007.   a-14*a;       /************************************************/
  1008.  
  1009.  
  1010.   Since the release of version 10, FPL does now feature yet another ANSI C
  1011. feature:
  1012.  
  1013.   Expressions containing the operators &&, || or ?: can be only partly
  1014. evaluated depending on the results of the other parts. Ex, in the expression
  1015. "(a || b)" a is true, and then FPL won't execute/evaluate b. Likewise "(a &&
  1016. b)" where a is FALSE, will never reach b. Also "a=b?c:d" will reach c only if
  1017. b is true, and d only if b is false!!
  1018.  
  1019. 18.     Keywords
  1020.  
  1021. Detailed information is obtained in the  keyword reference .
  1022.  
  1023.     Summary:
  1024.     ========
  1025.  
  1026. * Loop statements are done very similarly as in C, using the 'for', 'while'
  1027.   or 'do' statements. They are used as in the C programming language:
  1028.   (with exception for the wonderful "else" statement in "while"... )
  1029.  
  1030.      do  {  statement ;}  while (  expression  )
  1031.  
  1032.      while  (  expression  ) {  statement ; } [  else  {  statement : } ]
  1033.  
  1034.      for  ( expression1 ;  expression2 ;  expression3 ) {  statement ; }
  1035.  
  1036.   A feature (which I've always been missing when coding C) has been
  1037.   added, and that's `else' after `while'! If the condition never goes
  1038.   true, the 'else' statement will be executed.
  1039.  
  1040.    continue  works 100% as in C.
  1041.  
  1042.    break  is like break in C, but extended with an optional level
  1043.   argument.
  1044.  
  1045. * Take care of exceptions just as you do in C using statements like:
  1046.  
  1047.    if  (  expression  ) {  statement ; } [  else  {  statement ; } ]
  1048.  
  1049. * Declare variables and functions by using the keywords:
  1050.  
  1051.    int ,  char ,  short  and  long  that all creates numerical variables.
  1052.  
  1053.    string  declares a string variable.
  1054.  
  1055.    resize  changes the size of an already existing array.
  1056.  
  1057.    export  tells FPL that the following global declaration
  1058.   is to be exported. Exported global symbols are accessible in any file.
  1059.  
  1060.    More variable declaration details .
  1061.  
  1062. * Exit programs or functions by using:
  1063.  
  1064.    exit  or  return
  1065.  
  1066. 19.     Hints and tricks
  1067.  
  1068.   Since I've created FPL and know about its inner workings, I'll try to sum a
  1069.  
  1070.                                  - Page 15 -
  1071. 19.    Hints and tricks
  1072.  
  1073. few words about what could be useful to think of when coding FPL.
  1074.  
  1075.     General
  1076.     =======
  1077.  
  1078.  Parenthesized expressions will help you from making mistakes in expressions
  1079. due to lack of operator precedence knowledge.
  1080.  
  1081.  Do not declare unnecessary variables or variables you don't have to use. Try
  1082. to reuse already declared ones and stay away from the nasty variable
  1083. declaration  keywords !
  1084.  
  1085.  Of course FPL is a perfect example of using a C programming preprocessor if
  1086. you want preprocessor features like include files, macros and such goodies.
  1087. FPL currently works perfect running preprocessed programs including the
  1088. preprocessor instruction "#line".
  1089.  
  1090.     Interpreting speed
  1091.     ==================
  1092.  
  1093.  FPL Performance philosophy is a structured programmer's nightmare coming
  1094. true. What is said to be ugly or even dirty coding in C, in fact often is to
  1095. prefer in FPL since it's interpreting one statement at a time.
  1096.  
  1097.  Do as much as you can in as few  statements  as possible is a golden rule.
  1098. Use as few function calls as possible. Try to append everything possible to
  1099. the function's argument and call it only once.
  1100.  
  1101.  Use  compound  and nested  variable assigns ! FPL has no compiler, which
  1102. makes statements like "a=a+2; b=b+a; function(a);" interpret MUCH slower than
  1103. "function(b+=(a+=2))" even though it might look better and be more readable.
  1104. (If it was hard to code it should be hard to read, right?)
  1105.  
  1106.  Avoid long and complicated  string handlings . If you must use a string, try
  1107. putting it in a variable and refer to that variable as much as possible.
  1108. Especially loops will benefit a *LOT* in speed. Future version of FPL might
  1109. deal with static strings (non-variable referenced) in a better way.
  1110.  
  1111.     Bug hunting
  1112.     ===========
  1113.  
  1114.   Of course even FPL routines will be coded incorrect from time to time.
  1115.  
  1116.  Comment your code. It's not hard, decreases performance only slightly and
  1117. makes it so very much easier to change the code. And who knows, perhaps
  1118. someone else would want to change it in the future!
  1119.  
  1120.  Wait for the soon appearing FPL debugger!
  1121.  
  1122. 20.     Numeric expressions (and operators)
  1123.  
  1124.   Numeric expressions are a basic part of FPL programs. Expressions are
  1125. evaluated on the basis of the operators that the expressions contain and the
  1126. contexts where the expressions can be used.
  1127.  
  1128.      Constants                Not changing values
  1129.  
  1130.      Grouping and evaluating  Precedence, associativity, etc
  1131.  
  1132.      Primary Expressions      Parentheses, function calls
  1133.      Unary Expressions        ++, --, +, -, !, ~
  1134.      Binary Expressions       (*, /, %, +, -, <<, >>, <, >, <=, >=, ==, etc)
  1135.      Assignment expressions   (+=, -=, *=, /=, %=, etc)
  1136.      Conditional Expressions  (?, :)
  1137.      Comma expressions        (,)
  1138.  
  1139.  
  1140.  
  1141.                                  - Page 16 -
  1142. 20.    Grouping and evaluating
  1143.  
  1144.  
  1145. 21.     Grouping and evaluating
  1146.  
  1147.  Two operator characteristics determine how operands group with operators:
  1148. precedence and associativity. Precedence provides a priority system for
  1149. grouping different types of operators with their operands. Associativity
  1150. provides a left-to-right order for grouping operands to operators that have
  1151. the same precedence.
  1152.  
  1153.  You can explicitly state the grouping of operands with operators by using
  1154. parentheses.
  1155.  
  1156.  In the expression
  1157.  
  1158.  a + b * c / d
  1159.  
  1160.  the * and / operations are evaluated before + because of precedence. b is
  1161. multiplied by c before it is divided by d because of associativity.
  1162.  
  1163.  The following table lists the FPL language operators in their order of
  1164. precedence. The operators are listed in order of precedence:  primary
  1165. operators have the highest precedence, and the  comma operator  has the lowest
  1166. precedence. Operators that appear in the same group have the same precedence.
  1167.  
  1168.  FPL's operator precedence is 100% ANSI C compatible.
  1169.  
  1170.     Operator Precedence and Associativity (decreasing order):
  1171.     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1172.  
  1173.     Operator Type           Associativity   Operators
  1174.     -------------           -------------   ---------
  1175.      Primary               left to right   (), function calls
  1176.      Unary                 right to left   ++ -- - + ! ~ []
  1177.      Multiplicative        left to right   * / %
  1178.      Additive              left to right   + -
  1179.      Bitwise Shift         left to right   << >>
  1180.      Relational            left to right   < > <= >=
  1181.      Equality              left to right   == !=
  1182.      Bitwise Logical AND   left to right   &
  1183.      Bitwise Exclusive OR  left to right   ^
  1184.      Bitwise Inclusive OR  left to right   |
  1185.      Logical AND           left to right   &&
  1186.      Logical OR            left to right   ||
  1187.      Conditional           right to left   ? :
  1188.      Assignment            right to left   = += -= *= /= <<= &= ^= |= >>=
  1189.      Comma                 left to right   ,
  1190.  
  1191.  
  1192.  The order of evaluation for the operands of the logical AND (&&) and the
  1193. logical OR (||) operators is always left-to-right. If the operand on the left
  1194. side of a && operator evaluates to 0 (zero), the operator on the right side is
  1195. not evaluated. If the operand on the left side of a || operator evaluates to
  1196. nonzero, the operator on the right side is not evaluated.
  1197.  
  1198.  
  1199.     Examples
  1200.  
  1201. The parentheses in the following expressions explicitly show how FPL groups
  1202. operands and operators:
  1203.  
  1204.     total = (4 + (5 * 3));
  1205.     total = (((8 * 5) / 10) / 3);
  1206.     total = (10 + (5/3));
  1207.  
  1208.  FPL group operands with operators that are both associative and commutative
  1209. in a simple left-to-right order. We group the operands and operators of the
  1210. expression
  1211.  
  1212.                                  - Page 17 -
  1213. 21.    Grouping and evaluating
  1214.  
  1215.  
  1216.     total = price + prov_tax + city_tax;
  1217.  
  1218. in the following way (as indicated by parentheses):
  1219.  
  1220.     total = ((price + prov_tax) + city_tax);
  1221.  
  1222.  TECH NOTE:
  1223.  ~~~~~~~~~~
  1224.  In C, the example above could have been evaluated the following ways too
  1225.     total = ((price + city_tax) + prov_tax);
  1226.     total = (price + (prov_tax + city_tax));
  1227.  
  1228.  But that's not too good if you want to use expressions like
  1229.     a = b++ + (b>10?10:20);
  1230.  since you wouldn't know in which order the b variable is read and used... FPL
  1231. reads and uses it in a left-to-right order.
  1232.  
  1233. 22.     Primary expressions
  1234.  
  1235.  All primary operators have the same precedence and have left-to-right
  1236. associativity. See  Grouping and Evaluating FPL Expressions
  1237.  
  1238.  For detailed information on primary operators, see
  1239.  
  1240.      Parenthesized Expressions
  1241.      Function calls
  1242.  
  1243. 23.     Parenthesized Expressions
  1244.  
  1245.  You can use parentheses to explicitly state how operands group with
  1246. operators. The following expression does not contain any parentheses used for
  1247. grouping operands and operators. The parentheses surrounding weight and
  1248. zipcode form a function call. Notice how FPL groups the operands and operators
  1249. in this expression:
  1250.  
  1251.  Expression without Parentheses:
  1252.  
  1253.        -discount * item + handling(weight, zipcode) > 10 * item
  1254.  
  1255.  The following expression is similar, but contains parentheses that change how
  1256. the operands and operators are grouped:
  1257.  
  1258.  Expression with Parentheses:
  1259.  
  1260.       (-discount * (item + handling(weight, zipcode))) > (10 * item)
  1261.  
  1262. 24.     Function calls
  1263.  
  1264.  A function call is a primary expression followed by a parenthesized argument
  1265. list. The argument list can contain any number of expressions separated by
  1266. commas, or it can be empty.
  1267.  
  1268.  For example:
  1269.  
  1270.       stub()
  1271.  
  1272.       overdue(account, date, amount)
  1273.  
  1274.       notify(name, (date+5))
  1275.  
  1276.       report(error, time, date, (num++))
  1277.  
  1278.  The arguments are evaluated, and each parameter is assigned the value of the
  1279. corresponding argument. Assigning a value to a parameter changes the value
  1280. with in the function, but has no effect on the argument.
  1281.  
  1282.  
  1283.                                  - Page 18 -
  1284. 24.    Unary Expression
  1285.  
  1286.  
  1287. 25.     Unary Expression
  1288.  
  1289.  
  1290.  An unary expression contains one operand of scalar type and an unary
  1291. operator. All unary operators have the same  precedence . As indicated in the
  1292. following descriptions, the usual arithmetic conversions are performed on the
  1293. operands of most unary expressions.
  1294.  
  1295.       Bitwise Negation ~
  1296.       Decrement --
  1297.       Increment ++
  1298.       Logical Negation !
  1299.       Unary Minus -
  1300.       Unary Plus +
  1301.  
  1302. 26.     Increment ++
  1303.  
  1304.  The ++ (increment) operator adds 1 (one) to the value of the operand. The
  1305. operand receives the result of the increment operation.
  1306.  
  1307.  You can place the ++ before or after the operand. If the ++ appears before
  1308. the operand, the operand is incremented; then the incremented value is used in
  1309. the expression. If you place the ++ after the operand, the current value of
  1310. the operand is used in the expression; then the operand is incremented. For
  1311. example:
  1312.  
  1313.       play = ++play1 + play2++;
  1314.  
  1315.  is equivalent to the following sequence of expressions:
  1316.  
  1317.       play1 = play1 + 1;
  1318.       play = play1 + play2;
  1319.       play2 = play2 + 1;
  1320.  
  1321.  In the C language they say "avoid using a variable more than once in an
  1322. expression where the variable is incremented". But that's not necessary in
  1323. FPL! I've created it to work as I wanted it, and so it does...
  1324.  
  1325.       y = x(i) + i++;
  1326.  
  1327. Does work exactly as you think; first calls the function x(), adds the value
  1328. of i and finally increases i.
  1329.  
  1330. 27.     Decrement --
  1331.  
  1332. Acts as the  ++ operator , but instead of adding it's subtracting!
  1333.  
  1334. 28.     Unary plus +
  1335.  
  1336. The + (unary plus) operator maintains the value of the operand.
  1337.  
  1338. The result of applying the unary plus operator to a signed operand is
  1339. equivalent to the promoted type of the operand.
  1340.  
  1341. 29.     Unary minus -
  1342.  
  1343. The - (unary minus) operator negates the value of the operand.
  1344.  
  1345. The result of applying the unary minus operator to a signed operand is
  1346. equivalent to the negative promoted type of the operand.
  1347.  
  1348. For example, if quality has the value 100, then -quality has the value -100.
  1349.  
  1350. 30.     Logical negation !
  1351.  
  1352. The ! (logical negation) operator determines whether the operand evaluates to
  1353.  
  1354.                                  - Page 19 -
  1355. 30.    Logical negation !
  1356.  
  1357. 0 (false). If so, the operation yields the value 1 (true). If the expression
  1358. evaluates to a nonzero value, the operation yields the value 0 (false).
  1359.  
  1360. If right is not equal to 0, the following two expressions are equivalent:
  1361.  
  1362.   !right;
  1363.   right == 0;
  1364.  
  1365. 31.     Bitwise negation ~
  1366.  
  1367. The ~ (bitwise negation) operator yields the ones complement of the operand.
  1368. In the binary representation of the result, every bit has the opposite value
  1369. of the same bit in the operand.
  1370.  
  1371. Suppose x represents the decimal value 5. The 32-bit binary representation of
  1372. x is:
  1373.  
  1374. 00000000000000000000000000000101
  1375.  
  1376. The expression ~x yields the following result, represented here as a 32-bit
  1377. binary number:
  1378.  
  1379. 11111111111111111111111111111010
  1380.  
  1381. The 32-bit binary representation of ~0 is:
  1382.  
  1383. 11111111111111111111111111111111
  1384.  
  1385. 32.     Binary expressions
  1386.  
  1387.  A binary expression contains two operands separated by one operator.
  1388.  
  1389.  Not all binary operators have the same  precedence .
  1390.  
  1391.  To ensure correct results, avoid creating expressions that depend on the
  1392. order in which FPL evaluates the operands.
  1393.  
  1394.      Addition +
  1395.      Bitwise AND &
  1396.      Bitwise Exclusive OR ^
  1397.      Bitwise Inclusive OR |
  1398.      Bitwise Shift << >>
  1399.      Division /
  1400.      Equality == !=
  1401.      Logical AND &&
  1402.      Logical OR ||
  1403.      Multiplication *
  1404.      Relational < > <= >=
  1405.      Remainder %
  1406.      Subtraction -
  1407.  
  1408. 33.     Multiplication *
  1409.  
  1410. The * (multiplication) operator yields the product of its operands.
  1411.  
  1412. Because multiplication has both associative and commutative properties, the
  1413. operands will be grouped in a left-to-right order. For example, the
  1414. expression:
  1415.  
  1416.   sites * number * cost
  1417.  
  1418. is interpreted in  the following way:
  1419.  
  1420.   (sites * number) * cost
  1421.  
  1422.  
  1423.  
  1424.  
  1425.                                  - Page 20 -
  1426. 33.    Division /
  1427.  
  1428.  
  1429. 34.     Division /
  1430.  
  1431. The / (division) operator yields the quotient of its operands.
  1432.  
  1433. If both operands are positive integers and the operation produces a remainder,
  1434. FPL ignores the remainder. Thus, the expression 7 / 4 yields the value 1
  1435. (rather than 1.75 or 2).
  1436.  
  1437. The C language does not define how the compiler treats the quotient when
  1438. either of the operands has a negative value.  Thus, -7 / 4 can yield either -1
  1439. or -2. However, on all IBM C compilers, -7 / 4 always results in a quotient of
  1440. -1 and a  remainder  of -3, and that's the rule FPL has been following.
  1441.  
  1442. It ends up in an error message if the second operand (the denominator)
  1443. evaluates to 0 (zero).
  1444.  
  1445. 35.     Remainder %
  1446.  
  1447. The % (remainder) operator yields the remainder from the  division  of the
  1448. left operand by the right operand. For example, the expression 5 % 3 yields
  1449. 2.
  1450.  
  1451. If the right operand evaluates to 0 (zero), it results in an error message. If
  1452. either operand has a negative value, the result is such that the following
  1453. expression always yields the value of a if b is not 0 (zero):
  1454.  
  1455.   ( a / b ) * b + a % b;
  1456.  
  1457. 36.     Addition +
  1458.  
  1459. The + (addition) operator yields the sum of its operands.
  1460.  
  1461. 37.     Subtraction -
  1462.  
  1463. The - (subtraction) operator yields the difference of its operands.
  1464.  
  1465. 38.     Bitwise left and right shift << >>
  1466.  
  1467. The bitwise shift operators move the bit values of a binary object. The left
  1468. operand specifies the value to be shifted. The right operand specifies the
  1469. number of positions that the bits in the value are to be shifted.
  1470.  
  1471. The << (bitwise left shift) operator indicates the bits are to be shifted to
  1472. the left. The >> (bitwise right shift) operator indicates the bits are to be
  1473. shifted to the right.
  1474.  
  1475. The right operand should not have a negative value or a value that is greater
  1476. than the width in bits of the expression being shifted. Bitwise shifts on such
  1477. values give unpredictable results.
  1478.  
  1479. If the right operand has the value 0 (zero), the result is the value of the
  1480. left operand (after the usual arithmetic conversions).
  1481.  
  1482. The << operator fills vacated bits with zeros. For example, if l_op has the
  1483. value 4019, the bit pattern (in 32-bit format) of l_op is:
  1484.  
  1485. 00000000000000000000111110110011
  1486.  
  1487. The expression l_op << 3 yields:
  1488.  
  1489. 00000000000000000111110110011000
  1490.  
  1491. The result is the integral part of the quotient of the left operand divided by
  1492. the quantity, 2 raised to the power of the right operand. If the left operand
  1493. has a negative value, the vacated bits of a signed value are filled with a
  1494. copy of the sign bit of the unshifted value. For example, if l_op has the
  1495.  
  1496.                                  - Page 21 -
  1497. 38.    Bitwise left and right shift << >>
  1498.  
  1499. value -25, the bit pattern (in 32-bit format) of l_op is:
  1500.  
  1501. 11111111111111111111111111100111
  1502.  
  1503. Vacated bits are filled with ones, and the expression l_op >> 3 yields:
  1504.  
  1505. 11111111111111111111111111111100
  1506.  
  1507. 39.     Relational < > <= >=
  1508.  
  1509. The relational operators compare two operands for the validity of a
  1510. relationship. If the relationship stated by the operator is true, the value of
  1511. the result is 1 (one). Otherwise, the value of the result is 0 (zero).
  1512.  
  1513. FPL has the following relational operators:
  1514.  
  1515. Operator        Usage
  1516.  
  1517. <       Indicates whether the value of the left operand is less than
  1518.         the value of the right operand.
  1519.  
  1520. >       Indicates whether the value of the left operand is greater than
  1521.         the value of the right operand.
  1522.  
  1523. <=      Indicates whether the value of the left operand is less than or
  1524.         equal to the value of the right operand.
  1525.  
  1526. >=      Indicates whether the value of the left operand is greater than
  1527.         or equal to the value of the right operand.
  1528.  
  1529. Relational operators have also left-to-right associativity. Therefore, the
  1530. expression:
  1531.  
  1532.   a < b <= c
  1533.  
  1534. is interpreted as:
  1535.  
  1536.   (a < b) <= c
  1537.  
  1538. If the value of a is less than the value of b, the first relationship is true
  1539. and yields the value 1 (one).  The value 1 (one) is then compared with the
  1540. value of c.
  1541.  
  1542. 40.     Equality == !=
  1543.  
  1544. The equality operators, like the relational operators, compare two operands
  1545. for the validity of a relationship. The equality operators, however, have a
  1546. lower precedence than the relational operators. If the relationship stated by
  1547. an equality operator is true, the value of the result is 1 (one). Otherwise,
  1548. the value of the result is 0 (zero).
  1549.  
  1550. FPL has the following equality operators:
  1551.  
  1552. Operator        Usage
  1553.  
  1554. ==      Indicates whether the value of the left operand is equal to the
  1555.         value of the right operand.
  1556.  
  1557. !=      Indicates whether the value of the left operand is not equal to
  1558.         the value of the right operand.
  1559.  
  1560. The following expressions contain examples of equality and relational
  1561. operators:
  1562.  
  1563.   time < max_time == status < complete
  1564.   hello != world
  1565.  
  1566.  
  1567.                                  - Page 22 -
  1568. 40.    Bitwise AND &
  1569.  
  1570.  
  1571. 41.     Bitwise AND &
  1572.  
  1573. The & (bitwise AND) operator compares each bit of its first operand to the
  1574. corresponding bit of the second operand. If both bits are 1's, the
  1575. corresponding bit of the result is set to 1. Otherwise, it sets the
  1576. corresponding result bit to 0.
  1577.  
  1578. The following example shows the values of a, b, and the result of a & b
  1579. represented as 32-bit binary numbers:
  1580.  
  1581. bit pattern of a        00000000000000000000000001011100
  1582.  
  1583. bit pattern of b        00000000000000000000000000101110
  1584.  
  1585. bit pattern of a & b    00000000000000000000000000001100
  1586.  
  1587. 42.     Bitwise Exclusive OR ^
  1588.  
  1589. The ^ (bitwise exclusive OR) operator compares each bit of its first operand
  1590. to the corresponding bit of the second operand. If both bits are 1's or both
  1591. bits are 0's, the corresponding bit of the result is set to 0. Otherwise, this
  1592. operator sets the corresponding result bit to 1.
  1593.  
  1594. The following example shows the values of a, b, and the result of a ^ b
  1595. represented as 32-bit binary numbers:
  1596.  
  1597. bit pattern of a        00000000000000000000000001011100
  1598.  
  1599. bit pattern of b        00000000000000000000000000101110
  1600.  
  1601. bit pattern of a^b      00000000000000000000000001110010
  1602.  
  1603. 43.     Bitwise inclusive OR |
  1604.  
  1605. The | (bitwise inclusive OR) operator compares the values (in binary format)
  1606. of each operand and yields a value whose bit pattern shows which bits in
  1607. either of the operands has the value 1 (one). If both of the bits are 0
  1608. (zero), the result of the comparison is 0 (zero); otherwise, the result is 1
  1609. (one).
  1610.  
  1611. The following example shows the values of a, b, and the result of a | b
  1612. represented as 32-bit binary numbers:
  1613.  
  1614. bit pattern of a        00000000000000000000000001011100
  1615.  
  1616. bit pattern of b        00000000000000000000000000101110
  1617.  
  1618. bit pattern of a | b    00000000000000000000000001111110
  1619.  
  1620. 44.     Logical AND &&
  1621.  
  1622.  The && (logical AND) operator indicates whether both operands have a nonzero
  1623. value. If both operands have nonzero values, the result has the value 1 (one).
  1624. Otherwise, the result has the value 0 (zero).
  1625.  
  1626.  The following examples show how the language evaluates expressions that
  1627. contain the logical AND operator:
  1628.  
  1629.  Expression      Result
  1630.  ~~~~~~~~~~      ~~~~~~
  1631.  1 && 0          0
  1632.  
  1633.  1 && 4          1
  1634.  
  1635.  0 && 0          0
  1636.  
  1637.  
  1638.                                  - Page 23 -
  1639. 44.    Logical AND &&
  1640.  
  1641.  
  1642.  Expressions like "a && b" will only evaluate b if a is false!
  1643.  
  1644.  
  1645. NOTE: The logical AND (&&) should not be confused with the bitwise AND (&)
  1646. operator.  For example,
  1647.  
  1648.   1 && 4 evaluates to 1
  1649.  
  1650. while
  1651.  
  1652.   1 & 4 evaluates to 0
  1653.  
  1654. 45.     Logical OR ||
  1655.  
  1656.  The || (logical OR) operator indicates whether either operand has a nonzero
  1657. value. If either operand has a nonzero value, the result has the value 1
  1658. (one). Otherwise, the result has the value 0 (zero).
  1659.  
  1660.  The following examples show how expressions that contain the logical OR
  1661. operator are evaluated:
  1662.  
  1663.  Expression      Result
  1664.  ~~~~~~~~~~      ~~~~~~
  1665.  1 || 0          1
  1666.  
  1667.  1 || 4          1
  1668.  
  1669.  0 || 0          0
  1670.  
  1671.  
  1672. Expressions like "a || b" will only reach b if a is false.
  1673.  
  1674.  
  1675. NOTE: The logical OR (||) should not be confused with the bitwise OR (|)
  1676. operator. For example,
  1677.  
  1678.   1 || 4 evaluates to 1
  1679.  
  1680. while
  1681.  
  1682.   1 | 4 evaluates to 5
  1683.  
  1684. 46.     Conditional expressions
  1685.  
  1686.  
  1687.  (operand1?operand2:operand3)
  1688.  
  1689.  A conditional expression is a compound expression that contains a condition
  1690. (operand1), an expression to be evaluated if the condition has a nonzero value
  1691. (operand2), and an expression to be evaluated if the condition has the value 0
  1692. (zero) (operand3).
  1693.  
  1694.  The conditional expression contains one two-part operator. The ? symbol
  1695. follows the condition, and the : symbol appears between the two action
  1696. expressions. All expressions between the operators ? and : are treated as one
  1697. expression.
  1698.  
  1699.     Examples
  1700.     ~~~~~~~~
  1701.  The following expression determines which variable has the greater value, y
  1702. or z, and assigns the greater value to the variable x:
  1703.  
  1704.       x = (y > z) ? y : z;
  1705.  
  1706.  The following is an equivalent expression:
  1707.  
  1708.  
  1709.                                  - Page 24 -
  1710. 46.    Conditional expressions
  1711.  
  1712.       if (y > z) {
  1713.         x = y;
  1714.       } else {
  1715.         x = z;
  1716.       }
  1717.  
  1718.  The following expression assigns an integer. If the variable c is less than
  1719. zero, output receives the value of c. If not, output receives the return code
  1720. from the search function.
  1721.  
  1722.       c = c<0?c:search("hello");
  1723.  
  1724.  If the last operand of a conditional expression contains an assignment
  1725. operator, use parentheses to ensure the expression evaluates properly. For
  1726. example, the = operator has higher precedence than the ?: operator in the
  1727. following expression:
  1728.  
  1729.       (i == 7) ? j ++ : k = j;
  1730.  
  1731.  This expression generates an error because it is interpreted as if it were
  1732. parenthesized this way:
  1733.  
  1734.       ((i == 7) ? j ++ : k) = j;
  1735.  
  1736.  That is, k is treated as the third operand, not the entire assignment
  1737. expression k = j.  The error arises because a conditional expression is not an
  1738. lvalue, and the assignment is not valid.
  1739.  
  1740.  To make the expression evaluate correctly, enclose the last operand in
  1741. parentheses:
  1742.  
  1743.       (i == 7) ? j ++ : (k = j);
  1744.  
  1745. 47.     Assignment expressions
  1746.  
  1747.  An assignment expression gives a value to the left operand.
  1748.  
  1749.  The left operand in all assignment expressions must be a variable. The value
  1750. of the expression is the value of the left operand after the assignment is
  1751. completed.
  1752.  
  1753.  The language contains two types of assignment operators,  simple assignment
  1754. and  compound assignment  operators.
  1755.  
  1756. 48.     Simple assignment =
  1757.  
  1758.  The simple assignment operator gives the value of the right operand to the
  1759. left operand.
  1760.  
  1761.  The following example assigns in order the value 0 (zero) to strangeness, the
  1762. value of strangeness to charm, the value of charm to beauty, and the value of
  1763. beauty to truth:
  1764.  
  1765.     truth = beauty = charm = strangeness = 0;
  1766.  
  1767. 49.     Compound assignment
  1768.  
  1769.  The compound assignment operators perform an operation on both operands and
  1770. give the result of that operation to the left operand.
  1771.  
  1772.  The following table lists the compound assignment operators and shows an
  1773. expression using each operator:
  1774.  
  1775.  Operator        Example                 Equivalent Expression
  1776.  --------        -------                 ---------------------
  1777.  +=              index   +=  2           index   = index + 2
  1778.  -=              balance -=  debit       balance = balance - debit
  1779.  
  1780.                                  - Page 25 -
  1781. 49.    Compound assignment
  1782.  
  1783.  *=              bonus   *=  increase    bonus   = bonus * increase
  1784.  /=              time    /=  hours       time    = time / hours
  1785.  %=              allow   %=  1000        allow   = allow % 1000
  1786.  <<=             result  <<= num         result  = result << num
  1787.  >>=             form    >>= 1           form    = form >> 1
  1788.  &=              mask    &=  2           mask    = mask &  2
  1789.  ^=              test    ^= pre_test     test    = test ^ pre_test
  1790.  |=              flag    |=  on          flag    = flag | on
  1791.  
  1792.  
  1793.  Although the equivalent expression column shows the left operands (from the
  1794. example column) evaluated twice, the left operand is evaluated only once.
  1795.  
  1796. Note that the expression
  1797.  
  1798.     a *= b + c
  1799.  
  1800. is equivalent to
  1801.  
  1802.     a = a * (b + c)
  1803.  
  1804. and NOT
  1805.  
  1806.     a = a * b + c.
  1807.  
  1808. 50.     Comma expressions
  1809.  
  1810.  A comma expression contains two operands separated by a comma operator.
  1811. Although both operands are evaluated, the value of the right operand is the
  1812. value of the expression. The left operand is evaluated, possibly producing
  1813. side effects, and then the value is discarded.
  1814.  
  1815.  In the following example, if omega has the value 11, the expression
  1816. increments delta and assigns the value 3 to alpha:
  1817.  
  1818.       alpha = (delta++, omega % 4);
  1819.  
  1820.  Any number of expressions separated by commas can form a single expression.
  1821. The leftmost expression is evaluated first. The value of the rightmost
  1822. expression becomes the value of the entire expression. For example, the value
  1823. of the expression
  1824.  
  1825.       intensity++, shade * increment, rotate(direction);
  1826.  
  1827. is the value of the expression
  1828.  
  1829.       rotate(direction);
  1830.  
  1831. Restrictions
  1832.  
  1833.  You can place comma expressions within lists that contain commas (for
  1834. example, argument lists and initializer lists). However, because the comma has
  1835. a special meaning, you must place parentheses around comma expressions in
  1836. these lists. The comma expression t = 3, t + 2 is contained in the following
  1837. function call:
  1838.  
  1839.       f(a, (t = 3, t + 2), c);
  1840.  
  1841. The arguments to the function f are: the value of a, the value 5, and the
  1842. value of c.
  1843.  
  1844. 51.     Keywords
  1845.  
  1846.  FPL supplies a number of keywords that'll help executing the program. (You
  1847. might recognize several of them from the C programming language, but please
  1848. read the descriptions carefully cause some of the keywords behave in a
  1849. slightly different way in FPL.)
  1850.  
  1851.                                  - Page 26 -
  1852. 51.    Keywords
  1853.  
  1854.  
  1855.  These keywords are e.g looping  functions  and conditional checks etc. The
  1856. "arguments" to these keywords are a bit special and tricky, they are therefore
  1857. not included in this table. Refer to keyword reference for proper syntax.
  1858.  
  1859.   Keyword        Short Description
  1860.   --------       -----------
  1861.    auto          No global variable.
  1862.    break         Break out of a number of levels of loop braces.
  1863.    case          Used in switch() statements for a specific case.
  1864.    char          Create a 8-bit signed numerical variable.
  1865.    const         Constant variable.
  1866.    continue      Continue the loop.
  1867.    debug         Control debug mode.
  1868.    default       Specifies default action in a switch() statement.
  1869.    do            do {statement} while (expression);
  1870.    exit          Stop executing this FPL routine.
  1871.    for           for(statement1;statement2;statement3)
  1872.    if            if(condition) {statement} [else {statement}]
  1873.    int           Creates an 32-bit integer variable.
  1874.    long          Equivalent to `int'.
  1875.    register      No global variable.
  1876.    resize        Resize a variable array.
  1877.    return        Return from subroutine.
  1878.    short         Create a 16-bit signed numerical variable.
  1879.    static        Remember local variables between invokes.
  1880.    string        Creates a string variable named [name].
  1881.    switch        Do different actions on different results.
  1882.    typedef       Make declarator aliases.
  1883.    volatile      FPL variables are always volatile.
  1884.    while         while(condition) {statement} [else {statement}]
  1885.  
  1886. These keywords are reserved for FPL use, but do nothing today:
  1887.  
  1888.   'double'     Not implemented.
  1889.   'enum'       Not implemented.
  1890.   'float'      Not implemented.
  1891.   'signed'     ALL variables are always signed.
  1892.   'struct'     Not implemented.
  1893.   'union'      Not implemented.
  1894.   'unsigned'   Not implemented.
  1895.  
  1896. 52.     break
  1897.  
  1898. SYNTAX  break [expression];
  1899.  
  1900. DESCRIPTION
  1901.         A break statement enables you to end iterative (do, for, while,
  1902.         switch statements and exit from them at any point other than the
  1903.         logical end.
  1904.  
  1905.         The break statement ends the loop or switch and moves control to the
  1906.         next statement outside the loop/switch. Within nested statements,
  1907.         break ends only the smallest enclosing do, for, while or switch
  1908.         statement as default.
  1909.  
  1910.         The possible "else" statement after a while, is *NOT* a loop.
  1911.  
  1912.         Specifying a following expression breaks out of a number of iterative
  1913.         statements.
  1914.  
  1915. RESTRICTIONS
  1916.         Place a break statement only in the body of an iterative statement.
  1917.  
  1918. EXAMPLES
  1919.  
  1920.         The following example shows a break statement in the action part of a
  1921.  
  1922.                                  - Page 27 -
  1923. 52.    break
  1924.  
  1925.         for statement. If the i*3 is equal to 9, the break statement causes
  1926.         the for statement to end.
  1927.  
  1928.           for (i = 0; i < 5; i++) {
  1929.             if (i*3 == 9)
  1930.               break;
  1931.             length++;
  1932.           }
  1933.  
  1934.         Break out of a number of loops by giving an argument:
  1935.  
  1936.           for(i = 0; i < 5 ; i++) {
  1937.             for(j = 0; j < 5 ; j++) {
  1938.               if(i*5+j>18) {
  1939.                 break 2; // Breaks out of two `for' loops!
  1940.               }
  1941.             }
  1942.           }
  1943.  
  1944.         Break out of a switch() statement:
  1945.  
  1946.           switch(i) {
  1947.             case 2:
  1948.               break;
  1949.  
  1950.             default:
  1951.           }
  1952.  
  1953. SEE      do ,  for ,  while ,  switch
  1954.  
  1955. 53.     case
  1956.  
  1957. SYNTAX  case expression: statement;
  1958.  
  1959. DESCRIPTION
  1960.         The 'case' statement can only be used within a switch statement. It
  1961.         tells that the following statements should be run if the result of
  1962.         the case expression is the result of the switch expression.
  1963.  
  1964.         The expression must be followed by a colon ':'.
  1965.  
  1966.         Break the case statement with a 'break'. Then the execution will
  1967.         continue after the switch() statement.
  1968.  
  1969. NOTE
  1970.         If the expression contains a colon ':', it must be with parentheses
  1971.         or it can confuse the interpreter under certain conditions.
  1972.  
  1973. EXAMPLE
  1974.         The following program show a switch() statement with three cases:
  1975.  
  1976.           switch( Character() ) {
  1977.             case '\t':
  1978.             case ' ':
  1979.               a = 0;
  1980.               break;
  1981.  
  1982.             case '\n':
  1983.               a = -1;
  1984.               break;
  1985.  
  1986.             default:
  1987.               a = 1;
  1988.               break;
  1989.           }
  1990.  
  1991. SEE ALSO
  1992.  
  1993.                                  - Page 28 -
  1994. 53.    case
  1995.  
  1996.          switch ,  break ,  default
  1997.  
  1998. 54.     char
  1999.  
  2000. SYNTAX  char name [= expression];
  2001.  
  2002. DESCRIPTION
  2003.         Declares a char (signed 8-bit) variable (and assign a value to it).
  2004.         Read more about it the chapter discussing variables. Not assigned
  2005.         variables equals zero (0) after declaration.
  2006.  
  2007. INPUTS  string name     - The variable name.
  2008.         char expression - Initial expression.
  2009.  
  2010. SEE      int
  2011.          short
  2012.          string
  2013.  
  2014. 55.     continue
  2015.  
  2016. SYNTAX  continue;
  2017.  
  2018. DESCRIPTION
  2019.         A continue statement enables you to stop the current iteration of a
  2020.         loop. Program control is passed from the location in the body of the
  2021.         loop where the continue is found, to the condition part of the loop.
  2022.  
  2023.         The continue statement ends the execution of the action part of a do,
  2024.         for, or while statement and moves control to the condition part of
  2025.         the statement. If the iterative statement is a for statement, control
  2026.         moves to the third expression in the condition part of the statement,
  2027.         then to the second expression (the test) in the condition part of the
  2028.         statement.
  2029.  
  2030.         Within nested statements, the continue statement ends only the
  2031.         current iteration of the do, for or while statement immediately
  2032.         enclosing it.
  2033.  
  2034. RESTRICTIONS
  2035.         Place a continue statement only within the body of an iterative
  2036.         statement.
  2037.  
  2038. EXAMPLES
  2039.         The following example shows a continue statement in a for statement.
  2040.         The continue statement causes the system to skip over those elements
  2041.         of the formula that have values less than or equal to 100.
  2042.  
  2043.           output("Try this calculation while <=100.\n");
  2044.           for (i = 0; i < 10000; i++) {
  2045.             if (i*(3-b/c+a) <= 100)
  2046.               continue;
  2047.             output("The number ", i, " makes it no longer below!");
  2048.           }
  2049.  
  2050. SEE      do ,  for ,  while
  2051.  
  2052. 56.     default
  2053.  
  2054. SYNTAX  default: statement;
  2055.  
  2056. DESCRIPTION
  2057.         The 'default' statement can only be used within a switch statement.
  2058.         It tells that the following statements is the default action if no
  2059.         case expressions match the switch expression.
  2060.  
  2061.         The keyword must be followed by a colon ':'.
  2062.  
  2063.  
  2064.                                  - Page 29 -
  2065. 56.    default
  2066.  
  2067.         Break the default statement with a 'break'. Then the execution will
  2068.         continue after the switch() statement.
  2069.  
  2070. EXAMPLE
  2071.         This program executes the 'default' statement if 'x' does not match
  2072.         "foo" or "bar":
  2073.  
  2074.           switch(x) {
  2075.             case "foo":         /* if x is "foo" */
  2076.             case "bar":         /* if x is "bar" */
  2077.               /* nananana */
  2078.               break;            /* break out of switch */
  2079.  
  2080.             default:
  2081.               foobar();         /* if x isn't "foo" or "bar" */
  2082.               break;
  2083.           }
  2084.  
  2085. SEE ALSO
  2086.          switch ,  break ,  case
  2087.  
  2088. 57.     do
  2089.  
  2090. SYNTAX  do statement; while ( expression ) ;
  2091.  
  2092. DESCRIPTION
  2093.         A do statement repeatedly executes a statement until a test
  2094.         expression evaluates to 0 (zero). Because of this order of
  2095.         processing, the statement is processed at least once.
  2096.  
  2097.         The body of the loop is run before the controlling while clause is
  2098.         evaluated. Further processing of the do statement depends on the
  2099.         value of the while clause. If the while clause does not evaluate to
  2100.         0 (zero), the statement runs again. Otherwise, processing of the
  2101.         statement ends.
  2102.  
  2103.         A break or return statement can cause the processing of a do
  2104.         statement to end, even when the while clause does not evaluate to 0
  2105.         (zero).
  2106.  
  2107. EXAMPLES
  2108.         The following statement prompts the system user to enter a 1. If the
  2109.         system user enters a 1, the statement ends execution.  If not, the
  2110.         statement displays another prompt.
  2111.  
  2112.           do {
  2113.             input("Enter a 1!", reply);
  2114.           } while (reply != 1);
  2115.  
  2116. SEE      break ,  continue ,  return
  2117.  
  2118. 58.     debugáááá
  2119.  
  2120. SYNTAX  int debug ( Enable );                                   (V9)
  2121.  
  2122. DESCRIPTION
  2123.          Toggles the "debug mode" state. When FPL runs in the "debug mode",
  2124.         the debugger is capable of tracing the FPL executions.
  2125.  
  2126.          If called without parameter, it will return the current "debug mode"
  2127.         status.
  2128.  
  2129. NOTE
  2130.         The FPL debugger is not extensively used, developed or spread. Much
  2131.         more documentation regarding this function and FPL debugging concepts
  2132.         and procedures will appear in future versions of this document.
  2133.  
  2134.  
  2135.                                  - Page 30 -
  2136. 58.    debugáááá
  2137.  
  2138. INPUTS
  2139.         int Enable      - Zero to disable, non-zero to enable.
  2140.  
  2141. RETURNS
  2142.         It returns the "debug mode" state that was when the function was
  2143.         called. That is, if you enable debug mode, it will return the state
  2144.         previous to this function call.
  2145.  
  2146. SEE
  2147.  
  2148. 59.     else
  2149.  
  2150. SYNTAX  <special>
  2151.  
  2152. DESCRIPTION
  2153.         Used after condition checks to make FPL execute certain parts of the
  2154.         program if the previous check did not evaluate true.
  2155.  
  2156.         It always belongs to the last `if'/`while' in this block.
  2157.  
  2158. EXAMPLES
  2159.         It can be used in simple one time checks like:
  2160.  
  2161.           if(a!=2)
  2162.             break;
  2163.           else
  2164.             output("hello");  /* only executed if variable a equals 2 */
  2165.  
  2166.         and even if a while loop never is executed:
  2167.  
  2168.           while(a--)
  2169.             output(a);
  2170.           else
  2171.             output("hello"); // only executed if the while condition never
  2172.                              // was true.
  2173.  
  2174.         Take a look at the two examples below and note the difference!
  2175.  
  2176.         1. If both "a" and "b" are true, then invoke "build_new_things". if
  2177.            "a" is false, invoke "crash_mostofit":
  2178.  
  2179.           if(a) { // braces are required if we want the `else' to affect this
  2180.             if(b)
  2181.               build_new_things();
  2182.           } else
  2183.             crash_mostofit();
  2184.  
  2185.         2. If "a" and "b" are true, then invoke "build_new_things". If "a" is
  2186.            true and "b" is false, invoke "crash_mostofit":
  2187.  
  2188.           if(a) // without braces, the else suddenly affects the other if!
  2189.             if(b)
  2190.               build_new_things();
  2191.             else
  2192.               crash_mostofit();
  2193.  
  2194. 60.     exit
  2195.  
  2196. SYNTAX  exit( return_code );
  2197.  
  2198. DESCRIPTION
  2199.         Stop execution of the current FPL routine.
  2200.  
  2201. INPUTS  int/string return_code  - Return code to return to the calling
  2202.                                   process.
  2203.  
  2204.         See the documentation for the software you're controlling for the
  2205.  
  2206.                                  - Page 31 -
  2207. 60.    exit
  2208.  
  2209.         exact meaning of these return codes. The return code can be excluded
  2210.         as well as the parenthesis can when returning a value.
  2211.  
  2212. RETURNS
  2213.         A result code to the invoking environment.
  2214.  
  2215. SEE ALSO
  2216.          return
  2217.  
  2218. 61.     export
  2219.  
  2220. SYNTAX  export [ global declaration ];
  2221.  
  2222. DESCRIPTION
  2223.         Make the following global symbol available to all programs.
  2224.  
  2225. EXAMPLES
  2226.         The following statements make the function "foobar" and the string
  2227.         variable "String" accessiable to all other FPL programs that will
  2228.         succeed this program:
  2229.  
  2230.           export string String;
  2231.           export int foobar(int);
  2232.           /* the actual function foobar must reside in the same source file */
  2233.  
  2234. 62.     for
  2235.  
  2236. SYNTAX  for ([expression1] ; [expression2] ; [expression3]) statement;
  2237.  
  2238. DESCRIPTION
  2239.         Expression1
  2240.           is evaluated only before the statement is processed for the first
  2241.           time. You can use this expression to initialize a variable. If you
  2242.           do not want to evaluate an expression prior to the first iteration
  2243.           of the statement, you can omit this expression.
  2244.  
  2245.         Expression2
  2246.           is evaluated before each iteration of the statement. The expression
  2247.           must evaluate to a scalar type. If it evaluates to 0 (zero), the
  2248.           statement is not processed and control moves to the next statement
  2249.           following the for statement. If expression2 does not evaluate to 0,
  2250.           the statement is processed. If you omit expression2, it is as if
  2251.           the expression had been replaced by a nonzero constant and the for
  2252.           statement is not terminated by failure of this condition.
  2253.  
  2254.         Expression3
  2255.           is evaluated after each iteration of the statement. You can use
  2256.           this expression to increase, decrease, or reinitialize a variable.
  2257.           If you do not want to evaluate an expression after each iteration
  2258.           of the statement, you can omit this expression.
  2259.  
  2260.         A break or return statement can cause the processing of a for
  2261.         statement to end, even when the second expression does not evaluate
  2262.         to 0 (zero). If you omit expression2, you must use a break or a
  2263.         return statement to stop the the for statement from running.
  2264.  
  2265. EXAMPLES
  2266.  
  2267.         The following for statement prints the value of count 20 times. The
  2268.         for statement initially sets the value of count to 1. After each
  2269.         iteration of the statement, count is incremented.
  2270.  
  2271.           for (count = 1; count <= 20; count++) {
  2272.             output("count =", count);
  2273.           }
  2274.  
  2275.         The following sequence of statements accomplishes the same task. Note
  2276.  
  2277.                                  - Page 32 -
  2278. 62.    for
  2279.  
  2280.         the use of the while statement instead of the for statement.
  2281.  
  2282.           count = 1;
  2283.           while (count <= 20) {
  2284.             output("count = ", count);
  2285.             count++;
  2286.           }
  2287.  
  2288.         The following for statement does not contain an initialization
  2289.         expression.
  2290.  
  2291.           for (; index > 10; index--) {
  2292.             list= var1 + index;
  2293.             output("list = ", list, "\n");
  2294.           }
  2295.  
  2296.         The following for statement continues running until input receives
  2297.         the letter e:
  2298.  
  2299.           for (;;) {
  2300.             input("Gimme an e!", letter);
  2301.             if (!strcmp(letter, "\n"))
  2302.               continue;
  2303.             else if (!strcmp(letter, "e"))
  2304.               break;
  2305.             output("You entered the letter", letter);
  2306.           }
  2307.  
  2308.         The following for statement contains multipart initializations and
  2309.         increments.  The comma operator makes this construction possible.
  2310.  
  2311.           for (i = 0, j = 50; i < 10; i++, j += 50) {
  2312.             output("i = ", i, " and j = ", j);
  2313.           }
  2314.  
  2315.         The following example shows a nested for statement. The outer
  2316.         statement is run as long as the value of row is less than 5. Each
  2317.         time the outer for statement is processed, the inner for statement
  2318.         sets the initial value of column to zero and the statement of the
  2319.         inner for statement is run three times. The inner statement is run
  2320.         as long as the value of column is less than 3.
  2321.  
  2322.           for (row = 0; row < 5; row++) {
  2323.             for (column = 0; column < 3; column++)
  2324.               output("column * row =", row * column, "\n");
  2325.  
  2326.         A never-ending loop using `for':
  2327.  
  2328.           for(;;)
  2329.             perform_until_death();
  2330.  
  2331. SEE      break , continue, do, while
  2332.  
  2333. 63.     if
  2334.  
  2335. SYNTAX  if ( expression ) statement; [ else  statement;  ]
  2336.  
  2337. DESCRIPTION
  2338.         An if statement allows you to conditionally process a statement if
  2339.         the specified test expression evaluates to a nonzero value. You can
  2340.         optionally specify an else clause on the if statement. If the test
  2341.         expression evaluates to 0 (zero), and an else clause exists, the
  2342.         statement in the else clause is run. If the test expression evaluates
  2343.         to a nonzero value, the statement following the expression runs and
  2344.         the else clause is ignored.
  2345.  
  2346.         When if statements are nested and else clauses are present, a given
  2347.  
  2348.                                  - Page 33 -
  2349. 63.    if
  2350.  
  2351.         else is associated with the closest preceding if statement within the
  2352.         same block.
  2353.  
  2354. EXAMPLES
  2355.         The following example causes grade to receive the value A if the
  2356.         value of score is greater than or equal to 90.
  2357.  
  2358.           if (score >= 90)
  2359.             grade = A;
  2360.  
  2361.         The following example displays number is positive if the value of
  2362.         number is greater or equal to 0 (zero). Otherwise, the example
  2363.         displays number is negative.
  2364.  
  2365.           if (number >= 0)
  2366.             output("number is positive\n");
  2367.           else
  2368.             output("number is negative\n");
  2369.  
  2370.  
  2371.         The following example shows a nested if statement:
  2372.  
  2373.           if (paygrade == 7)
  2374.             if (level >= 0 && level <= 8)
  2375.               salary *= 2;
  2376.             else
  2377.               salary *= 3;
  2378.           else
  2379.              salary *= 4;
  2380.  
  2381.  
  2382.         The following example shows an if statement that does not have an
  2383.         else clause.
  2384.  
  2385.           if (gallons > 0) {
  2386.             if (miles > gallons)
  2387.               mpg = miles/gallons;
  2388.           } else
  2389.             mpg = 0;
  2390.  
  2391.  
  2392.         The following example shows an if statement nested within an else
  2393.         clause. This example tests multiple conditions.  The tests are made
  2394.         in order of their appearance. If one test evaluates to a nonzero
  2395.         value, an action statement runs and the entire if statement ends.
  2396.  
  2397.           if (value > 0)
  2398.              increase++;
  2399.           else if (value == 0)
  2400.              breaeven++;
  2401.           else
  2402.              ++decrease;
  2403.  
  2404. 64.     int
  2405.  
  2406. SYNTAX  int name [= expression];
  2407.  
  2408.           or
  2409.  
  2410.         long name [= expression];
  2411.  
  2412. DESCRIPTION
  2413.         Declare an integer (signed 32-bit) variable and assign a value to it.
  2414.         Read more about it the chapter discussing variables. Not assigned
  2415.         variables equals zero (0) after declaration.
  2416.  
  2417.         ANSI C specifies that `long' should be a 32-bit number and `int' is
  2418.  
  2419.                                  - Page 34 -
  2420. 64.    int
  2421.  
  2422.         more vague. The MC680x0 processor series has - as all decent
  2423.         processors have - 32-bit integers, which make them the exact same
  2424.         data type. FPL is mostly run on such processors making this
  2425.         equivalence natural.
  2426.  
  2427. INPUTS  string name             - The variable name.
  2428.         int/long expression     - Initial expression.
  2429.  
  2430. SEE      string ,  char   ,  short
  2431.  
  2432. 65.     resize
  2433.  
  2434. SYNTAX  resize name [ new_size ] ;
  2435.  
  2436. DESCRIPTION
  2437.         A common problem when using arrays is that you don't know the size of
  2438.         it already from the start. This keyword brings a solution to that
  2439.         problem. This one resizes the named array to the new size you specify
  2440.         inside the square brackets. Notice that it's also possible to reduce
  2441.         the size, so be careful not to destroy data you like to reuse.
  2442.  
  2443.         WARNING: Using multi dimensional arrays and `resize' is a dangerous
  2444.         combination. E.g when changing an array from "[4][5]" to "[5][5]",
  2445.         the old values will not any longer be readable in their old array
  2446.         members. A resize of this kind makes the data move around a bit
  2447.         depending on the internal data array storage. DO NOT USE `resize' IN
  2448.         MULTI DIMENSIONAL ARRAYS IF YOU WANT THE DATA TO STAY INTACT!
  2449.  
  2450. INPUTS
  2451.         name            - The name of the array you'd like to resize.
  2452.         new_size        - The new size of the array.
  2453.  
  2454. EXAMPLES
  2455.         To make a list of all the names the user enters, you need an array as
  2456.         big as the user pleases. But declaring an enormous size from the
  2457.         start really isn't to recommend. This example shows one way to solve
  2458.         such a problem:
  2459.  
  2460.           int roof=10, num;
  2461.           string names[roof];
  2462.           do {
  2463.             if(num==roof)
  2464.               resize names[roof+=10];
  2465.             names[num]=input("Insert name number " num ":");
  2466.           } while(names[num++]!="");
  2467.  
  2468.  
  2469.         Multi dimensional arrays looses their proper values when resizing, do
  2470.         copy the array to preserve to contents:
  2471.  
  2472.           int a[DIM1][DIM2];       // This is the old array construction
  2473.           {
  2474.             /* This could with benefit be written into a function to be
  2475.                called from several instances */
  2476.  
  2477.             int n1, n2;              // counter variables
  2478.             int b[NEWDIM1][NEWDIM2]; // The temporary new array outfit!
  2479.  
  2480.             for(n1=0; n1<DIM1 && n1<NEWDIM1; n1++)   // temporary store all
  2481.               for(n2=0; n2<DIM2 && n2<NEWDIM2; n2++) // vital data in array b
  2482.                 b[n1][n2]=a[n1][n2];
  2483.  
  2484.             resize a[NEWDIM1][NEWDIM2]; // resize a
  2485.  
  2486.             for(n1=0; n1<NEWDIM1; n1++)   // restore all data to array a
  2487.               for(n2=0; n2<NEWDIM2; n2++)
  2488.                 a[n1][n2]=b[n1][n2];
  2489.  
  2490.                                  - Page 35 -
  2491. 65.    resize
  2492.  
  2493.           }
  2494.  
  2495. 66.     return
  2496.  
  2497. SYNTAX  return [ return_code ];
  2498.  
  2499. DESCRIPTION
  2500.         A return statement ends the execution of the current function and
  2501.         returns a return code and control to the caller of it. The return
  2502.         code is written exact as in C, within parentheses or not. It can
  2503.         also be totally excluded.
  2504.  
  2505. EXAMPLES
  2506.         We use a function to print the result of the formula, but only if
  2507.         the result is even:
  2508.  
  2509.           int n;
  2510.           int print(int);
  2511.           for(n=0; n<10; n++)
  2512.             n+=printf(n*n);
  2513.           exit;
  2514.  
  2515.           int print(int a)
  2516.           {
  2517.             if(!(a&1))
  2518.               output(a);
  2519.              return(a&2);  /* Get back to the for loop */
  2520.           }
  2521.  
  2522. SEE      exit ,  break
  2523.  
  2524. 67.     short
  2525.  
  2526. SYNTAX  short name [= expression];
  2527.  
  2528. DESCRIPTION
  2529.         Declares a short (signed 16-bit) variable (and assign a value to it).
  2530.         Read more about it the chapter discussing variables. Not assigned
  2531.         variables equals zero (0) after declaration.
  2532.  
  2533. INPUTS  string name        - The variable name.
  2534.         short expression   - Initial expression.
  2535.  
  2536. SEE      int
  2537.          char
  2538.          string
  2539.  
  2540. 68.     string
  2541.  
  2542. SYNTAX  string varname [= str_expr];
  2543.  
  2544.           or
  2545.  
  2546.         string funcname ( [arg1] [, arg2] [...] );
  2547.  
  2548. DESCRIPTION
  2549.         Declare a string variable and assign contents to it or declare a
  2550.         function returning a string.
  2551.  
  2552.         For function declaration, see  functions ;
  2553.  
  2554. INPUTS  string varname  - Name of the variable
  2555.         string str_expr - Initial string assign.
  2556.  
  2557.           or
  2558.  
  2559.         string
  2560.  
  2561.                                  - Page 36 -
  2562. 68.    string
  2563.  
  2564.  
  2565.  
  2566. SEE      int
  2567.  
  2568. 69.     typedef
  2569.  
  2570. SYNTAX  typedef <declarator> <symbol>;
  2571.  
  2572. DESCRIPTION
  2573.         `typedef' allows you to define your own identifiers that can be used
  2574.         in place of FPL type specifiers such as int, string and char. The
  2575.         data types you define using `typedef' are not new data types; they
  2576.         are synonyms for the primary data types used by FPL.
  2577.  
  2578. EXAMPLES
  2579.         This example creates a synonym for int and then use that to declare
  2580.         three integral variables:
  2581.  
  2582.                 typedef int LENGTH;     /* new declarator named `LENGTH' */
  2583.                 LENGTH length, width, height;
  2584.  
  2585. 70.     switch
  2586.  
  2587. SYNTAX  switch ( expression ) { [case expression:] [default:expression] }
  2588.  
  2589. DESCRIPTION
  2590.         A switch statement lets you define actions to different results of
  2591.         the switch expression.
  2592.  
  2593.         The result of the expression written within the parentheses following
  2594.         the switch keyword is matched against the expressions following the
  2595.         ' case ' keywords within the braces. If no match is found the action
  2596.         specified after ' default ' will be run. If no 'default' is defined
  2597.         either, nothing will happen.
  2598.  
  2599.         The switch expression may be either a string or numerical expression.
  2600.         The expressions in the following case statements have to be of the
  2601.         same expression type as the initial one, or FPL will report error.
  2602.  
  2603.         Multiple cases may be specified with the same expression, but only
  2604.         the first one that match the switch expression will be run.
  2605.  
  2606.         A case statement is aborted by a  break  statement or the brace
  2607.         ending the switch statement.
  2608.  
  2609. NOTE
  2610.         Unlike C, FPL handles dynamic expressions in case-statements very
  2611.         well!
  2612.  
  2613.         The case statements will be parsed/scanned from the top to bottom.
  2614.         For speed reasons, you should put the case-statements that most
  2615.         likely occurs at the top and the least likely case-statements at
  2616.         the bottom.
  2617.  
  2618. EXAMPLES
  2619.  
  2620.         In the following program is the result from the equation x+5
  2621.         controlling what text to assign to 'output':
  2622.  
  2623.           int check = x + 5;
  2624.           string output;
  2625.           switch( check ) {
  2626.             case 5:     /* notice the colon that follows the expression */
  2627.               output = "x was zero";
  2628.               break;    /* escape from switch! */
  2629.  
  2630.             case 4:
  2631.  
  2632.                                  - Page 37 -
  2633. 70.    switch
  2634.  
  2635.               break;    /* do nothing */
  2636.  
  2637.             case 7:
  2638.               /* fall through! */
  2639.  
  2640.             case 8:
  2641.               output = "x was two or three";
  2642.               break;
  2643.  
  2644.             default:
  2645.               output = "x was not from -1 to 3";
  2646.           }   /* breaks out of 'default' */
  2647.  
  2648.         In the following program is the contents of the variable 'username'
  2649.         controlling which function to invoke:
  2650.  
  2651.           string username = getname();  /* get user name */
  2652.           switch(username) {
  2653.             case "superuser":
  2654.               GetSuperUser();
  2655.               break;
  2656.  
  2657.             case "normal":
  2658.               GetNormalUser();
  2659.               break;
  2660.  
  2661.             case "unworthy":
  2662.               GetUnworthUser();
  2663.               break;
  2664.           }
  2665.  
  2666. 71.     while
  2667.  
  2668. SYNTAX  while ( expression )  statement ; [  else  statement; ]
  2669.  
  2670. DESCRIPTION
  2671.         A while statement enables you to repeatedly run the body of a loop
  2672.         until the controlling expression is no longer met or evaluates to 0
  2673.         (zero.)
  2674.  
  2675.         The expression is evaluated to determine whether or not the body of
  2676.         the loop should be run. If the expression evaluates to 0 (zero), the
  2677.         body of the loop never runs. If not, the body is processed. After the
  2678.         body has run, control passes back to the expression. Further
  2679.         processing depends on the value of the condition.
  2680.  
  2681.         When coding in 'C', I've always missed the "while else" function. FPL
  2682.         includes that feature! If the test expression evaluates to false
  2683.         (zero) the FIRST TIME it's evaluated, and an "else" clause exists,
  2684.         the statement in the "else" clause is run. If the test expression
  2685.         evaluates to a nonzero value, the statement following the expression
  2686.         runs and the "else" clause is ignored.
  2687.  
  2688.         A break or return statement can cause the processing of a while
  2689.         statement to end, even when the condition does not evaluate to 0
  2690.         (zero).
  2691.  
  2692.         NOTE: The else clause is *NOT* a loop. "break" is not a valid move to
  2693.         break out of such.
  2694.  
  2695. EXAMPLES
  2696.  
  2697.         In the following program, item triples each time the value of the
  2698.         expression index++ is less than MAX_INDEX. When index++ evaluates to
  2699.         MAX_INDEX, the while statement ends.
  2700.  
  2701.           while (index < MAX_INDEX) {
  2702.  
  2703.                                  - Page 38 -
  2704. 71.    while
  2705.  
  2706.             item *= 3;
  2707.             output("item = ", item, "\n");
  2708.             index++;
  2709.           }
  2710.  
  2711.         The following program first checks if a<0 and if it is, increases a
  2712.         with 100 until it isn't any longer less than zero. If not, it'll
  2713.         output a message saying so.
  2714.  
  2715.           while(a<0)
  2716.             a+=100;
  2717.           else
  2718.             output("a was never below 0\n");
  2719.  
  2720.  
  2721. SEE      break ,  return
  2722.  
  2723. 72.     Functions
  2724.  
  2725.   These are the internal functions supplied from the start by FPL:
  2726.  
  2727.   Function          Argument(s)     Short Description
  2728.   --------          -----------     -----------------
  2729.  
  2730.    abs              int           Absolute value of integer operand.
  2731.    atoi             str           Convert a string to an integer.
  2732.    eval             str           Calculate a string.
  2733.    interpret        str           Interpret string as program.
  2734.    itoa             int           Convert an integer to string.
  2735.    itoc             int           Convert an integer to ASCII.
  2736.    joinstr          str, ...      Joins strings!
  2737.    ltostr           n1, n2        Convert an integer to string.
  2738.    sprintf                        Formatted print to a string.
  2739.    strcmp           str1, str2    Compare two strings.
  2740.    stricmp          str1, str2    Compare two strings. CI(*)
  2741.    strlen           str]          String length.
  2742.    strncmp          str1, str2, n Compare two strings a certain length.
  2743.    strnicmp         str1, str2, n Compare two strings a certain length. CI(*)
  2744.    strstr           str1, str2    Find substring str1 in string str2.
  2745.    stristr          str1, str2    Find substring str1 in string str2. CI(*)
  2746.    strtol           str, base     Convert string to integer.
  2747.    substr           s1, len, col  Get part of string.
  2748.  
  2749.  [Amiga only:]
  2750.  
  2751.    openlib          lib, ver        Open funclib.
  2752.    closelib         lib             Close funclib.
  2753.  
  2754. (*) = Case insensitive. It doesn't make any difference to 'A' or 'a'.
  2755.       It does only apply to ASCII characters; that is only a-z and A-Z.
  2756.  
  2757. 73.     abs
  2758.  
  2759. SYNTAX  int abs( Int );
  2760.  
  2761. DESCRIPTION
  2762.         Returns the absolute value of the input integer.
  2763.  
  2764. INPUTS  int Int;
  2765.  
  2766. RETURNS see description.
  2767.  
  2768. 74.     atoi
  2769.  
  2770. SYNTAX  int atoi( String );
  2771.  
  2772. DESCRIPTION
  2773.  
  2774.                                  - Page 39 -
  2775. 74.    atoi
  2776.  
  2777.         The atoi keyword returns an integer whose value is represented by the
  2778.         character string pointed to by the String parameter. atoi scans the
  2779.         string up to the first character that is inconsistent. Leading
  2780.         white-space characters are ignored, and an optional sign may precede
  2781.         the digits.
  2782.  
  2783. INPUTS  string String;
  2784.  
  2785. RETURNS
  2786.         Upon successful completion, atoi returns the converted value. If no
  2787.         conversion could be performed, 0 (zero) is returned. If the correct
  2788.         value is outside the range of representable values, maximum or
  2789.         minimum value is returned according to the sign of the value.
  2790.  
  2791. 75.     closelib
  2792.  
  2793. SYNTAX  int closelib( Name );
  2794.  
  2795. DESCRIPTION
  2796.          Closes a specified  funclib . Funclibs are third
  2797.         party programs that add functions to the FPL session. The funclibs
  2798.         should be stored in FPLLIBS:.
  2799.  
  2800.          A closelib() concludes access to the functions of the specified
  2801.         funclib. Each call to  openlib()  should have a matching call to
  2802.         closelib().
  2803.  
  2804.          For information regarding specified funclibs, refer to the manual of
  2805.         the particular funclib.
  2806.  
  2807. INPUTS
  2808.         string Name     - The name of the funclib.
  2809.  
  2810. RETURNS
  2811.         It return 0 on success. Otherwise see 'openlib' for closer
  2812.         description.
  2813.  
  2814. SEE      openlib  and the  funclibs  section.
  2815.  
  2816. 76.     eval
  2817.  
  2818. SYNTAX  int eval( String );
  2819.  
  2820. DESCRIPTION
  2821.         The mathematical expression in String is evaluated and returned.
  2822.         strcal handles all variables declared before this point of the
  2823.         execution.
  2824.         An error in the expression will unfortunately return 0 which will
  2825.         look like the result of the expression.
  2826.  
  2827. INPUTS  string String   - A string including a valid numerical expression.
  2828.  
  2829. RETURNS
  2830.         The result of the mathematical expression in String or 0 if there was
  2831.         any error in the expression.
  2832.  
  2833. 77.     interpret
  2834.  
  2835. SYNTAX  int interpret( String );                        (V3)
  2836.  
  2837. DESCRIPTION
  2838.         Interpret the argument as if it is a continuation of the program.
  2839.         The argument must be a 100% corect FPL program statement. All
  2840.         variables and functions usable in the program at this point, will be
  2841.         usable in the argument-statement too.
  2842.  
  2843.         Any error in this function will get reported at the position right
  2844.  
  2845.                                  - Page 40 -
  2846. 77.    interpret
  2847.  
  2848.         after the function call.
  2849.  
  2850. INPUTS  string String   - FPL statement
  2851.  
  2852. RETURNS
  2853.         At this moment: always zero. But do not depend upon that since it
  2854.         might get changed in the future.
  2855.  
  2856. EXAMPLE
  2857.         This example calls a function via the interpret() function:
  2858.  
  2859.                 int foobar(int);
  2860.                 interpret("foobar(2);");
  2861.                 exit;
  2862.  
  2863.                 int foobar(int b)
  2864.                 {
  2865.                   output(b);
  2866.                 }
  2867.  
  2868.         We can create a function that accepts a function name as parameter
  2869.         and then is able to call that named function:
  2870.  
  2871.                 int foobar(int);
  2872.                 int foo(int);
  2873.                 int bar(int);
  2874.                 int call(string, int);
  2875.  
  2876.                 call("foobar", 1);
  2877.                 call("foo", 2);
  2878.                 call("bar", 3);
  2879.                 exit;
  2880.  
  2881.                 int call(string command, int parameter)
  2882.                 {
  2883.                   int ret;      /* declare return code variable */
  2884.                   string statement=joinstr("ret=", command, "(",
  2885.                                            ltostr(parameter), ");");
  2886.  
  2887.                   output(statement);    /* output the statement */
  2888.                   interpret(statement); /* interpret it */
  2889.                   /*
  2890.                    * At this point `ret' has got the return code
  2891.                    * of the called function.
  2892.                    */
  2893.                   return(ret);
  2894.                 }
  2895.  
  2896.                 /*
  2897.                  * Here should the definitions of the functions
  2898.                  * "foobar", "foo" and "bar" be programmed.
  2899.                  */
  2900.  
  2901. SEE      eval
  2902.  
  2903. 78.     itoa
  2904.  
  2905. SYNTAX  string itoa( Integer );
  2906.  
  2907. DESCRIPTION
  2908.         The itoa function converts the integer given as argument to a string
  2909.         and returns it. The convertion will use base 10, which creates a
  2910.         decimal number.
  2911.  
  2912. INPUTS
  2913.         int Integer     - Number to be converted.
  2914.  
  2915.  
  2916.                                  - Page 41 -
  2917. 78.    itoa
  2918.  
  2919. RETURNS
  2920.           Upon successful completion, the function returns the converted
  2921.         string. If no conversion could be performed, the returned string is
  2922.         zero-length.
  2923.  
  2924. EXAMPLES
  2925.         Convert the number the variable 'num' holds, to a string:
  2926.  
  2927.           string result= itoa(num);
  2928.  
  2929. SEE      ltostr
  2930.  
  2931. 79.     itoc
  2932.  
  2933. SYNTAX  string itoc( Integer );
  2934.  
  2935. DESCRIPTION
  2936.           The itoc function returns the character with the ASCII code
  2937.         given as argument. Any argument number higher than 255 will be ANDed
  2938.         with 255 internally.
  2939.  
  2940. INPUTS
  2941.         int Integer     - ASCII code of the desired character.
  2942.  
  2943. RETURNS
  2944.           Upon successful completion, the function returns the character
  2945.         as a string.
  2946.  
  2947. EXAMPLES
  2948.         To get the character with ASCII number 137:
  2949.  
  2950.           string result= itoc( 137 );
  2951.  
  2952. SEE      itoa
  2953.  
  2954. 80.     joinstr
  2955.  
  2956. SYNTAX  string joinstr( String, ... );
  2957.  
  2958. DESCRIPTION
  2959.           This function lets you specify any amount of strings, and returns
  2960.         them all as one concatenated single string.
  2961.  
  2962. INPUT   string String   - Strings to be merged.
  2963.  
  2964. RETURNS
  2965.           A string holding all joined strings.
  2966.  
  2967. EXAMPLES
  2968.         Merge three strings into one:
  2969.  
  2970.           string a="one ", c="two ", b="three", d;
  2971.           d=joinstr(a, b, c); /* 'd' now holds "one two three" */
  2972.  
  2973. 81.     ltostr
  2974.  
  2975. SYNTAX  string ltostr( Integer, Base );
  2976.  
  2977. DESCRIPTION
  2978.           The ltostr subroutine returns a string which is the first parameter
  2979.         converted using the second parameter as base.
  2980.  
  2981.           If the Base parameter is positive and not greater than 36, then it
  2982.         is used as the base for conversion.
  2983.  
  2984. INPUTS
  2985.         int Integer     - Number to be converted.
  2986.  
  2987.                                  - Page 42 -
  2988. 81.    ltostr
  2989.  
  2990.         int Base        - Specifies the base to use for the conversion.
  2991.  
  2992. RETURNS
  2993.           Upon successful completion, the ltostr subroutine return the
  2994.         converted string. If no conversion could be performed, the returned
  2995.         string is zero-length.
  2996.  
  2997. EXAMPLES
  2998.         Convert the number 1993 to hexadecimal:
  2999.  
  3000.           string result= ltostr(1993, 16);
  3001.  
  3002. SEE      strtol
  3003.  
  3004. 82.     openlib
  3005.  
  3006. SYNTAX  int openlib( Name, Version );
  3007.  
  3008. DESCRIPTION
  3009.          Opens a specified  funclib . Funclibs are third
  3010.         party programs that add functions to the FPL session. The funclibs
  3011.         should be stored in FPLLIBS:.
  3012.  
  3013.          An openlib() gains access to the functions of the specified funclib.
  3014.         After finished using the functions of that funclib, the session
  3015. should
  3016.         be concluded with a call to  closelib() . Each
  3017.         call to openlib() should have a matching call to closelib().
  3018.  
  3019.          For information regarding specified funclibs, refer to the manual of
  3020.         the particular funclib.
  3021.  
  3022. INPUTS
  3023.         string Name     - The name of the funclib.
  3024.         int Version     - The lowest acceptable version of the funclib.
  3025.  
  3026. RETURNS
  3027.         It return 0 on success. Otherwise a non-zero number where the numbers
  3028.         have the following meaning:
  3029.         1 - funclib parameter error
  3030.         2 - internal funclib error
  3031.         3 - failed getting a system resource
  3032.         4 - out of memory error
  3033.         5 - failed loading the funclib (occurs if you open a non-existant
  3034.             funclib).
  3035.         6 - the requested version didn't exist
  3036.         More error codes are likely to be added within short.
  3037.  
  3038. SEE      closelib  and the  funclibs  section.
  3039.  
  3040. 83.     sprintf
  3041.  
  3042. SYNTAX  string sprintf (format, arg1, arg2, ...);
  3043.  
  3044. DESCRIPTION
  3045.  
  3046.         This function produces a string of ASCII characters.
  3047.  
  3048.         The format argument holds a string that contains ordinary
  3049.         characters and conversion specifications that indicate how you
  3050.         want the arguments arg1, arg2, and so on to be printed. The
  3051.         ordinary characters are copied to the result string, but the
  3052.         conversion specifications are replaced with the correctly formatted
  3053.         values of the arguments arg1, arg2, and so on. The first conversion
  3054.         specification is replaced with the formatted value of arg1, the
  3055.         second specification is replaced with the value of arg2, and so
  3056.         on. In some cases, as described below, a conversion specification
  3057.  
  3058.                                  - Page 43 -
  3059. 83.    sprintf
  3060.  
  3061.         may process more than one argument.
  3062.  
  3063.         Each conversion specification must begin with a percent character
  3064.         (%). To place an ordinary percent into the output stream, precede
  3065.         it with another percent in the fmt string. That is, %% will send
  3066.         a single percent character to the output stream. A specification
  3067.         has the following format:
  3068.  
  3069.             %[arg][flags][width][.precision][size]type
  3070.  
  3071.         The brackets ([]) indicate optional fields.  Each field is defined
  3072.         as follows:
  3073.  
  3074.             arg
  3075.                 FPL supports the argument number selection style $<arg>.
  3076.                 When an argument number has been given, that specified
  3077.                 argument will be used instead of the next one in turn.
  3078.                 I.e "%$2d" will produce a formatted integer found as the
  3079.                 second argument. You should *not* mix specified arugment
  3080.                 numbers with %-codes with unspecified arugment numbers.
  3081.  
  3082.             flags
  3083.                 controls output justification and the printing of signs,
  3084.                 blanks, decimal places, and hexadecimal prefixes.
  3085.  
  3086.                 If any flag characters are used, they must appear after
  3087.                 the percent.  Valid flags are as follows:
  3088.  
  3089.                 - (minus)
  3090.                     causes the result to be left-justified within the
  3091.                     field specified by width or within the default width.
  3092.  
  3093.                 + (plus)
  3094.                     causes a plus or minus sign to be placed before the
  3095.                     result.  This flag is used in conjunction with the
  3096.                     various numeric conversion types.  If it is absent,
  3097.                     the sign character is generated only for a negative
  3098.                     number.
  3099.  
  3100.                 blank
  3101.                     causes a leading blank for a positive number and a
  3102.                     minus sign for a negative number.  This flag is
  3103.                     similar to the plus.  If both the plus and the blank
  3104.                     flags are present, the plus takes precedence.
  3105.  
  3106.                 # (pound)
  3107.                     causes special formatting.  With the o, x, and X
  3108.                     types, the pound flag prefixes any nonzero output with
  3109.                     0, 0x, or 0X, respectively.  With the f, e, and E
  3110.                     conversion types, the pound flag forces the result to
  3111.                     contain a decimal point.  With the g and G types, the
  3112.                     pound flag forces the result to contain a decimal
  3113.                     point and retain trailing zeroes.
  3114.  
  3115.                 0 (zero)
  3116.                     pads the field width with leading zeros instead of
  3117.                     spaces for the d, i, o, u, x, X, e, E, f, g, and G
  3118.                     conversion types.  If the minus flag is also used, the
  3119.                     zero flag is ignored.  If a precision is specified,
  3120.                     the zero flag is ignored for conversion types d, i, o,
  3121.                     u, x, and X.  Behavior of the zero flag is undefined
  3122.                     for the remaining conversion types.
  3123.  
  3124.             width
  3125.                 specifies the field width, which is the minimum number of
  3126.                 characters to be generated for this format item.
  3127.  
  3128.  
  3129.                                  - Page 44 -
  3130. 83.    sprintf
  3131.  
  3132.                 The width is a nonnegative number that specifies the
  3133.                 minimum field width.  If fewer characters are generated by
  3134.                 the conversion operation, the result is padded on the left
  3135.                 or right (depending on the minus flag described above).  A
  3136.                 blank is used as the padding character unless width begins
  3137.                 with a zero.  In that case, zero padding is performed.  If
  3138.                 the minus flag appears, padding is performed with blanks.
  3139.                 width specifies the minimum field width, and it will not
  3140.                 cause lengthy output to be truncated.  Use the precision
  3141.                 specifier for that purpose.
  3142.  
  3143.                 If you do not want to specify the field width as a
  3144.                 constant in the format string, you can code it as an
  3145.                 asterisk (*), with or without a leading zero.  The
  3146.                 asterisk indicates that the width value is an integer in
  3147.                 the argument list. See the examples for more information
  3148.                 on this technique. If the asterisk is followed by a $ sign
  3149.                 and a digit 1-9, you can specify which argument that holds
  3150.                 the width.
  3151.  
  3152.             precision
  3153.                 specifies the field precision, which is the required
  3154.                 precision of numeric conversions or the maximum number of
  3155.                 characters to be copied from a string, depending on the
  3156.                 type field.
  3157.  
  3158.                 The meaning of the precision item depends on the field
  3159.                 type, as follows:
  3160.  
  3161.                  Type                  Meaning
  3162.                  ----                  -------
  3163.                   c                    The precision item is ignored.
  3164.                   b, d, i, o, u, x, X  The precision is the minimum number
  3165.                                        of digits to appear.  If fewer
  3166.                                        digits are generated, leading
  3167.                                        zeroes are supplied.
  3168.                   s                    The precision is the maximum number
  3169.                                        of characters to be copied from the
  3170.                                        string.
  3171.  
  3172.                 As with the width item, you can use an asterisk for the
  3173.                 precision to indicate that the value should be picked up
  3174.                 from the next argument.
  3175.  
  3176.             size
  3177.                 Not used by FPL, though all the ANSI C modifiers are still
  3178.                 read and ignored for compatibility.
  3179.                 (Can be either L for long double, l for large size, or h
  3180.                 for small size.)
  3181.  
  3182.             type
  3183.                 specifies the type of argument conversion to be done.
  3184.                 Valid conversion types are as follows:
  3185.  
  3186.                     b
  3187.                         specifies binary-integer conversion. The
  3188.                         associated argument is taken as an unsigned
  3189.                         integer, and it is converted to a string of binary
  3190.                         digits.  This conversion type is an extension to
  3191.                         the ANSI standard.
  3192.                     c
  3193.                         specifies single-character conversion. The
  3194.                         associated argument must be an integer.  The
  3195.                         single character in the right-most byte of the
  3196.                         integer is copied to the output.
  3197.                     d
  3198.                         specifies decimal-integer conversion. The
  3199.  
  3200.                                  - Page 45 -
  3201. 83.    sprintf
  3202.  
  3203.                         associated argument must be an integer, and the
  3204.                         result is a string of digits preceded by a sign.
  3205.                         If the plus and blank flags are absent, the sign
  3206.                         is produced only for a negative integer.
  3207.                     i
  3208.                         specifies decimal-integer conversion. The
  3209.                         associated argument must be an integer, and the
  3210.                         result is a string of digits preceded by a sign.
  3211.                         If the plus and blank flags are absent, the sign
  3212.                         is produced only for a negative integer.
  3213.                     n
  3214.                         specifies the argument will be a pointer to an
  3215.                         integer into which is written the number of
  3216.                         characters written so far by this call to the
  3217.                         sprintf function.
  3218.                     o
  3219.                         specifies octal-integer conversion. The
  3220.                         associated argument is taken as an unsigned
  3221.                         integer, and it is converted to a string of octal
  3222.                         digits.
  3223.                     p
  3224.                         specifies pointer conversion.  The associated
  3225.                         argument is taken as a data pointer, and it is
  3226.                         converted to hexadecimal representation.  Under
  3227.                         AmigaDOS, the pointer is printed as 8 hexadecimal
  3228.                         digits, with leading zeroes if necessary.
  3229.                     P
  3230.                         specifies pointer conversion. This is the same as
  3231.                         the p format, except that uppercase letters are
  3232.                         used as hexadecimal digits. This conversion type
  3233.                         is an extension to the ANSI standard.
  3234.                     s
  3235.                         specifies string conversion. The associated argument
  3236.                         must be a string!
  3237.                     u
  3238.                         specifies unsigned decimal integer conversion.
  3239.                         The associated argument is taken as an unsigned
  3240.                         integer, and it is converted to a string of
  3241.                         decimal digits.
  3242.                     x
  3243.                         specifies hexadecimal-integer conversion.  The
  3244.                         associated argument is taken as an unsigned
  3245.                         integer, and it is converted to a string of
  3246.                         hexadecimal digits with lowercase letters.
  3247.                     X
  3248.                         specifies hexadecimal-integer conversion.  This is
  3249.                         the same as the x format, except that uppercase
  3250.                         letters are used as hexadecimal digits.
  3251.  
  3252. RETURNS
  3253.  
  3254.         This function returns the formatted string.
  3255.  
  3256. EXAMPLE
  3257.  
  3258.         /* This example prints a message indicating whether */
  3259.         /* the function argument is positive or negative.   */
  3260.         /* In the second sprintf, the width and precision   */
  3261.         /* are 15 and 8, respectively.                      */
  3262.         string pneg(int value)
  3263.         {
  3264.             string sign;
  3265.  
  3266.             if (value < 0) {
  3267.               sign = "negative";
  3268.             }
  3269.             else {
  3270.  
  3271.                                  - Page 46 -
  3272. 83.    sprintf
  3273.  
  3274.               sign = "not negative";
  3275.             }
  3276.             return sprintf("The number %d is %s.n",value,sign);
  3277.         }
  3278.  
  3279.         Output(pneg(37));
  3280.         Output(pneg(-18));
  3281.  
  3282.         /* This example outputs 12 and 8 in reversed order by using the
  3283.            specified argument number syntax: */
  3284.  
  3285.         Output( sprintf( " %$2d %$1d ", 12, 8 ) );
  3286.  
  3287. 84.     strcmp
  3288.  
  3289. SYNTAX  int strcmp ( String1, String2 );
  3290.  
  3291.         int stricmp ( String1, String2 );
  3292.  
  3293. DESCRIPTION
  3294.         strcmp lexicographically compares the string in the String1
  3295.         parameter to the string in the String2 parameter. stricmp() does
  3296.         the same but does a case insensitive compare, which makes uppercase
  3297.         letters equal their lowercase correspondance.
  3298.  
  3299.         Case insensitive means that the strings "HELLO" and "hello" are
  3300.         treated as identical.
  3301.  
  3302. INPUTS  string String1, String2;
  3303.  
  3304. RETURNS
  3305.         strcmp and stricmp return values that are:
  3306.  
  3307.         Less than 0 (zero) if String1 is less than String2
  3308.         Equal to 0 (zero) if String1 is equal to String2
  3309.         Greater than 0 (zero) if String1 is greater than String2.
  3310.  
  3311. SEE     strncmp and strnicmp
  3312.  
  3313. 85.     strlen
  3314.  
  3315. SYNTAX  int strlen( String );
  3316.  
  3317. DESCRIPTION
  3318.         Returns the length of the string String.
  3319.  
  3320. INPUTS  string  String;
  3321.  
  3322. RETURNS
  3323.         The length of the string String.
  3324.  
  3325. 86.     strncmp
  3326.  
  3327. SYNTAX  int strncmp ( String1, String2, Num );
  3328.  
  3329.         int strnicmp ( String1, String2, Num );
  3330.  
  3331. DESCRIPTION
  3332.         The strncmp and strnicmp subroutines make the same comparisons as
  3333.         strcmp and stricmp, but they compare at most 'Num' characters.
  3334.  
  3335. INPUTS  string String1, String2;
  3336.         int Number      - Maximum number of characters to compare.
  3337.  
  3338. RETURNS
  3339.         they return values that are:
  3340.  
  3341.  
  3342.                                  - Page 47 -
  3343. 86.    strncmp
  3344.  
  3345.         Less than 0 (zero) if String1 is less than String2
  3346.         Equal to 0 (zero) if String1 is equal to String2
  3347.         Greater than 0 (zero) if String1 is greater than String2.
  3348.  
  3349. EXAMPLES
  3350.         Compare the string variable Str1 and check if it matches Str2, but
  3351.         check no more than 12 characters:
  3352.  
  3353.           if(!strncmp(Str1, Str2, 12))
  3354.             output("MATCH!");
  3355.  
  3356.         This example returns zero (0) in result.
  3357.  
  3358.           result = strncmp("realization", "really", 4);
  3359.  
  3360.         This example returns a value less than zero in result.
  3361.  
  3362.           result = strncmp("world", "worldgames", 100);
  3363.  
  3364.  
  3365. SEE     strcmp() and stricmp()
  3366.  
  3367. 87.     strstr
  3368.  
  3369. SYNTAX  int strstr( String1, String2, Column );
  3370.  
  3371.         int stristr ( String1, String2, Column );
  3372.  
  3373. DESCRIPTION
  3374.         The strstr and stristr functions find occurrences of String2 in
  3375.         String1.
  3376.  
  3377.         The 'Column' parameter can be set optionally. It specifies the start
  3378.         searching column!
  3379.  
  3380.         strstr() requires the substring to match exactly, while the stristr()
  3381.         performs a case insentive search. Case insensitive means that the
  3382.         strings "HELLO" and "hello" are treated as identical.
  3383.  
  3384. INPUTS
  3385.         string String1  - The string to search within.
  3386.  
  3387.         string String2  - The substring.
  3388.  
  3389.         int Column      - Start search column.
  3390.  
  3391. RETURNS
  3392.         They return in which column they found String2 or -1 if the string
  3393.         was not found. If String2 is a 0 (zero) length string, the functions
  3394.         return 0.
  3395.  
  3396. SEE     strncmp and strnicmp, strcmp and stricmp
  3397.  
  3398. 88.     strtol
  3399.  
  3400. SYNTAX  int strtol( String, Base );
  3401.  
  3402. DESCRIPTION
  3403.           The strtol subroutine returns an integer whose value is represented
  3404.         by the character string pointed to by the String parameter. The
  3405.         strtol subroutine scans the string up to the first character that is
  3406.         inconsistent with the Base parameter. Leading white-space characters
  3407.         are ignored, and an optional sign may precede the digits.
  3408.  
  3409.           If the Base parameter is positive and not greater than 36, then it
  3410.         is used as the base for conversion. After an optional leading sign,
  3411.         leading zeros are ignored. "0x" or "0X" is ignored if Base is 16
  3412.  
  3413.                                  - Page 48 -
  3414. 88.    strtol
  3415.  
  3416.         (sixteen).
  3417.  
  3418.           If the Base parameter is 0 (zero), the string determines the base.
  3419.         Thus, after an optional leading sign, a leading 0 (zero) indicates
  3420.         octal conversion, a leading "0x" or "0X" indicates hexadecimal
  3421.         conversion and a leading "0b" or "0B" indicates a binary conversion.
  3422.         The default is to use decimal conversion.
  3423.  
  3424. INPUTS  string String   - Character string to be converted.
  3425.         int Base        - Specifies the base to use for the conversion.
  3426.  
  3427. RETURNS
  3428.           Upon successful completion, the strtol subroutine return the
  3429.         converted value. If no conversion could be performed, 0 (zero) is
  3430.         returned. If the correct value is outside the range of representable
  3431.         values, maximum or minimum value is returned according to the sign of
  3432.         the value.
  3433.  
  3434. EXAMPLES
  3435.         Convert the string holding the hexadecimal "0xdeadbeef" to decimal:
  3436.  
  3437.           string String = "0xdeadbeef"
  3438.           int num = strtol(String, 16);
  3439.  
  3440. SEE      ltostr
  3441.  
  3442. 89.     substr
  3443.  
  3444. SYNTAX  string substr( Source, Column, Length );
  3445.  
  3446. DESCRIPTION
  3447.         The substr function returns a substring to a destination string
  3448.         variable. Giving a length of -1 will make substr get the rest
  3449.         of the string from the column specified.
  3450.         - If the substring is told to keep on beyond the end of the Source,
  3451.           the substring will end where the Source string does.
  3452.         - If the column parameter is below zero or larger than the length of
  3453.           the source string, a zero length string is returned.
  3454.         - The first column of the source is column 0 (zero).
  3455.  
  3456. INPUTS
  3457.         string Source   - The source string from which the substring
  3458.                           will be copied from. */
  3459.         int Column      - Start column of the substring.
  3460.         int Length      - The Length of the substring.
  3461.  
  3462. RETURNS
  3463.         The substring!
  3464.  
  3465. EXAMPLES
  3466.         Extract a substring of 3 characters from column 4 of the source
  3467.         string:
  3468.  
  3469.           string Dest;
  3470.           Dest=substr("One Two Three", 4, 3);
  3471.  
  3472.         Get the right part of a line split by the character "|":
  3473.  
  3474.           string Line="Names     |Addresses", Dest;
  3475.           int pos;
  3476.           pos=strstr(Line, "|");
  3477.           if(pos<0)                     /* if we can't find a "|" */
  3478.             exit;
  3479.  
  3480.           pos++;                        /* We don't want to include the "|"
  3481.                                            Character in our substring! */
  3482.           Dest=substr(Line,             /* The source string */
  3483.  
  3484.                                  - Page 49 -
  3485. 89.    substr
  3486.  
  3487.                       pos,              /* where from */
  3488.                       -1);               /* To the end of the string. */
  3489.  
  3490.         It's OK to try getting more than you will get. This example get the
  3491.         rest of the line too, but maximum 10000 characters...:
  3492.  
  3493.           Dest=substr(Line, pos, 10000);
  3494.  
  3495. SEE      strstr
  3496.  
  3497. 90.     Examples
  3498.  
  3499. 1. Ask the user for his age and output the number of days old he is:
  3500.  
  3501.   int a;                            /* Create an integer called "a"  */
  3502.   a=num_input("Age in years:");     /* Get age of user in variable a */
  3503.   output("Makes " a*365 " days!\n");/* Output proper text            */
  3504.  
  3505.  
  3506. 2. Ask the user for his name and output it a hundred times with spaces
  3507.    between:
  3508.  
  3509.   string name;                          /* Create a string variable */
  3510.   name=str_input("What's your name?");  /* Input name               */
  3511.   int i;                                /* Create an integer        */
  3512.   for (i=0; i<100; i++)                 /* Count 100 times          */
  3513.     output(name " ");                   /* Output the name          */
  3514.  
  3515.  
  3516. 3. Replace all form feed characters with the proper number of newlines
  3517.    to suit the page length given by the user (for guys using
  3518.    printers which by some reason don't handle form feeds):
  3519.  
  3520.   int len, i, page;                     // Create a number of ints
  3521.   len=num_input("Page length?");        // Get page length
  3522.   while(search_for("\f", "S")) {        // Search for form feed
  3523.     page=len-line()%len;                // Calc number of newlines
  3524.     for(i=0, i<page, i++)               // Count to number above
  3525.       output("\n");                     // Output a newline
  3526.   }                                     // End of while
  3527.   status("Done!");                      // Text in status line.
  3528.  
  3529.  
  3530. 4. Make a nice little table with temperatures in Celsius and
  3531.    Fahrenheit. Count from 0 to 100 Celsius with ten degrees steps:
  3532.  
  3533.   int c, f;                     /* Declare two variables             */
  3534.   while(c<=100) {               /* while c less than or equal to 100 */
  3535.     output(c" degrees Celsius = ");/* output Celsius                 */
  3536.     f=c*18/10+32;               /* The formula. Made to work
  3537.                                    without floating points           */
  3538.     output(f" degrees Fahrenheit! \n"); /* output Fahrenheit result  */
  3539.     c+=10;                      /* Add ten to c.                     */
  3540.   }                             /* loop                              */
  3541.  
  3542. 5. Create a routine that make a division with an innumerable number of
  3543.    decimals:
  3544.  
  3545.   int a, b, n;                  /* Declare all variables needed     */
  3546.   a=355;                        /* Set the operands of the division */
  3547.   b=14;
  3548.   output(a " / " b " = ");      /* View the evaluation to the user  */
  3549.   output(a/b);                  /* Calculate...                     */
  3550.   if(a%b) {                     /* If there remains anything...     */
  3551.     output(".");                /* Display a dot.                   */
  3552.     for(n=0;n<100;n++) {        /* Only 100 decimals this time!     */
  3553.       a=a%b*10;                 /* Evaluate next left operator      */
  3554.  
  3555.                                  - Page 50 -
  3556. 90.    Examples
  3557.  
  3558.       output(a/b);              /* View the next figure             */
  3559.     }
  3560.   }
  3561.   output("\n");                 /* Make an extra newline            */
  3562.  
  3563.  
  3564. 6. Perform the same task as above. This is an example program showing
  3565.    some simple moves to make the code run faster:
  3566.  
  3567.   int a=355, b=14, n;
  3568.   string s=a" / "b" = "(a/b);
  3569.   if(a%b)
  3570.     for(s+=".";n++<100;)
  3571.       s+=((a=a%b*10)/b);
  3572.   output(s"\n");
  3573.  
  3574. 7. Try out the recursive possibilities of FPL:
  3575.  
  3576.   int b;
  3577.   int label(int &);
  3578.   label(b);
  3579.   output(b"\n");
  3580.   exit;
  3581.  
  3582.   int label(int &b)
  3583.   {
  3584.     if(++b<5) {
  3585.       while(1) {{{{{{label(b);break;}}}}}}
  3586.     }
  3587.     return;
  3588.   }
  3589.  
  3590. 91.     Error messages
  3591.  
  3592. DIVISION BY ZERO
  3593.   Division by zero is not a permitted mathematical move (note that this may
  3594.   also appear with the remainder operator "%").
  3595.   See  division  or  remainder .
  3596.  
  3597. FILE
  3598.   Something about the specified file is wrong. Check the file name again.
  3599.  
  3600. IDENTIFIER NOT FOUND
  3601.   The variable or function is not found!
  3602.  
  3603. IDENTIFIER ALREADY USED
  3604.   This name is already used by an identifier. You cannot use it too!
  3605.  
  3606. ILLEGAL ARRAY
  3607.   You cannot create an array with less than one element, access elements with
  3608.   higher number than you declared it to or access negative elements. When
  3609.   using the resize keyword the variable name must already be an array.
  3610.   See  variables  or  resize .
  3611.  
  3612. ILLEGAL ASSIGN
  3613.   FPL does not support that type of  compound assignment .
  3614.  
  3615. ILLEGAL BREAK
  3616.    Break  can ONLY be used within some kind of loop ( while ,  for  or  do )
  3617.   or  switch , and this wasn't such a  statement .
  3618.  
  3619. ILLEGAL CASE
  3620.   The 'case' keyword can only be used within a switch() statement!
  3621.  
  3622. ILLEGAL CONDITION OPERATOR
  3623.   Conditional operators should be used like a ? b : c. If any of the ? or :
  3624.   characters are missing, this might become the error message!
  3625.  
  3626.                                  - Page 51 -
  3627. 91.    Error messages
  3628.  
  3629.  
  3630. ILLEGAL CONTINUE
  3631.    Continue  can ONLY be used within some kind of loop ( while ,  for  or
  3632.    do ), and this wasn't such a  statement .
  3633.  
  3634. ILLEGAL DECLARATION
  3635.   The  declaration  was not placed in the beginning of a block,
  3636.   or a function isn't declared the way it was prototyped.
  3637.  
  3638. ILLEGAL DEFAULT
  3639.   The 'default' keyword can only be used within a switch() statement!
  3640.  
  3641. ILLEGAL PROTOTYPE
  3642.   Something in the just parsed function prototype was not using
  3643.   correct syntax and/or keywords.
  3644.  
  3645. ILLEGAL REFERENCE
  3646.   A variable reference was used the wrong way!
  3647.  
  3648. ILLEGAL RESIZE
  3649.   Resizing of an array did not follow correct syntax!
  3650.  
  3651. ILLEGAL STATEMENT
  3652.   The  statement  was not allowed at this point. It might
  3653.   be a numerical expresion where a string expresion was expected or vice
  3654.   versa. It might also be a statement that cannot be placed here.
  3655.  
  3656. ILLEGAL STRING INDEX
  3657.   Trying to read a negative column off a string will most likely cause this.
  3658.  
  3659. ILLEGAL VARIABLE TYPE
  3660.   You mixed  string  and  integer  variables/ expressions illegally
  3661.   or you tried to send to wrong kind of variable to a function.
  3662.  
  3663. INTERNAL ERROR
  3664.   The library's internal data/structures has not been handled properly by
  3665.   the coder of the software you're using. Report this immediately to
  3666.   him/her. (See the docs of the software you're controlling with FPL.) This
  3667.   is not the FPL programmer's fault.
  3668.  
  3669. INSIDE FUNCTION NOT FOUND
  3670.   A function that has been prototyped to be an `inside' function was not
  3671.   found!
  3672.   Notice that the function *MUST* be prototyped and declared the same way. A
  3673.   function prototyped as `int' but declared as `void', will *NOT* be found by
  3674.   the FPL interpreter!
  3675.  
  3676. INCOMPLETE STATEMENT
  3677.   The  statement  just parsed did not include a required action such as a
  3678.   variable change or a function call.
  3679.  
  3680. MISSING APOSTROPHE
  3681.   The program most likely contains a character within single quotes ('),
  3682.   where the following quote is missing.
  3683.  
  3684. MISSING ARGUMENT
  3685.   The  function / keyword  you tried to invoke, requires more arguments!
  3686.   (Or refer to the docs of the software you're controlling with FPL.)
  3687.  
  3688. MISSING BRACE
  3689.   Some places just require braces. I.e block statements that have an initial
  3690.   brace or Array assigns that must end with a close
  3691.   brace.
  3692.  
  3693. MISSING BRACKET
  3694.   Array references and other need an open bracket ([) and a close bracket
  3695.   (]).
  3696.  
  3697.                                  - Page 52 -
  3698. 91.    Error messages
  3699.  
  3700.  
  3701. MISSING COLON
  3702.   There should be a colon (:) here, but it's not!
  3703.  
  3704. MISSING OPERAND
  3705.   Making an expression that starts with an operator most likely causes this
  3706.   error.
  3707.  
  3708. MISSING PARENTHESES
  3709.   The statement just interpreted had a lack of parenthesis.
  3710.  
  3711. MISSING SEMICOLON
  3712.   All statements must be separated with semicolons. This wasn't!
  3713.  
  3714. MISSING WHILE
  3715.   There is a missing 'while' keyword after the do-while statement!
  3716.  
  3717. OUT OF MEMORY
  3718.   The system has run out of memory. This isn't your fault, and there is
  3719.   nothing you can do about it but decrease memory usage. Note that if *any*
  3720.   internal FPL allocation call fails, the program stops with this error code.
  3721.  
  3722. OUT OF STACK
  3723.   The stack size hit the roof. The program is too recursive!
  3724.  
  3725. PARAMETER IS OUT OF RANGE
  3726.   The parameter(s) specified must be within a certain range, which you
  3727.   clearly did not manage. (Refer to the docs of the action you just tried.)
  3728.  
  3729. PROGRAM STOPPED
  3730.   The program was stopped by a force outside the library. This is not
  3731.   a real error message but more like information.
  3732.  
  3733. READ ONLY VIOLATION
  3734.   You tried changing the contents of a read-only variable.
  3735.  
  3736. SYNTAX ERROR
  3737.   Severe error in your writing. Rethink and try again. All  functions ,
  3738.   labels or variable  identifiers MUST start with a letter .
  3739.  
  3740. TOO MANY PARAMETERS
  3741.   Either a function is called with too many parameters, or there is a missing
  3742.   paranthesis after the parameters.
  3743.  
  3744. UNBALANCED COMMENT
  3745.   There is no corresponding end of comment.
  3746.  
  3747. UNEXPECTED END OF PROGRAM
  3748.   The program ended where it wasn't supposed to! Probable cause is a
  3749.   lack of closing comment sign or lack of a closing paren of some kind.
  3750.  
  3751. UNEXPECTED INTEGER STATEMENT
  3752.   The interpreter expected a string expression, but read an integer one.
  3753.  
  3754. UNEXPECTED STRING STATEMENT
  3755.   The interpreter expected an integer expression, but read a string one.
  3756.  
  3757. UNKNOWN
  3758.   The programmer of the host software sent a strange error code to FPL which
  3759.   there is no corresponding error message to!
  3760.  
  3761. UNMATCHED BRACE
  3762.   This brace has no corresponding one.
  3763.  
  3764.  
  3765.  
  3766.  
  3767.  
  3768.                                  - Page 53 -
  3769. 91.    Error messages
  3770.  
  3771.  
  3772. 92.     INDEX of sections
  3773.  
  3774. About this manual ..................................................   1. 42
  3775. abs ................................................................  38. 50
  3776. Addition + .........................................................  20. 28
  3777. Assignment expressions .............................................  24. 32
  3778. atoi ...............................................................  38. 61
  3779. Binary expressions .................................................  19. 27
  3780. Bitwise AND & ......................................................  21. 66
  3781. Bitwise Exclusive OR ^ .............................................  22. 16
  3782. Bitwise inclusive OR | .............................................  22. 32
  3783. Bitwise left and right shift << >> .................................  20. 36
  3784. Bitwise negation ~ .................................................  19.  7
  3785. Blockstatement .....................................................  12. 41
  3786. break ..............................................................  26. 41
  3787. case ...............................................................  27. 29
  3788. char ...............................................................  28.  1
  3789. closelib ...........................................................  39. 13
  3790. Comma expressions ..................................................  25. 24
  3791. Compound assignment ................................................  24. 54
  3792. Conditional expressions ............................................  23. 42
  3793. Constants ..........................................................  12.  8
  3794. continue ...........................................................  28. 17
  3795. debugáááá ..........................................................  29. 50
  3796. Declare inside functions ...........................................   9. 22
  3797. Decrement -- .......................................................  18. 43
  3798. default ............................................................  28. 55
  3799. Division / .........................................................  19. 64
  3800. do .................................................................  29. 20
  3801. else ...............................................................  30.  9
  3802. Equality == != .....................................................  21. 42
  3803. Error messages .....................................................  50. 31
  3804. eval ...............................................................  39. 38
  3805. Examples ...........................................................  49.  9
  3806. exit ...............................................................  30. 55
  3807. export .............................................................  31.  8
  3808. Expression statement ...............................................  13. 57
  3809. for ................................................................  31. 24
  3810. FPL Users Documentation ............................................   1.  0
  3811. Funclibs ...........................................................   3. 56
  3812. Function calls .....................................................  17. 46
  3813. Functions ..........................................................   8. 64
  3814. General ............................................................   2. 37
  3815. General function use ...............................................  10. 59
  3816. Grouping and evaluating ............................................  15. 65
  3817. Hints and tricks ...................................................  14. 63
  3818. How to reach me ....................................................   2.  1
  3819. if .................................................................  32. 52
  3820. Increment ++ .......................................................  18. 15
  3821. int ................................................................  33. 52
  3822. interpret ..........................................................  39. 55
  3823. itoa ...............................................................  40. 54
  3824. itoc ...............................................................  41. 11
  3825. joinstr ............................................................  41. 34
  3826. Keywords ...........................................................  14. 16
  3827. Line Control .......................................................   4. 16
  3828. Logical AND && .....................................................  22. 49
  3829. Logical negation ! .................................................  18. 63
  3830. Logical OR || ......................................................  23. 12
  3831. ltostr .............................................................  41. 53
  3832. Multiplication * ...................................................  19. 50
  3833. Null statement .....................................................  13. 45
  3834. Numeric expressions (and operators) ................................  15. 48
  3835. openlib ............................................................  42. 13
  3836. Parenthesized Expressions ..........................................  17. 27
  3837. Pragmas in FPL .....................................................   4. 58
  3838.  
  3839.                                  - Page 54 -
  3840. 92.    INDEX of sections
  3841.  
  3842. Primary expressions ................................................  17. 17
  3843. Relational < > <= >= ...............................................  21.  7
  3844. Remainder % ........................................................  20. 16
  3845. resize .............................................................  34.  9
  3846. return .............................................................  35.  1
  3847. short ..............................................................  35. 30
  3848. Simple assignment = ................................................  24. 43
  3849. sprintf ............................................................  42. 49
  3850. Statements .........................................................  13. 29
  3851. strcmp .............................................................  46. 12
  3852. string .............................................................  35. 46
  3853. Strings ............................................................   8. 40
  3854. strlen .............................................................  46. 38
  3855. strncmp ............................................................  46. 50
  3856. strstr .............................................................  47. 21
  3857. strtol .............................................................  47. 52
  3858. substr .............................................................  48. 25
  3859. Subtraction - ......................................................  20. 32
  3860. switch .............................................................  36. 20
  3861. typedef ............................................................  36.  3
  3862. Unary Expression ...................................................  17. 66
  3863. Unary minus - ......................................................  18. 54
  3864. Unary plus + .......................................................  18. 47
  3865. Variables ..........................................................   5. 22
  3866. while ..............................................................  37. 30
  3867.  
  3868. 93.     INDEX of keywords
  3869.  
  3870. á++áoperatorá ......................................................  18. 46
  3871. áAboutáthisámanualá ................................................   1. 30
  3872. áabsááááááá ........................................................  38. 24
  3873. áAdditioná+ááááááááááááá ...........................................  19. 37
  3874. áAdditiveááááááááááááá .............................................  16. 34
  3875. áAssignmentááááááááááá .............................................  16. 44
  3876. áAssignmentáexpressionsáá ..........................................  15. 62
  3877. áatoiáááááá ........................................................  38. 25
  3878. áautoááááá .........................................................  26.  7
  3879. áBinaryáExpressionsáááááá ..........................................  15. 61
  3880. áBitwiseáANDá&áááááááááá ...........................................  19. 38
  3881. áBitwiseáExclusiveáORá .............................................  16. 39
  3882. áBitwiseáExclusiveáORá^á ...........................................  19. 39
  3883. áBitwiseáInclusiveáORá .............................................  16. 40
  3884. áBitwiseáInclusiveáORá|á ...........................................  19. 40
  3885. áBitwiseáLogicaláANDáá .............................................  16. 38
  3886. áBitwiseáNegationá~á ...............................................  18.  9
  3887. áBitwiseáShiftáááááááá .............................................  16. 35
  3888. áBitwiseáShiftá<<á>>áááá ...........................................  19. 41
  3889. áBlockáááááá .......................................................  13. 34
  3890. ábreaká ............................................................  14. 40
  3891. ábreakáááá .........................................................  26.  8
  3892. ábreakáááááá .......................................................  13. 35
  3893. ácaseá .............................................................  29. 19
  3894. ácaseááááá .........................................................  26.  9
  3895. áchará .............................................................  14. 49
  3896. ácharááá ...........................................................  34.  8
  3897. ácharááááá .........................................................  26. 10
  3898. ácloselib()á .......................................................  42. 26
  3899. ácloselibá .........................................................   4. 12
  3900. ácloselibáá ........................................................  38. 46
  3901. áCommaáááááááááááááááá .............................................  16. 45
  3902. áCommaáexpressionsááááááá ..........................................  15. 64
  3903. ácommaáoperatorá ...................................................  16. 21
  3904. ácompoundá .........................................................  15. 28
  3905. ácompoundáassignmentá ..............................................  24. 42
  3906. áConditionaláááááááááá .............................................  16. 43
  3907. áConditionaláExpressionsá ..........................................  15. 63
  3908. áconstáááá .........................................................  26. 11
  3909.  
  3910.                                  - Page 55 -
  3911. 93.    INDEX of keywords
  3912.  
  3913. áConstantsááááááááááááááá ..........................................  15. 55
  3914. ácontinueá .........................................................  14. 38
  3915. ácontinueááá .......................................................  13. 36
  3916. ádebugáááá .........................................................  26. 13
  3917. ádeclarationá ......................................................  51.  6
  3918. áDecrementá--ááááááá ...............................................  18. 10
  3919. ádefaultá ..........................................................  28.  0
  3920. ádefaultáá .........................................................  26. 14
  3921. ádivisioná .........................................................  20. 19
  3922. áDivisioná/ááááááááááááá ...........................................  19. 42
  3923. ádoá ...............................................................  14. 28
  3924. ádoááááááá .........................................................  26. 15
  3925. ádoááááááááá .......................................................  13. 37
  3926. áelseá .............................................................  14. 30
  3927. áEqualityááááááááááááá .............................................  16. 37
  3928. áEqualityá==á!=ááááááááá ...........................................  19. 43
  3929. áErrorámessagesáááá ................................................   1. 31
  3930. áevalá .............................................................  40. 53
  3931. áevaláááááá ........................................................  38. 26
  3932. áExamplesáááááááááá ................................................   1. 32
  3933. áexitá .............................................................  14. 62
  3934. áexitááááá .........................................................  26. 16
  3935. áexportá ...........................................................  14. 55
  3936. áexpression1á ......................................................  14. 32
  3937. áexpression2á ......................................................  14. 32
  3938. áexpression3á ......................................................  14. 32
  3939. áExpressioná .......................................................  13. 38
  3940. áexpressions .......................................................  51. 31
  3941. áExpressionsááááááá ................................................   1. 17
  3942. áforá ..............................................................  14. 32
  3943. áforáááááá .........................................................  26. 17
  3944. áforáááááááá .......................................................  13. 39
  3945. áFPLáimplementationáá ..............................................   1. 41
  3946. áfunclibá ..........................................................  39. 19
  3947. áfunclibsá .........................................................  39. 37
  3948. áFunclibsáááááááááá ................................................   1. 26
  3949. áfunctioná .........................................................  51. 56
  3950. áFunctionácallsá ...................................................  17. 26
  3951. áfunctionsá ........................................................   2. 55
  3952. áFunctionsááááááááá ................................................   1. 18
  3953. áGeneralááááááááááá ................................................   1. 16
  3954. ágeneraláfunctionáusageá ...........................................   9.  4
  3955. áGeneraláinformationá ..............................................   1. 38
  3956. áGroupingáandáevaluatingá ..........................................  15. 57
  3957. áGroupingáandáEvaluatingáFPLáExpressionsá ..........................  17. 21
  3958. áHintsáandátricksáá ................................................   1. 33
  3959. áHowátoáreacháusááá ................................................   1. 34
  3960. áidentifiersáMUSTástartáwitháaáletterá .............................  52. 38
  3961. áifá ...............................................................  14. 45
  3962. áifááááááá .........................................................  26. 18
  3963. áifááááááááá .......................................................  13. 40
  3964. áIncrementá++ááááááá ...............................................  18. 11
  3965. áInsideáfunctionsá .................................................   9. 14
  3966. áintá ..............................................................  14. 49
  3967. áintáááá ...........................................................  28. 14
  3968. áintáááááá .........................................................  26. 19
  3969. áintegerá ..........................................................  51. 31
  3970. áintegerávariableá .................................................  11. 55
  3971. áInternaláfunctionsá ...............................................   9. 19
  3972. áinterpretá ........................................................  38. 27
  3973. áitoaá .............................................................  41. 33
  3974. áitoaáááááá ........................................................  38. 28
  3975. áitocáááááá ........................................................  38. 29
  3976. ájoinstrááá ........................................................  38. 30
  3977. ákeywordá ..........................................................  51. 56
  3978. ákeywordáreferenceá ................................................  14. 19
  3979. ákeywordsá .........................................................   2. 55
  3980.  
  3981.                                  - Page 56 -
  3982. 93.    INDEX of keywords
  3983.  
  3984. áKeywordsáááááááááá ................................................   1. 19
  3985. áLineácontroláááááá ................................................   1. 20
  3986. áLogicaláANDá&&ááááááááá ...........................................  19. 44
  3987. áLogicaláANDáááááááááá .............................................  16. 41
  3988. áLogicaláNegationá!á ...............................................  18. 12
  3989. áLogicaláORááááááááááá .............................................  16. 42
  3990. áLogicaláORá||áááááááááá ...........................................  19. 45
  3991. álongá .............................................................  14. 49
  3992. álongááááá .........................................................  26. 20
  3993. áltostrá ...........................................................  41. 10
  3994. áltostráááá ........................................................  38. 31
  3995. áMoreávariableádeclarationádetailsá ................................  14. 58
  3996. áMultiplicationá*ááááááá ...........................................  19. 46
  3997. áMultiplicativeááááááá .............................................  16. 33
  3998. áNullááááááá .......................................................  13. 41
  3999. ánumericaláexpressionsá ............................................  11. 47
  4000. áopenlib()á ........................................................  39. 24
  4001. áopenlibá ..........................................................   4.  9
  4002. áopenlibááá ........................................................  38. 45
  4003. áParenthesizedáExpressionsá ........................................  17. 25
  4004. áPragmasááááááááááá ................................................   1. 24
  4005. áprecedenceá .......................................................  18.  5
  4006. áprimaryá ..........................................................  16. 20
  4007. áPrimaryáááááááááááááá .............................................  16. 31
  4008. áPrimaryáExpressionsááááá ..........................................  15. 59
  4009. áregisterá .........................................................  26. 21
  4010. áRelationalááááááááááá .............................................  16. 36
  4011. áRelationalá<á>á<=á>=ááá ...........................................  19. 47
  4012. áremainderá ........................................................  20. 12
  4013. áRemainderá%áááááááááááá ...........................................  19. 48
  4014. áremainderáoperatorá ...............................................   5. 56
  4015. áresizeá ...........................................................  14. 53
  4016. áresizeááá .........................................................  26. 22
  4017. áreturná ...........................................................  14. 62
  4018. áreturnááá .........................................................  26. 23
  4019. áreturnááááá .......................................................  13. 42
  4020. áshortá ............................................................  14. 49
  4021. áshortáá ...........................................................  28. 15
  4022. áshortáááá .........................................................  26. 24
  4023. ásimpleáassignmentá ................................................  24. 41
  4024. ásprintfááá ........................................................  38. 32
  4025. ástatementá ........................................................  14. 28
  4026. áStatementsá .......................................................  10. 53
  4027. áStatementsáááááááá ................................................   1. 21
  4028. ástaticááá .........................................................  26. 25
  4029. ástrcmpáááá ........................................................  38. 33
  4030. ástricmpááá ........................................................  38. 34
  4031. ástringá ...........................................................  14. 51
  4032. ástringááá .........................................................  26. 26
  4033. ástringáhandlingsá .................................................  15. 33
  4034. ástringávariableá ..................................................  11. 53
  4035. áStringsááááááááááá ................................................   1. 22
  4036. ástristrááá ........................................................  38. 39
  4037. ástrlenáááá ........................................................  38. 35
  4038. ástrncmpááá ........................................................  38. 36
  4039. ástrnicmpáá ........................................................  38. 37
  4040. ástrstrá ...........................................................  49.  8
  4041. ástrstráááá ........................................................  38. 38
  4042. ástrtolá ...........................................................  42. 12
  4043. ástrtoláááá ........................................................  38. 40
  4044. ásubstráááá ........................................................  38. 41
  4045. áSubtractioná-áááááááááá ...........................................  19. 49
  4046. áswitchá ...........................................................  27. 28
  4047. áswitchááá .........................................................  26. 27
  4048. áswitchááááá .......................................................  13. 43
  4049. átypedefáá .........................................................  26. 28
  4050. áUnaryáááááááááááááááá .............................................  16. 32
  4051.  
  4052.                                  - Page 57 -
  4053. 93.    INDEX of keywords
  4054.  
  4055. áUnaryáExpressionsááááááá ..........................................  15. 60
  4056. áUnaryáMinusá-áááááá ...............................................  18. 13
  4057. áUnaryáPlusá+ááááááá ...............................................  18. 14
  4058. ávariableáassignsá .................................................  15. 28
  4059. ávariablesá ........................................................  50. 52
  4060. áVariablesááááááááá ................................................   1. 23
  4061. ávolatileá .........................................................  26. 29
  4062. áwhileá ............................................................  14. 30
  4063. áwhileáááá .........................................................  26. 30
  4064. áwhileáááááá .......................................................  13. 44
  4065. Arrayáassigns ......................................................  51. 61
  4066. Conditionaláoperators ..............................................  50. 65
  4067. continue ...........................................................  32. 51
  4068. do .................................................................  32. 51
  4069. do-while ...........................................................  52. 15
  4070. integeráexpression .................................................  52. 55
  4071. read-onlyávariable .................................................  52. 34
  4072. Resizing ...........................................................  51. 20
  4073. statement ..........................................................  52.  9
  4074. statements .........................................................  52. 12
  4075. strcmp()áandástricmp() .............................................  47. 20
  4076. strcmpáandástricmp .................................................  47. 51
  4077. stringáexpression ..................................................  52. 52
  4078. strncmpáandástrnicmp ...............................................  46. 37
  4079. switch() ...........................................................  50. 62
  4080. while ..............................................................  32. 51
  4081.