home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / splot122.zip / OS2SPLOT.HLP next >
Text File  |  1994-10-06  |  46KB  |  1,374 lines

  1. <general>
  2.     To plot a figure load a .spt file. 
  3.  For example: 
  4.  
  5.  <esc> edit demo\logaxes.spt or use the 'Open' 
  6.  button in the 'File' menu. 
  7.  
  8.  then hit CTRL G or 'Exec' button. 
  9.  
  10.     The next section explains how to use the mouse. For 
  11.  help with the editor select help in the editor window. 
  12.  
  13.  Using The Mouse
  14.  
  15.     Double clicking the left mouse button with the mouse on 
  16.  the drawing page inserts the current x,y coordinates into 
  17.  the text file at the current text cursor location. If the 
  18.  mouse cursor is in the text region then hitting the left 
  19.  mouse button will move the current text cursor to the mouse 
  20.  cursor location. The left mouse button is also used to 
  21.  select items in drop down menus. A rubber band box is drawn 
  22.  by pressing the left mouse button with the mouse over the 
  23.  plot window and dragging the mouse with the left button held 
  24.  down. The second point of the box is set to the location at 
  25.  which the button is released. Double clicking the left mouse 
  26.  button in the text window results in an action depending on 
  27.  the type of file and type of word under the mouse cursor. 
  28.  If the word under the cursor is a variable the value of the 
  29.  variable or constant is displayed. If the word is a 
  30.  function then the help screen for that function will be 
  31.  loaded. If the current file has a read only attribute then 
  32.  the editor attempts to interpret the word under the cursor 
  33.  as a file name and subsequently load in that file. 
  34.  
  35.     The right mouse button is used for highlighting 
  36.  elements of a drawing. If the mouse cursor is on top of a 
  37.  displayed element on the drawing page and the right mouse 
  38.  button is hit then the corresponding element is highlighted 
  39.  in intense white and the text cursor jumps to the 
  40.  corresponding line in the text that generated that element. 
  41.  Conversely, if the mouse cursor is on the text side hitting 
  42.  the right mouse button will highlight any graphics elements 
  43.  generated by the line under the mouse cursor. This feature 
  44.  is very useful for finding the code associated with a 
  45.  particular element of a drawing or the reverse. Clicking the 
  46.  right mouse button on a drop down menu item will open a
  47.  help window for that item if available. 
  48.  
  49.     When the mouse cursor is on the drawing page the 
  50.  current coordinates are printed at the bottom. The units 
  51.  and origin used are those in effect at the end of the last 
  52.  program execution. The default units are cm with the origin 
  53.  in the bottom left corner of the page. Pressing the middle 
  54.  mouse button (or both the left and right mouse buttons 
  55.  together on two button mice) with the mouse pointer on the 
  56.  drawing page causes the current coordinate reference point 
  57.  to be reset so that the current coordinate line 
  58.  subsequently reports the distance from this point. 
  59.  
  60.  
  61.     Actions associated with the menu buttons 
  62.  
  63.     There are several menu buttons along the top of the 
  64.  display. The action of these buttons is as follows. 
  65.  Starting at the left top there are four buttons labelled 
  66.  'Draw', 'Slib', 'Cnst', 'SetO' and 'Keyw'. These activate 
  67.  drop down menus which allow a function to be selected and 
  68.  inserted into the text. The 'Draw' functions are a suite of 
  69.  drawing routines which cause lines, arcs, text etc. to be 
  70.  drawn to the page. The 'SetO' menu is a list of textual 
  71.  names for numerical constants which are used in conjunction 
  72.  with the set(); command to change attributes of the current 
  73.  graphics state such as the current colour, line width, line 
  74.  style, axes type, etc. Choosing set from the list of 
  75.  drawing functions automatically opens a menu with only an 
  76.  appropriate subset of these and is the recommended 
  77.  approach. The 'Slib' button allows selection of a standard 
  78.  C library function. Most of these are math functions such 
  79.  as sin() and will not be required for making ordinary 
  80.  plots. They are however useful for manipulating data before 
  81.  plotting or generating data mathematically all from within 
  82.  Splot. The 'Cnst' button opens a menu containing all the 
  83.  constants defined in splot.h. The last button of this group 
  84.  'KeyW' opens a list of C keywords for selection. The only 
  85.  one of these that is of interest for ordinary plots is 
  86.  'main'. Every file that generates a plot or drawing must 
  87.  start with 
  88.  
  89. #include splot.h
  90. main
  91.    {
  92.    /* list of drawing commands go here */ 
  93.    /*   between the braces on as many*/
  94.    /* lines as necessary */
  95.    }
  96.  
  97.     This is all automatically inserted in the text by 
  98.  selecting 'main'. The remaining keywords in this list are 
  99.  only of interest when constructing loops or branches. 
  100.  
  101.     The next button labelled 'Misc' opens a sub menu 
  102.  containing the options 'Reset', 'Redraw' , 'Coord Match' 
  103.  and 'Relative Coord'. 'Reset' resets splot to its initial 
  104.  state and erases the current drawing. The 'Redraw' button 
  105.  can be useful if Splot is in the incremental draw mode in 
  106.  order to fix up blemishes caused by out of order drawing ad 
  107.  erasing. 'Redraw' just re draws the current plot. The button 
  108.  'Coord Match' toggles the current units from cm to units 
  109.  matching those defined in the last axes_box() and back. The 
  110.  button 'Relative Coord' toggles the coordinate display from 
  111.  reporting the absolute coordinate to reporting the distance 
  112.  between the mouse position and the current point defined 
  113.  using the middle mouse button or double clicking the left 
  114.  mouse button over the plot window. 
  115.  
  116.     The next button along the top is concerned with 
  117.  displaying the drawing. The default size of the drawing is 
  118.  one which fits on a standard 8 x 11 inch piece of paper if 
  119.  printed. However, as the screen resolution is not as good 
  120.  as that of printers it is possible to zoom in on part of a 
  121.  drawing in order to get a better view. To zoom in on part 
  122.  of a drawing hold down the left button and drag the mouse 
  123.  to enclose the region of interest. Then select the zoom 
  124.  button and pick the drop down menu item 'Box Zoom'. The 
  125.  button 'Undo Zoom' restores the previous view. The buttons 
  126.  'Save View' and 'Rest View' allow interesting views to be 
  127.  saved on a stack and restored respectively. 
  128.  
  129. <product_info>
  130.  This is Splot version 1.2.0
  131.  
  132.  THIS PROGRAM WAS WRITTEN BY THOMAS W. STEINER
  133.  COPYRIGHT 1992 - 1994, ALL RIGHTS RESERVED
  134.  THERE IS NO WARRANTY OF ANY KIND. USE AT YOUR OWN RISK.
  135.  THIS IS NOT FREEWARE. TO REGISTER YOUR COPY SEND $50 TO 
  136.  
  137.        T.W. Steiner
  138.     312 - 1230 Haro St.
  139.      Vancouver, BC, V6E - 4J9  
  140.           Canada
  141.        e-mail steiner@sfu.ca
  142.  
  143.  Registered users will receive upgrades
  144.  as they become available
  145.  
  146. <abs>
  147.  int abs(int i);
  148.  
  149.  Returns the absolute value of i;
  150.  
  151. <acos>
  152.  double acos(double x);
  153.  
  154.  Returns the arc cosine of the value x. x must be 
  155.  between -1 and 1. Returns a value between 0 and pi. 
  156.  
  157. <asin>
  158.  double asin(double x);
  159.  
  160.  Returns the arc sine of the value x. x must be between 
  161.  -1 and 1. Returns a value between -pi/2 and pi/2. 
  162.  
  163. <atan>
  164.  double atan(double x);
  165.  
  166.  Returns the arc tangent of the value x. Returns a value 
  167.  between -pi/2 and pi/2. 
  168.  
  169. <atan2>
  170.  double atan2(double y,double x);
  171.  
  172.  Returns the arc tangent of the value y/x. Returns a value 
  173.  between -pi and pi. 
  174.  
  175. <atoi>
  176.  int atoi(char *str);
  177.  
  178.  Converts a string to an integer. The string must contain 
  179.  only digits. 
  180.  
  181. <atof>
  182.  double atof(char *str);
  183.  
  184.  Converts a string to a double. The string must contain only 
  185.  digits and 'e', 'E', '.', '-' and '+' . 
  186.  
  187. <ceil>
  188.  double ceil(double x);
  189.  
  190.  Rounds up x to nearest integer value. 
  191.  
  192. <cos>
  193.  double cos(double x);
  194.  
  195.  Returns the cosine of x. x is specified in degrees. 
  196.  
  197. <exit>
  198.  void exit(int status);
  199.  
  200.  Terminates the execution of the program. If the status is 0 
  201.  then it will be considered a normal exit otherwise an error 
  202.  induced exit. 
  203.  
  204. <exp>
  205.  double exp(double x);
  206.  
  207.  Calculates the exponential function e^x. 
  208.  
  209. <fabs>
  210.  double fabs(double x); 
  211.  
  212.  Returns the absolute value of x. It is like abs() but works 
  213.  with floating point numbers rather than integers. 
  214.  
  215. <floor>
  216.  double floor(double x);
  217.  
  218.  Rounds down x to the nearest integer. 
  219.  
  220. <fmod>
  221.  double fmod(double x,double y);
  222.  
  223.  Returns the remainder of x/y. 
  224.  
  225. <free>
  226.  void free(char *ptr);
  227.  
  228.  Frees the block of memory pointed to by ptr. The memory 
  229.  must have been previously allocated using malloc(). 
  230.  
  231. <log>
  232.  double log(double x);
  233.  
  234.  Returns the natural log of x. 
  235.  
  236. <log10>
  237.  double log10(double x);
  238.  
  239.  Returns the log base 10 of x.
  240.  
  241. <malloc>
  242.  char *malloc(int size);
  243.  
  244.  Allocates a block of memory of size bytes and returns a 
  245.  pointer to the block. malloc returns NULL if there is 
  246.  insufficient free memory. 
  247.  
  248. <pow>
  249.  double pow(double x,double y);
  250.  
  251.  Calculates x to the power y.
  252.  
  253. <puts>
  254.  int puts(char *str);
  255.  
  256.  This routine writes the string str to the output file and 
  257.  starts a new line. 
  258.  
  259. <printf>
  260.  int printf(char *format,...);
  261.  
  262.  Prints the formatted data to the output file. The format 
  263.  string specifies the type and number of values to print. 
  264.  Some common examples include: 
  265.  
  266.  printf("i = %d",i); prints the 
  267.  integer value i. 
  268.  
  269.  printf("x = %g",x); prints the 
  270.  floating point value x. 
  271.  
  272.  printf("text = %s",str); prints the 
  273.  string str. 
  274.  
  275.  Multiple values can be printed as in 
  276.  printf("%d %d %g %s",i,j,x,str); 
  277.  
  278.  The format specifiers can also include field width 
  279.  information and justification etc. Consult a standard C 
  280.  text for more details. 
  281.  
  282. <print>
  283.  void print(v,...);
  284.  
  285.  Prints the value v which can be of any scalar type. i.e 
  286.  int, char, float, double or a pointer. This is not a 
  287.  function found in the standard C library. 
  288.  
  289. <sin>
  290.  double sin(double x);
  291.  
  292.  Returns the sine of x. x must be specified in degrees. 
  293.  
  294. <sqrt>
  295.  double sqrt(double x);
  296.  
  297.  Calculates the square root of x. x must be a positive 
  298.  number. 
  299.  
  300. <sizeof>
  301.  int sizeof(t);
  302.  
  303.  Returns the number of bytes required to store the value of 
  304.  type t. 
  305.  
  306. <sprintf>
  307.  int sprintf(char str,char 
  308.      *format,...); 
  309.  
  310.  Prints the formatted data to the string str. The format 
  311.  string specifies the type and number of values to print. 
  312.  Some common examples include: 
  313.  
  314.  printf("i = %d",i); prints the 
  315.  integer value i. 
  316.  
  317.  printf("x = %g",x); prints the 
  318.  floating point value x. 
  319.  
  320.  printf("text = %s",str); prints the 
  321.  string str. 
  322.  
  323.  Multiple values can be printed as in 
  324.  printf("%d %d %g %s",i,j,x,str); 
  325.  
  326.  The format specifiers can also include field width 
  327.  information and justification etc. Consult a standard C 
  328.  text for more details. 
  329.  
  330. <strcat>
  331.  void strcat(char *dest, char 
  332.       *source); 
  333.  
  334.  Concatenates the string source to the string dest. 
  335.  
  336. <strcpy>
  337.  void strcpy(char *dest, char 
  338.       *source); 
  339.  
  340.  Copies the string source to the string dest. 
  341.  
  342. <strlen>
  343.  int strlen(char *str);
  344.  
  345.  Returns the length of the string str. 
  346.  
  347. <tan>
  348.  double tan(double x);
  349.  
  350.  Calculates the value of the tangent of x. x should be 
  351.  specified in degrees. 
  352.  
  353. <abox>
  354.  void abox(double xsi, double 
  355.        ysi, double xorig,
  356.        double yorig); 
  357.   
  358.  Adds an axes box to the current path. The box is drawn with 
  359.  a size of xsi by ysi and centered on the page. No internal 
  360.  coordinate system is set up. Use ascale() for this or use 
  361.  axes_box() to combine both functions. The last two 
  362.  parameters are optional and if present, specify the position 
  363.  of the axes origin relative to the page origin. For the 
  364.  last two parameters the special constants XCENTER and 
  365.  YCENTER can be used for the x or y position coordinate 
  366.  respectively and will cause the axes box to be centered on 
  367.  the page along that axis. Using both XCENTER and YCENTER is 
  368.  equivalent to the default behaviour with the last two 
  369.  parameters absent. abox() is implicitly stroked.
  370.  
  371. <alineto> 
  372.  void alineto(double len, double 
  373.      ang); 
  374.  
  375.  Adds a line of length len at an angle of ang with respect 
  376.  to the previous line to the current path. Generates an 
  377.  error if there is no previous line in the current path. 
  378.  
  379. <arc>
  380.  void arc(double xcen, double ycen, double rad, double 
  381.        alpha, double beta); 
  382.   
  383.  Adds a circular arc of radius rad centered at (xcen, ycen) 
  384.  to the current path. The starting angle is alpha and the 
  385.  stopping angle is beta. The arc is drawn in the counter 
  386.  clockwise direction. A straight line section will be added 
  387.  from the previous current point if any to the starting 
  388.  point of the arc. 
  389.   
  390. <arcn>
  391.  void arcn(double xcen, double ycen, double rad, double 
  392.        alpha, double beta); 
  393.   
  394.  Adds a circular arc of radius rad centered at (xcen, ycen) 
  395.  to the current path. The starting angle is alpha and the 
  396.  stopping angle is beta. The arc is drawn in the clockwise 
  397.  direction. A straight line section will be added from the 
  398.  previous current point if any to the starting point of the 
  399.  arc. Exactly as arc() but draws the arc in the opposite 
  400.  direction. 
  401.   
  402. <arcto>
  403.  void arcto(double x1, double y1, double x2, double y2, 
  404.         double rad); 
  405.   
  406.  Adds a circular arc of radius rad to the current path. The 
  407.  center and angles are chosen so that the arc is tangent to 
  408.  the line formed by (x1,y1) and the current point at its 
  409.  start and tangent to the line (x1,y1) - (x2,y2) at its end 
  410.  point. A straight line segment is added from the current 
  411.  point to the start of the arc. An error is generated is 
  412.  there is no current point. 
  413.   
  414. <arrowto> 
  415.  void arrowto(double x,double y,...); 
  416.   
  417.  Adds a line segment to the current path from the current 
  418.  point to (x,y). The line is terminated by drawing an arrow 
  419.  head oriented in the direction of the line. More than one 
  420.  coordinate point can be specified in the command in which 
  421.  case a series of line segments terminated by arrows 
  422.  connecting the points will be added to the current path. If 
  423.  there is no current point then an error will be generated. 
  424.  The size of the arrow head may be changed with the 
  425.  set(FONTWIDTH,...); command.
  426.   
  427. <ascale>
  428.  void ascale(int axes, double xstart, double ystart, double 
  429.       xend, double yend); 
  430.  
  431.   or
  432.  
  433.  void ascale(int axes, double *data, int col,...); 
  434.  
  435.  An internal coordinate system is set up for subsequent 
  436.  plotting of data within the existing axes box. The x axis 
  437.  start and stop values are xstart and xend respectively and 
  438.  ystart, yend for the y axis. for the y axis. If the axis 
  439.  choice is XAXES or YAXES rather than XYAXES then only two 
  440.  numbers follow the axes specifier rather than four. This 
  441.  allows the x and y axes scales to be set independently of 
  442.  each other. The alternate format allows for auto scaling to 
  443.  the specified data. There can be more than one data array 
  444.  in the list in which case the scales are chosen so that 
  445.  they will all fit. Each data array can optionally be 
  446.  followed by one or two integers specifying which columns to 
  447.  use for the x and y values. If axes is not XYAXES only one 
  448.  integer is allowed. 
  449.   
  450. <axes_box>
  451.  void axes_box(double xsi, double ysi, double xstart, double 
  452.        ystart, double xend, double yend,double xorig, double 
  453.        yorig); 
  454.   
  455.  Adds an axes box to the current path. The box is drawn with 
  456.  a size of xsi by ysi and centered on the page. An internal 
  457.  coordinate system is set up for subsequent plotting of data 
  458.  within the box. The x axis start and stop values are xstart 
  459.  and xend respectively and ystart, yend for the y axis. for 
  460.  the y axis. The last two parameters are optional and if 
  461.  present specify the position of the axes origin relative to 
  462.  the page origin. For the last two parameters the special 
  463.  constants XCENTER and YCENTER can be used for the x or y 
  464.  position coordinate respectively and will cause the axes 
  465.  box to be centered on the page along that axis. Using both 
  466.  XCENTER and YCENTER is equivalent to the default behaviour 
  467.  with the last two parameters absent. More flexibility is 
  468.  provided by the pair of functions abox() and ascale() which 
  469.  provide the functionality of axes_box() in several steps. 
  470.  axes_box() is implicitly stroked.
  471.   
  472. <box>
  473.  void box(double x1, double y1, double x2, double y2); 
  474.   
  475.  Adds a box to the current path. The two end points of the 
  476.  box are (x1,y1) and (x2,y2); 
  477.   
  478. <clear>
  479.  void clear();
  480.   
  481.  Clears the screen when the program is executed. 
  482.  This function should not be needed for ordinary plots. 
  483.   
  484. <clip>
  485.  void clip()
  486.   
  487.  Converts the currently defined path into a clipping path. 
  488.  All subsequent drawing operations are then clipped against 
  489.  this path and only portions of the drawing on the inside of 
  490.  the clip path are displayed. What is inside and what is 
  491.  outside depends on whether even-odd or non-zero wind has 
  492.  been selected as the fill rule using a set(); If the 
  493.  current path is not closed then the current path is first 
  494.  closed. If there is no current path an error is generated. 
  495.  Clip() is implicitly stroked and takes effect immediately.
  496.   
  497. <closepath>
  498.  void closepath(); 
  499.   
  500.  Closes the current path. A straight line segment is added 
  501.  from the current point to the start of the current path as 
  502.  set by the moveto() of rmoveto() command at the beginning 
  503.  of the path definition. Generates an error if there is no 
  504.  current point. 
  505.  
  506. <cmatch>
  507.  void cmatch(int on);
  508.  
  509.  If the passed parameter is TRUE then it does the necessary 
  510.  translations and scaling so that the coordinate system for 
  511.  the page matches that used within the axes_box. An error is 
  512.  generated if there is no current axes_box. The font scale 
  513.  is compensated automatically for the change in coordinate 
  514.  system so that characters will still be the same size as 
  515.  before. If the parameter is FALSE then the previous 
  516.  unmatched coordinates will be restored. If there is no 
  517.  parameter TRUE is assumed. 
  518.  
  519. <curveto>
  520.  void curveto(double x1, double y1, double x2, double y2, 
  521.           double x3, double y3); 
  522.   
  523.  Adds a Bezier curve section to the current path starting 
  524.  at the current point. The curve starts tangent to 
  525.  (xcur,ycur) - (x1,x2) and ends tangential to (x2,y2) - 
  526.  (x3,y3) at (x3,y3); An error is generated if there is no 
  527.  current point. 
  528.   
  529. <drawdata>
  530.  void drawdata(double *data, int xcol, int ycol); 
  531.   
  532.  Draws the data contained in the array data in the current 
  533.  axes_box. The numbers xcol and ycol are the columns of the 
  534.  array data that are to be used for the x-axis and y-axis 
  535.  data respectively. Each row of the array data represents 
  536.  one coordinate point to be plotted. The values will be 
  537.  plotted using the internal coordinate system established by 
  538.  the the call to axes_box. If there is no current axes box 
  539.  an error will be generated. The xcol and ycol params are 
  540.  optional. If no values are given then xcol = 0 and ycol = 1 
  541.  are assumed. drawdata() is implicitly stroked.
  542.  
  543. <errorbars>
  544.  void errorbars(int axes,double *data, int xcol, int ycol, 
  545.         int errcol); 
  546.  
  547.  Draws error bars for the data points in the array "data". 
  548.  The first parameter is either XVALS or YVALS indicating 
  549.  along which axes the error bars are to be drawn. The 
  550.  numbers xcol and ycol are the columns of the array data 
  551.  that are to be used for the x-axis and y-axis data 
  552.  respectively. Each row of the array data represents one 
  553.  coordinate point to be plotted. The values will be plotted 
  554.  using the internal coordinate system established by the the 
  555.  call to axes_box. The last parameter "errcol" is the column 
  556.  of the array "data" which holds the size of the error for 
  557.  the corresponding data point in the same row. If there is 
  558.  no current axes box an error will be generated. 
  559.  errorbars() is implicitly stroked.
  560.   
  561. <fill>
  562.  void fill(); 
  563.    
  564.  Closes the current path if not already closed and fills the 
  565.  interior region with the current colour as specified by the 
  566.  last set() call. What is inside and what is outside the 
  567.  path depends on the currently chosen fill rule. The fill 
  568.  rule is either even-odd or non-zero wind (the default) and 
  569.  is specified using a set() call. An error is generated if 
  570.  there is no current path. 
  571.  
  572. <fitline>
  573.  void fitline(double *data, int xcol, 
  574.   int ycol,double *yint,double *slope);
  575.  
  576.  Fits the best straight line to the data in the array "data" 
  577.  using the column xcol of the array as the x values and the 
  578.  column ycol as the corresponding y values. The best line is 
  579.  drawn constrained to the current axes box. If there is no 
  580.  current axes box an error is generated. The last two 
  581.  parameters are the returned values giving the y intercept 
  582.  and slope of the fitted line. Note that they are pointers 
  583.  to doubles which must be declared at the top of the 
  584.  program. Given a declaration of the form: 
  585.   
  586.      double slope,yint;
  587.  
  588.  Call fitline using:
  589.  
  590.      fitline(data,0,1,&yint,&slope);
  591.  
  592.  Assuming that the first and second column of data are the x 
  593.  and y values respectively. Data points can be excluded from 
  594.  the fit by using the set(XRANGE,xmin,xmax); or 
  595.  set(YRANGE,ymin,ymax); commands. Only data points within 
  596.  the limits will be used for the fit. fitline() is 
  597.  implicitly stroked.
  598.   
  599. <get>
  600.  int or double get(int option, char *str); 
  601.  
  602.  Returns the value of the specified option in the current 
  603.  graphics state. The numerical value for single valued 
  604.  elements is returned by the function otherwise the return 
  605.  value is 0. A text representation of the value is optionally 
  606.  returned in str. If used, be sure to allocate a character 
  607.  array with sufficient space for str before calling this 
  608.  function as in char str[80]; at the top of the program. The 
  609.  valid option values are defined in splot.h. See also set() 
  610.  for a description of the various options. The returned 
  611.  string can be printed using the command puts(str); in the 
  612.  program where "str" is the name of the array in the call to 
  613.  get(). Returned numerical values can be printed using 
  614.  print(value); The second array parameter is optional and is 
  615.  only really needed for getting options that are more than 
  616.  just a single value such as line patterns.
  617.  
  618. <grestore>
  619.  void grestore(); 
  620.   
  621.  Pops a graphics state off the state stack thereby restoring 
  622.  the graphics state that was in effect at the time the 
  623.  matching gsave() was executed. In particular, the path, the 
  624.  clip path, the line styles, line colours etc. are restored 
  625.  to their previous values. 
  626.   
  627. <gsave>
  628.  void gsave(); 
  629.   
  630.  Pushes the current graphics state onto the state stack. The 
  631.  current path, clip path, line style, colour etc. are saved 
  632.  so that they can be restored later using a grestore() 
  633.  command. 
  634.   
  635. <label>
  636.  void label(int axis, char *label); 
  637.   
  638.  Add labels to the axes box previously defined. The first 
  639.  parameter is which axis to label either BOTTOM, TOP, LEFT 
  640.  or RIGHT. The following parameter is the label to be 
  641.  printed. The label will be printed centered between the 
  642.  appropriate edges of the current axes box. An error is 
  643.  generated if there is no current axes box. All labels 
  644.  should be after plotdata() if used otherwise spacing from 
  645.  the axes may not be correct. The spacing can also be 
  646.  changed using set(LABELMARG,...);. label() is implicitly 
  647.  stroked. 
  648.  
  649.   
  650.   
  651. <lineto>
  652.  void lineto(double x,double y,...); 
  653.   
  654.  Adds a line segment to the current path from the current 
  655.  point to (x,y). More than one coordinate point can be 
  656.  specified in the command in which case a series of line 
  657.  segments connecting the points will be added to the current 
  658.  path. If there is no current point then an error will be 
  659.  generated. 
  660.   
  661. <moveto>
  662.  void moveto(double x, double y); 
  663.   
  664.  Sets the current point to (x,y). Also sets the path close 
  665.  point to (x,y) for subsequent use with closepath(). Many 
  666.  path building commands such as curveto() and lineto() require 
  667.  that a current point exist before calling them. 
  668.   
  669. <newpath>
  670.  void newpath(); 
  671.   
  672.  Resets the current path to NULL and also causes the current 
  673.  point to be undefined. Furthermore, it turns off the 
  674.  implicit stroking of elements that are normally implicitly 
  675.  stroked such as text();. Thus using newpath(); these 
  676.  elements can be added to a path which must then be 
  677.  explicitly stroked. stroke() turns on implicit stroking 
  678.  again.
  679.   
  680. <plotdata>
  681.  void plotdata(double *data, int xcol, int ycol); 
  682.   
  683.  Plots the data found in array data in a box. This command 
  684.  chooses the scale sizes tick marks etc. to display the data 
  685.  which is assumed to be in order of monotonically increasing 
  686.  or decreasing x value order. The parameters xcol and ycol 
  687.  specify which columns of the array data to use for the x 
  688.  and y values respectively. The xcol and ycol params are 
  689.  optional. If no values are given then xcol = 0 and ycol = 1 
  690.  are assumed. If the default choices of plotdata are not 
  691.  acceptable a plot can be generated using the step by step 
  692.  method using axes_box(), tickmarks(), ticklabels() and 
  693.  drawdata(). The data must first be read in to array data 
  694.  using readdata(). plotdata() is implicitly stroked. 
  695.   
  696. <rarrowto>
  697.  void rarrowto(double x, double y,...); 
  698.   
  699.  Adds a line segment to the current path from the current 
  700.  point to the current point plus x, y. The line is 
  701.  terminated by drawing an arrow head oriented in the 
  702.  direction of the line. This command is identical to arrowto 
  703.  except that the displacement is specified relative to the 
  704.  current point. More than one coordinate point can be 
  705.  specified in the command in which case a series of line 
  706.  segments terminated by arrows connecting the points will be 
  707.  added to the current path. If there is no current point 
  708.  then an error will be generated. The size of the arrow 
  709.  head may be changed with the set(FONTWIDTH,...); command.
  710.  
  711. <readdata>
  712.  void readdata(char * filename, double * data); 
  713.   
  714.  Reads a file of name filename and puts the data into the 
  715.  array "data". The file should be in ASCII format with the x 
  716.  data in one column and the y data values next column(s). 
  717.  Any line containing non numeric characters or is blank will 
  718.  be considered a comment and ignored. WARNING! As an 
  719.  optimization data is only read from disk once if the
  720.  configuration parameter always_load is off. Subsequent 
  721.  executions use the stored data already in memory (except 
  722.  after a reset). This means that if you modify the array 
  723.  "data" after reading in values the next time the file is 
  724.  executed you will get strange results. Similarly, if you 
  725.  reuse the same array for different plots in the same 
  726.  drawing you will have trouble. The motto is never change 
  727.  the values in the array "data". If you want to change the 
  728.  values declare another array and copy the values. Also 
  729.  remember that readdata() implicitly allocates memory for 
  730.  the data array so it is correct to declare the data array 
  731.  as double *data; at the top. If however, you are going to 
  732.  fill in a new array with calculated values you need to 
  733.  declare the array as double newdata[ysize][xsize]; so that 
  734.  space will be allocated. 
  735.   
  736.   
  737. <reset>
  738.  void reset(); 
  739.   
  740.  Restores all set able parameters to their default values. 
  741.  Clears the current path and clip path. 
  742.   
  743. <rlineto>
  744.  void rlineto(double x,double y,...); 
  745.   
  746.  Adds a line segment to the current path from the current 
  747.  point to the current point plus x, y. This command is 
  748.  identical to lineto except that the displacement is 
  749.  specified relative to the current point. More than one 
  750.  coordinate point can be specified in the command in which 
  751.  case a series of line segments connecting the points will 
  752.  be added to the current path. If there is no current point 
  753.  then an error will be generated. 
  754.   
  755. <rmoveto>
  756.  void rmoveto(double x, double y); 
  757.   
  758.  Sets the current point to the current point plus x,y. This 
  759.  command is the same as moveto except that a relative move 
  760.  is specified. It also sets the path close point for 
  761.  subsequent use with closepath(). Many path building 
  762.  commands such as curveto and lineto require that a current 
  763.  point exist before calling them. 
  764.   
  765. <rotate>
  766.  void rotate(double ang); 
  767.   
  768.  Rotates the figure about the
  769.  current origin by the the angle 
  770.  specified. The angle units are
  771.  degrees and the +ve direction
  772.  is counterclockwise.  
  773.  Changes in rotation are cumulative.
  774.   
  775. <scale>
  776.  void scale(double xs, double ys); 
  777.   
  778.  Changes the scale of the figure
  779.  by the factors specified for
  780.  the x and y axes respectively.
  781.  Changes in scale are cumulative.
  782.   
  783. <set>
  784.  void set(int option, ...); 
  785.   
  786.  All set able parameters can be set using the set command. 
  787.  The first parameter specifies which option to set. The 
  788.  defined constants corresponding to valid options are 
  789.  defined in the header file splot.h. What follows is a very 
  790.  brief description of all the values set able using set(). 
  791.  
  792.  set(AXESCLIP,val);
  793.  If val is ON then the data values are clipped to the limits 
  794.  of the axes box. This is temporarily added to the user set 
  795.  clip limits if any. If val is OFF (the default) then the 
  796.  user specified clip limits from the last clip() call are 
  797.  used. 
  798.  Alternatively the range of data values plotted can be set
  799.  using set(XRANGE,...); set(YRANGE,...); .
  800.  
  801.  set(AXESTYPE,val); 
  802.  AXESTYPE may be one of the following. LINEAR (the default), 
  803.  LOGX, LOGY, LOGLOG, INVX, INVY, INVINV, INVXLOGY or 
  804.  LOGXINVY. The position of data points and tickmarks are 
  805.  automatically adjusted to account for the axes type. 
  806.  
  807.  set(CURSYMBOL,sym);
  808.  Sets the symbol to use when plotting data with symbols. sym 
  809.  must be one of OCIRCLE,OSQUARE,OTRIANGLE,ODIAMOND 
  810.  OSTAR,OARROW,PLUS,CROSS,MULT,CIRCLE,SQUARE,TRIANGLE, 
  811.  DIAMOND,STAR,or ARROW. The default symbol is CIRCLE. The 
  812.  size of a symbol can be changed using set(FONTWIDTH, 
  813.  val_in_cm); since symbols are just a special font. 
  814.  The size of a symbol can be changed using set(FONTWIDTH,
  815.  val_in_cm); since symbols are just a special font. The 
  816.  size relative to the current FONTWIDTH can be set using 
  817.  set(SYMMULT,mult);. 
  818.  
  819.  set(FILLRULE,type);
  820.  Determines the rule to be used when filling a path. Type 
  821.  must be one of NONZWIND (default) or EVENODD. 
  822.  
  823.  set(FLATNESS,num);
  824.  Sets the maximum allowable error in pixels when converting 
  825.  a curve to a set of straight line segments. Smaller values 
  826.  of num give smother curves but take longer to process. The 
  827.  default value of num is 1.
  828.   
  829.  set(FONT,fonttype);
  830.  Sets the font type to use for subsequent text written using 
  831.  the text(); routine. fontname type be either SIMPLEX 
  832.  (default) or COMPLEX. 
  833.   
  834.  set(FONTASPECT,asp);
  835.  Sets the ratio of the glyph height to width used for text 
  836.  written using text();. The default value is 2.0 
  837.   
  838.  set(FONTDIR,angle);
  839.  Sets the rotation angle with respect to the x axis to use 
  840.  when writing text using text(); The default is 0. 
  841.   
  842.  set(FONTMULT,factor);
  843.  Multiplies the current font size by the given factor. 
  844.   
  845.  set(FONTWIDTH,wid);
  846.  Sets the average width of the characters written using 
  847.  text(). The default value is 0.7 cm. FONTWIDTH applies also 
  848.  to symbols. 
  849.  
  850.  set(LABELMARG,val);
  851.  Sets the additional margin between the axes box and the 
  852.  labels. The default is 0.0 cm. 
  853.   
  854.  set(LINECAP,type);
  855.  Determines how thick lines are to be terminated. The 
  856.  allowed types are BUTTCAP (default), ROUNDCAP and PROJCAP. 
  857.   
  858.  set(LINECOLOUR,col); 
  859.  Where col is one of INVIS, BLACK, BLUE, GREEN, CYAN, RED, 
  860.  MAGENTA, BROWN or WHITE. This set the colour to use when 
  861.  the current path is stroked or filled. The default colour 
  862.  is BLACK with the background WHITE. 
  863.  
  864.  set(LINEJOIN,type);
  865.  Determines how thick lines are joined together. The allowed 
  866.  join types are MITERJOIN (default), BEVELJOIN and 
  867.  ROUNDJOIN. 
  868.  
  869.  set(LINESTYLE,pattern,...);
  870.  Sets the line style to use for the path when it is stroked. 
  871.  The constant LINESTYLE is followed by a list of floating 
  872.  point values that define the pattern. The values are 
  873.  interpreted as the length along the path that the line is 
  874.  visible followed by the length that it is invisible as an 
  875.  alternating sequence wrapping back to the beginning when 
  876.  the pattern reaches the end. For example a pattern of 
  877.  1.0,1.0 implies on for 1 cm followed by off for 1 cm. A 
  878.  pattern of 1.0,0.5 is on for 1 cm followed by off for 0.5 
  879.  cm. The predefined patterns are: SOLID 0 (default) DASHED 
  880.  1.0,0.5 DOTTED 0.2,0.2 and DOTDASH 1.0,0.5,0.2,0.5. There
  881.  must always be an even number of comma separated values
  882.  in a pattern definition.
  883.   
  884.  set(LINEWIDTH,width);
  885.  Sets the line width to width cm (default 0.05 cm). This 
  886.  line width is used when the current path is stroked. 
  887.   
  888.  set(MITERLIMIT,maxratio);
  889.  Sets the maximum length of spikes formed by miter joining 
  890.  two lines at an acute angle. If the ratio of the length of 
  891.  the spike to the width exceeds the value of maxratio then a 
  892.  BEVELJOIN is done instead. The default value is 10.0. 
  893.  
  894.  set(PAGEROT,flag);
  895.  Selects landscape orientation if flag is ON. 
  896.  Default is portrait.
  897.  
  898.  set(PATTOFF,offset);
  899.  Sets the offset into the current LINESTYLE pattern. Can be
  900.  used to adjust the starting point of a pattern for aesthetic
  901.  reasons.
  902.   
  903.  set(PLOTTYPE,type);
  904.  Sets the current plot type. type must be one of LINES 
  905.  (default), SYMBOLS or SYM_LINES. LINES connects data points 
  906.  with line segments while SYMBOLS causes the current symbol 
  907.  to be drawn at each data point. SYM_LINES does both. 
  908.  The size of a symbol can be changed using set(FONTWIDTH, 
  909.  val_in_cm); since symbols are just a special font. The size 
  910.  relative to the current FONTWIDTH can be set using 
  911.  set(SYMMULT,mult);. 
  912.   
  913.  set(SCALEALL,val);
  914.  If val is ON then the XSHIFT, YSHIFT, XMULT, YMULT values 
  915.  are applied to all coordinates (i.e. in lineto, moveto etc.). 
  916.  The default is OFF in which case only data plotted using 
  917.  plotdata or drawdata is affected by these values. 
  918.  
  919.  
  920.  set(SCRIPTSCALE,val);
  921.  Sets the relative height of a super/sub script as compared 
  922.  to ordinary text. The default value is 0.5. 
  923.  
  924.  set(SCRIPTSHIFT,val);
  925.  Sets the distance that a super/sub script is shifted 
  926.  above/below ordinary text. The value is specified as a 
  927.  fraction of the ordinary text height. The default value is 
  928.  0.7. 
  929.  
  930.  set(SYMMULT,val)
  931.  Sets the symbol size multiplier used when drawing symbols. 
  932.  The default value is 1.0. The actual symbol size is 
  933.  determined the current FONTWIDTH multiplied by the curent 
  934.  SYMMULT value.
  935.  
  936.  set(TICKLENGTH,len);
  937.  Sets the length of axis tick marks to be used. The default 
  938.  value is 0.3 cm. 
  939.  
  940.  set(TICKLMARG,len);
  941.  Sets the margin between the axes box and the tick labels. 
  942.  The default is 0.0 cm. 
  943.   
  944.  set(XMULT,xmul);
  945.  Causes each x value to be multiplied by xmul before being 
  946.  plotted. 
  947.   
  948.  set(XRANGE,xmin,ymin);
  949.  data plotted using drawdata is constrained to have x 
  950.  values between xmin and xmax. There is also a corresponding 
  951.  YRANGE set option. The default is no constraints. The 
  952.  values should be specified in user coordinates i.e. those 
  953.  established by the current axes_box() or ascale(). 
  954.  
  955.  set(XSHIFT,xshft);
  956.  Causes the value xshft to be added to all x values before 
  957.  plotting. 
  958.   
  959.  set(YMULT,ymul);
  960.  Causes each y value to be multiplied by ymul before being 
  961.  plotted. 
  962.  
  963.  set(YSHIFT,yshft);
  964.  Causes the value yshft to be added to all y values before 
  965.  plotting. 
  966.   
  967.  
  968. <showpage>
  969.  void showpage();
  970.   
  971.  Transfers the marked page created in memory by the stroke 
  972.  and fill commands to the physical page. This is 
  973.  automatically done at the end of the file and thus this
  974.  command is only needed if it is desirable to draw parts
  975.  of the figure before the end of execution.
  976.   
  977. <stroke>
  978.  void stroke(); 
  979.   
  980.  Marks the page in memory with the current path. The path 
  981.  coordinates are transformed using the current coordinate 
  982.  transformation matrix and the path is fleshed out using the 
  983.  current line width, style and colour in effect at the time 
  984.  of the stroke command. 
  985.   
  986. <symbol>
  987.  void symbol(double x, double y, int symbol_const); 
  988.  or
  989.  void symbol(int symbol_const); 
  990.  
  991.  Plots the symbol chosen by symbol_const at the point x,y. 
  992.  symbol_const must be one of OCIRCLE, OSQUARE, OTRIANGLE, 
  993.  ODIAMOND OSTAR, OARROW, PLUS, CROSS, MULT, CIRCLE, SQUARE, 
  994.  TRIANGLE, DIAMOND, STAR,or ARROW. If the point x,y is 
  995.  omitted the symbol is drawn at the current point as set 
  996.  by a previous moveto();. symbol() is not implicitly 
  997.  stroked so follow with a stroke();. The size of a symbol 
  998.  can be changed using set(FONTWIDTH, val_in_cm); since 
  999.  symbols are just a special font. The size relative to the 
  1000.  current FONTWIDTH can be set using set(SYMMULT,mult);. 
  1001.  
  1002. <text>
  1003.  void text(double x, double y, char * str,int just); 
  1004.   
  1005.  Adds the text string str to the current path starting at 
  1006.  location (x,y). The current font, size and orientation as 
  1007.  set using the set() command are used. Super/sub scripts can 
  1008.  be entered as ^2^ and _2_ respectively. Letters surrounded 
  1009.  by '!' or '#' are printed in Greek or italics respectively. 
  1010.  For example !m! generates the Greek lower case mu. The 
  1011.  special characters "^_!#$\" can be printed by preceding them 
  1012.  with \ as in \!. The combination \b back spaces by one 
  1013.  character. Symbols may be included in the text string by 
  1014.  enclosing them with $ as in $3$.
  1015.  If the starting x,y coordinates are omitted then 
  1016.  the current string is positioned one line below the 
  1017.  previous string added to the path using text(). The last 
  1018.  parameter is the justification and must be one of LEFT, 
  1019.  RIGHT or CENTER. This last parameter can be omitted in 
  1020.  which case the default value of LEFT will be used. text() 
  1021.  is implicitly stroked.
  1022.   
  1023. <ticklabel>
  1024.  void ticklabel(int axis, double v, char *label,...); 
  1025.   
  1026.  Add tick labels to the axes box previously defined. The 
  1027.  first parameter is which axis to label either BOTTOM, TOP, 
  1028.  LEFT or RIGHT. The following parameters are paired values 
  1029.  giving the tick position in data coordinates as established 
  1030.  by a prior call to axes_box() or ascale() and the text 
  1031.  string to be placed at that location. An error is generated 
  1032.  if there is no current axes_box. There are several default 
  1033.  possibilities. If 'ticklabel();' is called without any 
  1034.  parameters then if tick marks have been generated 
  1035.  previously using 'tickmarks();' then they will be 
  1036.  selectively labelled along the left and bottom axes. If 
  1037.  only an axis parameter is given then the corresponding axis 
  1038.  tick marks if any will be labelled. If the axis parameter 
  1039.  is followed by a list of numbers only they will be 
  1040.  assumed to be both the tick position and the desired label. 
  1041.  If the numbers are paired with strings in the parameter 
  1042.  list then the number will be used as the tick label 
  1043.  position and the string will be used as the literal label. 
  1044.  The spacing between the tick labels and the axes box can be 
  1045.  changed using set(TICKLMARG,...); ticklabel() is implicitly 
  1046.  stroked.
  1047.   
  1048. <tickmarks>
  1049.  void tickmarks(int axis, double v,...); 
  1050.   
  1051.  Add tick marks to the axes box previously defined. The 
  1052.  first parameter is which axis either BOTTOM , TOP, LEFT, 
  1053.  RIGHT ,XAXES or YAXES. The following numbers are the 
  1054.  positions were tickmarks are to to be placed. The length of 
  1055.  the ticks is set using a set(TICKLENGTH,val) command. The 
  1056.  location of the ticks is specified in data coordinates as 
  1057.  established by the prior call to axes_box(). An error is 
  1058.  generated if there is no current axes_box. All the above 
  1059.  parameters are optional. The default behaviour is as 
  1060.  follows. If all parameters are omitted tick marks will be 
  1061.  automatically generated for all axes. If only an axis 
  1062.  specifier is given then tick marks will be generated for 
  1063.  the corresponding axis or axes. In these cases 
  1064.  'tickmarks();' will try to find reasonable positions for a 
  1065.  set of tick marks. If this default behaviour is 
  1066.  unacceptable then the actual tick positions can be 
  1067.  specified as a list of values following the axis specifier. 
  1068.  If there is only one numeric value it is interpreted as a 
  1069.  tick spacing. tickmarks() is implicitly stroked.
  1070.   
  1071. <translate>
  1072.  void translate(double tx, double ty);
  1073.   
  1074.  Translates the origin of the 
  1075.  figure by the x and y distances
  1076.  specified. Translations are 
  1077.  cumulative.
  1078.  
  1079. <whereis>
  1080.  void whereis(double *x,double *y); 
  1081.  
  1082.  Returns the coordinates of the current point as set by the 
  1083.  last moveto(), lineto() etc. 
  1084.  
  1085. <break>
  1086.  C keyword 
  1087.  
  1088.  Used to prematurely terminate a loop; 
  1089.  
  1090.  Example:
  1091.  
  1092.  for (i = 0;i< 100; i++)
  1093.     {
  1094.     if (cond == 1) break;
  1095.     /* if cond == 1 break out of the
  1096.     loop regardless of the value of
  1097.     i and continue at end of loop. */
  1098.     }
  1099.  
  1100. <case>
  1101.  C keyword
  1102.  
  1103.  Used in conjunction with a switch to select one of a set of 
  1104.  choices. 
  1105.  
  1106.  Example:
  1107.     
  1108.   switch(code)
  1109.      {
  1110.      case 0:/* do something if code = 0*/
  1111.         break;
  1112.      case 1:/* do this if code = 1*/
  1113.         break;   
  1114.      case 2:
  1115.      case 3:/* do this if code = 1 or 2*/
  1116.         break;
  1117.      default:/* do this if none of the
  1118.            above */ 
  1119.        break;
  1120.      }
  1121.  
  1122. <char>
  1123.  C keyword
  1124.  
  1125.  Used to allocate memory for a variable of size one byte. 
  1126.  All chars are between -128 and 127. All variable 
  1127.  declarations must be done outside of the main routine for 
  1128.  globals or immediately after the function declaration for 
  1129.  local variables. 
  1130.  
  1131.  Example:
  1132.  
  1133.   char c;
  1134.  
  1135.  Arrays of base types can be specified using the syntax: 
  1136.  
  1137.   char tmp[80];
  1138.  
  1139.  Pointers to a base type are specified as 
  1140.  
  1141.   char *tp;
  1142.  
  1143. <continue>
  1144.  C keyword
  1145.  
  1146.  Used to skip the remainder of a loop and test the condition 
  1147.  again. 
  1148.  
  1149.  Example:
  1150.  
  1151.  for (i = 0;i< 100; i++)
  1152.     {
  1153.     if (cond == 1) continue;
  1154.     /* if not cond == 1 do the rest
  1155.     of the loop below the above line 
  1156.     otherwise increment i and test
  1157.     again.
  1158.     }
  1159.  
  1160.  
  1161. <default>
  1162.  C keyword
  1163.  
  1164.  Used in conjunction with a switch to select the remaining 
  1165.  not explicitly specified choices. 
  1166.  
  1167.  Example:
  1168.     
  1169.  switch(code)
  1170.     {
  1171.     case 0:/* do something if code = 0*/
  1172.        break;
  1173.     case 1:/* do this if code = 1*/
  1174.        break;   
  1175.     case 2:
  1176.     case 3:/* do this if code = 1 or 2*/
  1177.        break;
  1178.     default:/* do this if none of the
  1179.            above */ 
  1180.        break;
  1181.     }  
  1182.  
  1183. <do>
  1184.  C keyword
  1185.  
  1186.  Used in conjunction with while to set up loops that are 
  1187.  executed at least once. For Example: 
  1188.  
  1189.  do
  1190.     {
  1191.     /* loop body */
  1192.     }
  1193.  while (cond ==  1);
  1194.  
  1195. <double>
  1196.  C keyword
  1197.  
  1198.  Used to allocate memory for a double precision floating 
  1199.  point value. All variable declarations must be done outside 
  1200.  of the main routine for globals or immediately after the 
  1201.  function declaration for local variables. 
  1202.  
  1203.  Example:
  1204.  
  1205.  double d;
  1206.  
  1207.  Arrays of base types can be specified using the syntax (2 x 
  1208.  400 array): 
  1209.  
  1210.  double data[2][400];
  1211.  
  1212.  Pointers to a base type are specified as 
  1213.  
  1214.  double *tp;
  1215.  
  1216. <else>
  1217.  C keyword
  1218.  
  1219.  Used as part of an if statement to select the converse 
  1220.  case. Example 
  1221.  
  1222.  if (cond == 1)
  1223.     {
  1224.     /* execute this if cond = 1 */
  1225.     }
  1226.  else
  1227.     {
  1228.     /* execute this if cond not 1 */
  1229.     }
  1230.  
  1231. <float>
  1232.  C keyword
  1233.  
  1234.  Used to allocate memory for a single precision floating 
  1235.  point value. All variable declarations must be done outside 
  1236.  of the main routine for globals or immediately after the 
  1237.  function declaration for local variables. 
  1238.  
  1239.  Example:
  1240.  
  1241.  float f;
  1242.  
  1243.  Arrays of base types can be specified using the syntax (2 x 
  1244.  400 array): 
  1245.  
  1246.  float data[2][400];
  1247.  
  1248.  Pointers to a base type are specified as: 
  1249.  
  1250.  float *tp;
  1251.  
  1252. <for>
  1253.  C keyword
  1254.  
  1255.  Used to set up loops which are meant to run for a 
  1256.  predetermined number of iterations. For example: 
  1257.  
  1258.  for (i = 0;i< 100; i = i + 2)
  1259.     {
  1260.     /* execute this loop body 50 
  1261.     times. i.e. until i = 100 with
  1262.     i starting at zero and incremented
  1263.     by 2 after each iteration */
  1264.     }
  1265.  
  1266. <int>
  1267.  C keyword
  1268.  
  1269.  Used to allocate memory for a variable of size one integer. 
  1270.  All variable declarations must be done outside of the main 
  1271.  routine for globals or immediately after the function 
  1272.  declaration for local variables. 
  1273.  
  1274.  Example:
  1275.  
  1276.  int i,j;
  1277.  
  1278.  Arrays of base types can be specified using the syntax (2 x 
  1279.  400 array): 
  1280.  
  1281.  int data[2][400];
  1282.  
  1283.  Pointers to a base type are specified
  1284.  as
  1285.  
  1286.  int *tp;
  1287.  
  1288. <if>
  1289.  C keyword
  1290.  
  1291.  Used to conditionally execute a block of code depending if 
  1292.  the conditional expression is true (non zero) or false 
  1293.  (zero). Can be used in conjunction with the keyword else. 
  1294.  For example: 
  1295.  
  1296.  if (i > j && k != 10)
  1297.     {
  1298.     /* execute this block if i greater
  1299.     than j and k not equal to 10 */
  1300.     }
  1301.  else
  1302.     {
  1303.     /* otherwise to this block */
  1304.     }
  1305.  
  1306. <main>
  1307.  C keyword
  1308.  
  1309.  This is actually a function and is the starting point of 
  1310.  the code. The function main is called by hitting CTRL G. 
  1311.  The syntax is 
  1312.    
  1313.  main()
  1314.     {
  1315.     /* program to be executed */
  1316.     }
  1317.  
  1318. <return>
  1319.  C Keyword
  1320.  
  1321.  This exits a sub routine and returns an optional value to 
  1322.  the calling routine. For example: 
  1323.  
  1324.  main()
  1325.     {
  1326.     int x;
  1327.     i = sub(x);
  1328.     print(i);
  1329.     }
  1330.  
  1331.  int sub(int x)
  1332.     {
  1333.     /* calculate i based on input x */
  1334.     return i;
  1335.     }
  1336.  
  1337. <switch>
  1338.  C keyword
  1339.  
  1340.  Used to select one of a number of choices based on the 
  1341.  value of the expression code. 
  1342.  
  1343.  Example:
  1344.     
  1345.  switch(code)
  1346.     {
  1347.     case 0:/* do something if code = 0*/
  1348.        break;
  1349.     case 1:/* do this if code = 1*/
  1350.        break;   
  1351.     case 2:
  1352.     case 3:/* do this if code = 1 or 2*/
  1353.        break;
  1354.     default:/* do this if none of the
  1355.            above */ 
  1356.        break;
  1357.     }
  1358.  
  1359. <while>
  1360.  C keyword
  1361.  
  1362.  Used to construct loops which run an non predetermined 
  1363.  number of times. For example: 
  1364.  
  1365.  cond = 1;
  1366.  while (code == 1)
  1367.     {
  1368.     /* execute this loop body until
  1369.     something in here sets cond to 
  1370.     something other than 1. */
  1371.     }
  1372.  
  1373.  
  1374.