home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / armbob / doc / !BobDoc_Glossary < prev    next >
Encoding:
Text File  |  1991-09-25  |  30.1 KB  |  741 lines

  1. <TITLE>Glossary for ArmBob 2.0</TITLE>
  2. <H2>Glossary for ArmBob 2.0</H2>
  3.  
  4. The following words denote built in functions, values or 
  5. operators. They do not include  
  6. <A HREF="synonyms">predefined constants</A>.
  7. <P>
  8. <A HREF="#pling"> <CODE>!</CODE></A> ,
  9. <A HREF="#notequal"> <CODE>!=</CODE></A> ,
  10. <A HREF="#dollar"> <CODE>$</CODE></A> ,
  11. <A HREF="#dollar2"> <CODE>$$</CODE></A>  ,
  12. <A HREF="#percent"> <CODE>%</CODE></A> ,
  13. <A HREF="#percentequal"> <CODE>%=</CODE></A> ,
  14. <A HREF="#and"> <CODE>&</CODE></A> ,
  15. <A HREF="#and2"> <CODE>&&</CODE></A> ,
  16. <A HREF="#andequal"> <CODE>&=</CODE></A> ,
  17. <A HREF="#and2equal"> <CODE>&&=</CODE></A> ,
  18. <A HREF="#times"> <CODE>*</CODE></A> ,
  19. <A HREF="#timesequal"> <CODE>*=</CODE></A> ,
  20. <A HREF="#plus"> <CODE>+</CODE></A> ,
  21. <A HREF="#plus2"> <CODE>++</CODE></A> ,
  22. <A HREF="#plusequal"> <CODE>+=</CODE></A> ,
  23. <A HREF="#minus"> <CODE>-</CODE></A> ,
  24. <A HREF="#minus2"> <CODE>--</CODE></A> ,
  25. <A HREF="#minusequal"> <CODE>-=</CODE></A> ,
  26. <A HREF="#arrow">-><CODE></CODE></A> ,
  27. <A HREF="#divide"> <CODE>/</CODE></A> , 
  28. <A HREF="#divideequal"> <CODE>/=</CODE></A> ,
  29. <A HREF="#colon"><CODE>:</CODE></A> ,
  30. <A HREF="#colon2"><CODE>::</CODE></A> ,
  31. <A HREF="#lessthan"> <CODE><</CODE></A> ,
  32. <A HREF="#lessthan2"> <CODE><<</CODE></A> ,
  33. <A HREF="#lessthanequal"> <CODE><=</CODE></A> , 
  34. <A HREF="#lessthan2equal"> <CODE><<=</CODE></A> ,
  35. <A HREF="#assign"> <CODE>=</CODE></A> , 
  36. <A HREF="#equal"> <CODE>==</CODE></A> , 
  37. <A HREF="#greater"> <CODE>></CODE></A> ,
  38. <A HREF="#greaterequal"> <CODE>>=</CODE></A> ,
  39. <A HREF="#greater2"> <CODE>>></CODE></A> ,
  40. <A HREF="#greater2equal"> <CODE>>>=</CODE></A> ,
  41. <A HREF="#query"> <CODE>?</CODE></A> ,
  42. <A HREF="#hat"> <CODE>^</CODE></A> , 
  43. <A HREF="#hatequal"> <CODE>^=</CODE></A> ,  
  44. <A HREF="#at"> <CODE>@</CODE></A> , 
  45. <A HREF="#acos"> <CODE>acos</CODE></A> , 
  46. <A HREF="#asin"> <CODE>asin</CODE></A> , 
  47. <A HREF="#atan"> <CODE>atan</CODE></A> , 
  48. <A HREF="#break"> <CODE>break</CODE></A> , 
  49. <A HREF="#call"> <CODE>call</CODE></A> , 
  50. <A HREF="#case"> <CODE>case</CODE></A> , 
  51. <A HREF="#class"> <CODE>class</CODE></A> , 
  52. <A HREF="#continue"> <CODE>continue</CODE></A> , 
  53. <A HREF="#cos"> <CODE>cos</CODE></A> ,  
  54. <A HREF="#default"> <CODE>default</CODE></A> , 
  55. <A HREF="#do"> <CODE>do</CODE></A> , 
  56. <A HREF="#else"> <CODE>else</CODE></A> , 
  57. <A HREF="#enum"> <CODE>enum</CODE></A> , 
  58. <A HREF="#exp"> <CODE>exp</CODE></A> , 
  59. <A HREF="#fclose"> <CODE>fclose</CODE></A> ,
  60. <A HREF="#floor"> <CODE>floor</CODE></A> , 
  61. <A HREF="#fopen"> <CODE>fopen</CODE></A> , 
  62. <A HREF="#for"> <CODE>for</CODE></A> , 
  63. <A HREF="#gc"> <CODE>gc</CODE></A> , 
  64. <A HREF="#getarg"> <CODE>getarg</CODE></A> , 
  65. <A HREF="#getc"> <CODE>getc</CODE></A> , 
  66. <A HREF="#if"> <CODE>if</CODE></A> , 
  67. <A HREF="#in"> <CODE>in</CODE></A> , 
  68. <A HREF="#input"> <CODE>input</CODE></A> ,
  69. <A HREF="#local"> <CODE>local</CODE></A> , 
  70. <A HREF="#log"> <CODE>log</CODE></A> , 
  71. <A HREF="#new"> <CODE>new</CODE></A> , 
  72. <A HREF="#newstring"> <CODE>newstring</CODE></A> , 
  73. <A HREF="#newvector"> <CODE>newvector</CODE></A> , 
  74. <A HREF="#nil"> <CODE>nil</CODE></A> , 
  75. <A HREF="#oscli"> <CODE>oscli</CODE></A> , 
  76. <A HREF="#pi"> <CODE>pi</CODE></A> , 
  77. <A HREF="#print"> <CODE>print</CODE></A> , 
  78. <A HREF="#put"> <CODE>put</CODE></A> , 
  79. <A HREF="#putc"> <CODE>putc</CODE></A> , 
  80. <A HREF="#quit"> <CODE>quit</CODE></A> , 
  81. <A HREF="#repeat"> <CODE>repeat</CODE></A> , 
  82. <A HREF="#rnd"> <CODE>rnd</CODE></A> , 
  83. <A HREF="#return"> <CODE>return</CODE></A> , 
  84. <A HREF="#seed"> <CODE>seed</CODE></A> , 
  85. <A HREF="#sin"> <CODE>sin</CODE></A> , 
  86. <A HREF="#sizeof"> <CODE>sizeof</CODE></A> , 
  87. <A HREF="#sqrt"> <CODE>sqrt</CODE></A> , 
  88. <A HREF="#start_task"> <CODE>start_task</CODE></A> , 
  89. <A HREF="#static"> <CODE>static</CODE></A> , 
  90. <A HREF="#stderr"> <CODE>stderr</CODE></A> , 
  91. <A HREF="#stdin"> <CODE>stdin</CODE></A> , 
  92. <A HREF="#stdout"> <CODE>stdout</CODE></A> , 
  93. <A HREF="#swi"> <CODE>swi</CODE></A> , 
  94. <A HREF="#switch"> <CODE>switch</CODE></A> , 
  95. <A HREF="#sysvar"> <CODE>sysvar</CODE></A> , 
  96. <A HREF="#tan"> <CODE>tan</CODE></A> ,
  97. <A HREF="#this"> <CODE>this</CODE></A> , 
  98. <A HREF="#time"> <CODE>time</CODE></A> , 
  99. <A HREF="#typeof"> <CODE>typeof</CODE></A> , 
  100. <A HREF="#until"> <CODE>until</CODE></A> , 
  101. <A HREF="#val"> <CODE>val</CODE></A> , 
  102. <A HREF="#vector"> <CODE>vector</CODE></A> , 
  103. <A HREF="#wimp_closedown"> <CODE>wimp_closedown</CODE></A> , 
  104. <A HREF="#wimp_init"> <CODE>wimp_init</CODE></A> , 
  105. <A HREF="#wimp_report"> <CODE>wimp_report</CODE></A> , 
  106. <A HREF="#while"> <CODE>while</CODE></A> ,
  107. <A HREF="#or"> <CODE>|</CODE></A> , 
  108. <A HREF="#orequal"> <CODE>|=</CODE></A> ,
  109. <A HREF="#or2"> <CODE>||</CODE></A> ,
  110. <A HREF="#or2equal"> <CODE>||=</CODE></A> ,
  111. <A HREF="#tilde"> <CODE>~</CODE></A> ,  
  112. <A HREF="#backquote"> <CODE>`</CODE></A> , 
  113. <A HREF="#backquote2"> <CODE>``</CODE></A> , 
  114. <A HREF="#pound"> <CODE>£</CODE></A> , 
  115. <A HREF="#pound2"> <CODE>££</CODE></A> , 
  116. <HR>
  117. <DL>
  118.  
  119. <DT><A NAME="pling"><CODE>!</CODE></A>
  120. <DD><CODE>!x </CODE> Returns 0 if <CODE>x </CODE> 
  121.    is nonzero and 1 otherwise. <CODE>x </CODE> must be
  122.    an integer.
  123.  
  124. <DT><A NAME="notequal"><CODE>!=</CODE></A>
  125. <DD><CODE>x != y </CODE> Both <CODE>x, y </CODE> must be
  126.       integers, strings or reals. It returns 1 if they are 
  127.       different and 0 if they are equal.
  128.  
  129. <DT><A NAME="dollar"><CODE>$</CODE></A>
  130. <DD><CODE>$(x) </CODE> is the string stored at address
  131.     <CODE>x </CODE>. The string is terminated by any character 
  132.     with ASCII code less than 32. The address <CODE>x </CODE>
  133.     should be an integer divisible by 4.
  134.  
  135. <DT><A NAME="dollar2"><CODE>$$</CODE></A>
  136. <DD><CODE>$$(x,s) </CODE> returns the value of the string
  137.     <CODE>s </CODE> and places <CODE>s </CODE> at address 
  138.     <CODE>x </CODE>. 
  139. <DD>E.g. <CODE>$$(x,$$(y,s)); </CODE>
  140.     stores <CODE>s </CODE> at both <CODE>x </CODE> and <CODE>y </CODE>.
  141.  
  142. <DT><A NAME="percent"><CODE>%</CODE></A>
  143. <DD><CODE>x % y </CODE> is remainder for dividing the 
  144. integer <CODE>x </CODE> by the integer <CODE>y </CODE>.
  145.  
  146. <DT><A NAME="percentequal"><CODE>%=</CODE></A>
  147. <DD><CODE>x %= y </CODE> Assign <CODE>x%y </CODE> to 
  148.      <CODE>x </CODE>, and then return <CODE>x </CODE>.
  149.  
  150. <DT><A NAME="and"><CODE>&</CODE></A>
  151. <DD><CODE>x & y </CODE> returns the bitwise XOR of 
  152.     <CODE>x </CODE> and <CODE>y </CODE>. Both <CODE>x,y </CODE>
  153.     must be integers.
  154.  
  155. <DT><A NAME="and2"><CODE>&&</CODE></A>
  156. <DD><CODE>x && y </CODE> If <CODE>x </CODE> is 
  157.    zero the expression returns 0 without evaluating 
  158.    <CODE>y </CODE>. Otherwise it returns 0 if 
  159.    <CODE>y </CODE> is zero and 1 otherwise.  Both 
  160.    <CODE>x,y </CODE> must be integers.
  161.  
  162. <DT><A NAME="andequal"><CODE>&=</CODE></A>
  163. <DD><CODE>x &= y </CODE> Assign <CODE>x&y </CODE>
  164.     to <CODE>x </CODE> and then return <CODE>x </CODE>. Both 
  165.    <CODE>x,y </CODE> must be integers.
  166.  
  167. <DT><A NAME="and2equal"><CODE>&&=</CODE></A>
  168. <DD><CODE>x &&= y </CODE> Assign <CODE>x&&y </CODE>
  169.     to <CODE>x </CODE> and then return <CODE>x </CODE>. Both 
  170.    <CODE>x,y </CODE> must be integers.
  171.  
  172. <DT><A NAME="times"><CODE>*</CODE></A>
  173. <DD><CODE>x * y</CODE> The values <CODE>x, y </CODE>
  174.       are reals or integers. Their product is returned.
  175.       The type of the result is real if either 
  176.       <CODE>x </CODE> or <CODE>y </CODE> is a real
  177.       and integer otherwise.
  178.  
  179. <DT><A NAME="timesequal"><CODE>*=</CODE></A>
  180. <DD><CODE>x *= y </CODE> Assign <CODE>x*y </CODE>
  181.     to <CODE>x </CODE> and then return <CODE>x </CODE>.
  182.  
  183. <DT><A NAME="plus"><CODE>+</CODE></A>
  184. <DD><CODE>x + y </CODE> If <CODE>x, y </CODE> are both integers 
  185.         or both reals it returns their sum. If 
  186.         <CODE>x, y </CODE> are both strings it returns their 
  187.         concatenation. If either <CODE>x </CODE> or <CODE>y </CODE>
  188.         is a string and the other argument is an integer, the 
  189.         other argument is converted to the string consisting 
  190.         of the single character given by the ASCII code of 
  191.         the bottom 8 bits and the result is the concatenation 
  192.         of the two strings.
  193.  
  194. <DT><A NAME="plus2"><CODE>++</CODE></A>
  195. <DD><CODE>x++ </CODE> Evaluate <CODE>x </CODE> in the current 
  196.        expression, and then assign <CODE>x+1 </CODE> to <CODE>x </CODE>.
  197. <DD><CODE>++x </CODE> Assign <CODE>x+1 </CODE> to <CODE>x </CODE>
  198.        before further evaluation.
  199.  
  200. <DT><A NAME="plusequal"><CODE>+=</CODE></A>
  201. <DD><CODE>x += y </CODE>  Assign <CODE>x+y </CODE> to 
  202.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  203.  
  204. <DT><A NAME="minus"><CODE>-</CODE></A>
  205. <DD><CODE>x - y </CODE> The values <CODE>x, y </CODE> are
  206.      both integers or both reals. Their difference is returned.
  207.  
  208. <DT><A NAME="minus2"><CODE>--</CODE></A>
  209. <DD><CODE>x-- </CODE> Evaluate <CODE>x </CODE> in the current 
  210.        expression, and then assign <CODE>x-1 </CODE> to <CODE>x </CODE>.
  211. <DD><CODE>--x </CODE> Assign <CODE>x-1 </CODE> to <CODE>x </CODE>
  212.        before further evaluation.
  213.  
  214. <DT><A NAME="minusequal"><CODE>-=</CODE></A>
  215. <DD><CODE>x -= y </CODE>  Assign <CODE>x-y </CODE> to 
  216.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  217.  
  218. <DT><A NAME="divide"></A><CODE>/</CODE></A>
  219. <DD></A><CODE>x / y </CODE></A> If <CODE>x </CODE> is an 
  220.       integer, then so must <CODE>y </CODE> be and an integer
  221.       and their quotient is returned. If <CODE>x </CODE> is real 
  222.       <CODE>y </CODE> may be either an integer or a real and 
  223.       the real quotient is returned.
  224.  
  225. <DT><A NAME="divideequal"><CODE>/=</CODE></A>
  226. <DD><CODE>x /= y </CODE>  Assign <CODE>x/y </CODE> to 
  227.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  228.  
  229. <DT><A NAME="arrow"><CODE>-></CODE></A>
  230. <DD><CODE>myinstance->mymethod </CODE> is the function obtained
  231. when method <CODE>mymethod </CODE> is instantiated for the instance
  232. <CODE>myinstance </CODE>.
  233. <DD> E.g. <CODE>print("The x-coordinate of vertex is ",
  234.                 vertex->x(),"\n");</CODE>
  235. <DD>Each instance object of a class has its own private copy
  236.     of the class's data, which can only be updated or accessed
  237.     using a  method.
  238.  
  239. <DT><A NAME="colon"><CODE>:</CODE></A>
  240. <DD><CODE>c?yes:no </CODE> see <A HREF="#query> ?</A>.
  241. <DD><CODE>class child:parent { ... } </CODE> declares
  242.     <CODE> child </CODE> as a subclass of <CODE> parent </CODE>.
  243.     Instance objects of <CODE> child </CODE> have access to the
  244.     methods of <CODE> parent </CODE>.
  245.  
  246. <DT><A NAME="colon2"><CODE>::</CODE></A>
  247. <DD><CODE>myclass::mymethod() </CODE> declares 
  248.     <CODE>mymethod()</CODE> to be a method for the
  249.     <A HREF="#class">class </A> <CODE>myclass</CODE>. 
  250.  
  251. <DT><A NAME="lessthan"><CODE><</CODE></A>
  252. <DD><CODE>x < y </CODE> The values <CODE>x, y </CODE> are
  253.        both integers, strings or reals. It returns 1
  254.        if <CODE>x </CODE> strictly precedes <CODE>y </CODE>, 
  255.        otherwise it returns 0.
  256.  
  257. <DT><A NAME="lessthan2"><CODE><<</CODE></A>
  258. <DD><CODE>x << y </CODE> If <CODE>x, y </CODE> are 
  259.         both integers it returns <CODE>x </CODE> shifted left by
  260.         <CODE>y </CODE> bits. If <CODE>x </CODE> is an iostream and 
  261.         <CODE>y </CODE> a string, it outputs <CODE>y </CODE> to 
  262.         <CODE>x </CODE> and returns the result <CODE>x </CODE>.
  263.  
  264. <DT><A NAME="lessthanequal"><CODE><=</CODE></A>
  265. <DD><CODE>x <= y </CODE> The values <CODE>x, y </CODE> are
  266.        both integers, strings or reals. It returns 1
  267.        if <CODE>x </CODE> precedes or equals <CODE>y </CODE>, 
  268.        otherwise it returns 0.
  269.  
  270. <DT><A NAME="lessthan2equal"><CODE><<=</CODE></A>
  271. <DD><CODE>x <<= y </CODE>  Assign <CODE>x<<y </CODE> to 
  272.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  273.  
  274. <DT><A NAME="assign"><CODE>=</CODE></A>
  275. <DD><CODE>x = y </CODE> Assign <CODE>y </CODE> to 
  276.     <CODE>x </CODE> and return that value.
  277.  
  278. <DT><A NAME="equal"><CODE>==</CODE></A>
  279. <DD><CODE>x == y </CODE> The values <CODE>x, y </CODE> are
  280.       both integers, strings or reals. It returns 0
  281.       if they are different and 1 if they are equal.
  282.  
  283. <DT><A NAME="greater"><CODE>></CODE></A>
  284. <DD><CODE>x > y </CODE> The values <CODE>x, y </CODE> are
  285.       both integers, strings or reals. It returns 1 if
  286.       if <CODE>y </CODE> strictly precedes <CODE>x </CODE>, 
  287.       otherwise it returns 0.
  288.  
  289. <DT><A NAME="greaterequal"><CODE>>=</CODE></A>
  290. <DD><CODE>x >= y </CODE> The values <CODE>x, y </CODE> are
  291.       both integers, strings or reals. It returns 1 if
  292.       if <CODE>y </CODE> precedes or equals <CODE>x </CODE>, 
  293.       otherwise it returns 0.
  294.  
  295. <DT><A NAME="greater2"><CODE>>></CODE></A>
  296. <DD><CODE>x >> y </CODE> The values <CODE>x, y </CODE> are
  297.        both integers. It returns <CODE>x </CODE> arithmetically shifted
  298.        right by <CODE>y </CODE> bits.
  299.  
  300. <DT><A NAME="greater2equal"><CODE>>>=</CODE></A>
  301. <DD><CODE>x >>= y </CODE>  Assign <CODE>x>>y </CODE> to 
  302.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  303.  
  304. <DT><A NAME="query"><CODE>?</CODE></A>
  305. <DD><CODE>c?yes:no </CODE> The value <CODE>c </CODE> an integer. 
  306.      If it is nonzero, the expression evaluates and returns 
  307.      the value of <CODE>yes </CODE> (<CODE>no </CODE> is 
  308.      not evaluated), otherwise it evaluates and returns
  309.      the value of <CODE>no </CODE> (<CODE>yes </CODE> is not evaluated).
  310.  
  311. <DT><A NAME="hat"><CODE>^</CODE></A>
  312. <DD><CODE>x ^ y </CODE>  Both <CODE>x, y </CODE> are integers. 
  313.     Returns the bitwise XOR of <CODE>x </CODE> and <CODE>y </CODE>.
  314.  
  315. <DT><A NAME="hatequal"><CODE>^=</CODE></A>
  316. <DD><CODE>x ^= y </CODE>  Assign <CODE>x^y </CODE> to 
  317.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  318.  
  319. <DT><A NAME="or"><CODE>|</CODE></A>
  320. <DD><CODE>x | y </CODE>  Both <CODE>x, y </CODE> are integers. 
  321.     Returns the bitwise OR of <CODE>x </CODE> and <CODE>y </CODE>.
  322.  
  323. <DT><A NAME="orequal"><CODE>|=</CODE></A>
  324. <DD><CODE>x |= y </CODE>  Assign <CODE>x|y </CODE> to 
  325.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  326.  
  327. <DT><A NAME="or2"><CODE>||</CODE></A>
  328. <DD><CODE>x || y </CODE>  Both <CODE>x, y </CODE> are integers. 
  329.     If <CODE>x</CODE> is nonzero, the expression 
  330.     evaluates to 1, without evaluating <CODE>y</CODE>. Otherwise 
  331.     it returns 0 if <CODE>y</CODE> is zero and 1 otherwise.
  332.  
  333. <DT><A NAME="or2equal"><CODE>||=</CODE></A>
  334. <DD><CODE>x ||= y </CODE>  Assign <CODE>x||y </CODE> to 
  335.       <CODE>x </CODE>, and return <CODE>x </CODE>.
  336.  
  337. <DT><A NAME="tilde"><CODE>~</CODE></A>
  338. <DD><CODE>~x </CODE> returns the bitwise NOT of the integer
  339.      <CODE>x </CODE>.
  340.  
  341. <DT><A NAME="at"><CODE>@</CODE></A>
  342. <DD><CODE>@(s) </CODE> is the address of the first character of the 
  343.      string <CODE>s</CODE>. This address is divisible by 4. Strings 
  344.      are stored as a consecutive array of bytes.
  345. <DD>E.g. <CODE>@s = @(s = "hello");</CODE>
  346.  
  347. <DT><A NAME="acos"><CODE>acos</CODE></A>
  348. <DD><CODE>acos(x) </CODE> is arc-cos of the real <CODE>x</CODE>.
  349.  
  350. <DT><A NAME="asin"><CODE>asin</CODE></A>
  351. <DD><CODE>asin(x) </CODE> is arc-sine of the real <CODE>x</CODE>.
  352.  
  353. <DT><A NAME="atan"><CODE>atan</CODE></A>
  354. <DD><CODE>atan(x) </CODE> is arc-tangent of the real <CODE>x</CODE>.
  355.  
  356. <DT><A NAME="break"><CODE>break</CODE></A>
  357. <DD><CODE>break; </CODE> Jump out of the current structure.
  358.   It only makes sense within a <CODE>switch</CODE>, <CODE>do</CODE>/
  359.   <CODE>repeat</CODE>, <CODE>for</CODE> or <CODE>while</CODE> structure.
  360.  
  361. <DT><A NAME="call"><CODE>call</CODE></A>
  362. <DD><CODE>call(adr,r0); </CODE> Call machine code at the address 
  363.     <CODE>adr</CODE> with register R0 holding the address 
  364.     <CODE>r0</CODE>. The same calling conventions should be used
  365.      as for C. So the code should return with MOV PC,R14 and should 
  366.      preserve registers R10 - R14. The address <CODE>r0</CODE> should 
  367.      be used for a buffer for passing data in and out.
  368.  
  369. <DT><A NAME="case"><CODE>case</CODE></A>
  370. <DD><CODE>case x: </CODE> Part of the 
  371.   <A HREF="#switch"><CODE>switch</CODE></A> construct.
  372.  
  373. <DT><A NAME="class"><CODE>class</CODE></A>
  374. <DD><CODE>class </CODE> Keyword introducing a class definition. 
  375.    Class definitions can only appear at the top level.
  376.    That is to say, they cannot appear inside a
  377.    class definition or a function definition.
  378.    Class definitions must precede the definitions
  379.    of any of their instance objects.
  380. <DD> E.g. <CODE>class point { q; /* a vector of coordinates */ }</CODE>
  381. <DD> We say that the class <CODE>point</CODE> has the vector 
  382.    <CODE>q</CODE> as its <EM>data</EM>.
  383.    <EM>Methods</EM> for a class can be declared inside the class's
  384.    definition but this is optional. They must be defined 
  385.    outside the class definition. For example, to add a method 
  386.    to <CODE>point</CODE> to read its first coordinate, we could have
  387. <DD> <CODE>point::x() { return q[0]; }</CODE>
  388. <DD> Method definitions are exactly like function definitions 
  389.      except that the class name, followed by <CODE>::</CODE>,
  390.      prefixes the method name. The same method name can be
  391.      used in different classes. That is to say, data and
  392.      method names are local to a class. The variable
  393.      <A HREF="#this"><CODE>this</CODE></A> can be used in a method to 
  394.      refer to the instance object using the method.
  395.  
  396. <DT><A NAME="continue"><CODE>continue</CODE></A>
  397. <DD><CODE>continue; </CODE> Start the next iteration of the smallest 
  398.      enclosing <CODE>do</CODE>/<CODE>repeat, for</CODE> or
  399.      <CODE>while</CODE> structure. 
  400.  
  401. <DT><A NAME="cos"><CODE>cos</CODE></A>
  402. <DD><CODE>cos(x) </CODE> is cosine of the real <CODE>x</CODE>.
  403.  
  404. <DT><A NAME="default"><CODE>default</CODE></A>
  405. <DD><CODE>default: </CODE> the default alternative in the 
  406.    <A HREF="#switch"><CODE>switch</CODE></A> structure.
  407.  
  408. <DT><A NAME="do"><CODE>do</CODE></A>
  409. <DD><CODE>do ... until/while (x); </CODE> Looping construct where the body is executed at least once.
  410.  
  411. <DT><A NAME="else"><CODE>else</CODE></A>
  412. <DD><CODE>else </CODE> Optional part of 
  413.    <A HREF="#if"><CODE>if</CODE></A> construct.
  414.  
  415. <DT><A NAME="enum"><CODE>enum</CODE></A>
  416. <DD><CODE>enum { x1, ... , xn } </CODE> This returns the integer
  417.      <CODE>n</CODE> and assigns the values 0, 1, ... (n-1) to the n
  418.      variables <CODE> x1, ... xn </CODE> in order. It is useful for
  419.      hiding explicit indexing.
  420.  
  421. <DT><A NAME="exp"><CODE>exp</CODE></A>
  422. <DD><CODE>exp(x) </CODE> is exponential of the real <CODE> x </CODE>.
  423.  
  424. <DT><A NAME="fclose"><CODE>fclose</CODE></A>
  425. <DD><CODE>fclose(fp); </CODE> closes the iostream <CODE> fp </CODE>
  426.            and returns <CODE> nil </CODE>.
  427.  
  428. <DT><A NAME="floor"><CODE>floor</CODE></A>
  429. <DD><CODE>floor(x) </CODE> is the integer part of the real
  430.     value <CODE> x </CODE>.
  431.  
  432. <DT><A NAME="fopen"><CODE>fopen</CODE></A>
  433. <DD><CODE>fopen(fname,mode) </CODE> tries to open a new iostream
  434.      connected to the file named by the string <CODE>fname</CODE>. 
  435.      If unsuccessful, returns <CODE>nil</CODE>, and otherwise returns
  436.      the iostream itself. The mode variable can take the values 
  437.      "r" (read), "w" (write) and 
  438.      "a" (append).
  439.  
  440. <DT><A NAME="for"><CODE>for</CODE></A>
  441. <DD><CODE>for(start;terminate;action) .... </CODE> iteration construct.
  442. <DD> E.g. <CODE><PRE>
  443.         for(i = 0; i <; sizeof(v); i++)
  444.            print("v[",i,"] = ",v[i],"\n");
  445.      </PRE></CODE>
  446.  
  447. <DT><A NAME="gc"><CODE>gc</CODE></A>
  448. <DD><CODE>gc(); </CODE> forces garbage collection. The value
  449.     <CODE>nil</CODE> is returned.
  450.  
  451. <DT><A NAME="getarg"><CODE>getarg</CODE></A>
  452. <DD><CODE>getarg(i) </CODE> returns the <CODE>i</CODE>-th 
  453.      argument on the command line as a string, if there is one, and
  454.      <CODE>nil</CODE> if there is none. The 0-th argument is the command
  455.      itself (the program's pathname).
  456. <DD> E.g. <CODE><PRE>
  457.            for(i = 1; typeof(arg = getarg(i)); i++)
  458.                process(arg);</PRE></CODE>
  459.  
  460. <DT><A NAME="getc"><CODE>getc</CODE></A>
  461. <DD><CODE>getc(fp) </CODE> returns either the next byte from the 
  462.    iostream <CODE>fp</CODE> or <CODE>EOF</CODE>.
  463.  
  464. <DT><A NAME="if"><CODE>if</CODE></A>
  465. <DD><CODE>if (condition) ... else ... </CODE>  conditional construct.
  466.    A condition is regarded as false if it is either the integer 0
  467.    or the value <CODE>nil</CODE>. Other values count as true. 
  468.  
  469. <DT><A NAME="in"><CODE>in</CODE></A>
  470. <DD><CODE>in buffer put { x1; .... xn ;} </CODE> structure. 
  471.    <CODE>buffer</CODE> is either a string or an integer address.
  472.    The values <CODE>x1 ... xn</CODE> are strings or integers.
  473.  
  474. <DT><A NAME="input"><CODE>input</CODE></A>
  475. <DD><CODE>input() </CODE> Returns an input string. Leading spaces are
  476.       not removed. To input a number use the function 
  477.       <A HREF="#val"><CODE>val</CODE></A>.
  478. <DD>E.g. <CODE>n = val(input());</CODE>
  479.  
  480. <DT><A NAME="local"><CODE>local</CODE></A>
  481. <DD><CODE>local x1, ... xn ;</CODE> declares <CODE>x1, ... ,xn</CODE>
  482.   to be local variables. This statement must precede all others in
  483.   the body of a function or method definition.
  484.  
  485. <DT><A NAME="log"><CODE>log</CODE></A>
  486. <DD><CODE>log(x) </CODE> is natural logarithm of the real <CODE>x</CODE>.
  487.  
  488. <DT><A NAME="new"><CODE>new</CODE></A>
  489. <DD><CODE>new </CODE> is used to create instance objects of classes.
  490. <DD> E.g. for a class foo <CODE>x = new foo( ... );</CODE>
  491.  
  492. <DT><A NAME="newstring"><CODE>newstring</CODE></A>
  493. <DD><CODE>newstring(n) </CODE> Allocates an array of 
  494.      <CODE>n</CODE> bytes in the heap, starting on a 
  495.      word boundary, initializes them to zero, and returns 
  496.      the string which has this array as its value.
  497.  
  498. <DT><A NAME="newvector"><CODE>newvector</CODE></A>
  499. <DD><CODE>newvector(n) </CODE> Allocates space in the heap 
  500.      for an <CODE>n</CODE>-component vector, whose values 
  501.      are all <CODE>nil</CODE>, and returns this vector.
  502. <DD>E.g.<CODE><PRE>
  503.      loopy = newvector(2);
  504.      loopy[0] = loopy; </PRE></CODE>
  505.  
  506. <DT><A NAME="nil"><CODE>nil</CODE></A>
  507. <DD><CODE>nil </CODE> the single value of type NIL. This is
  508.     used to represent undefined quantities.
  509.  
  510. <DT><A NAME="oscli"><CODE>oscli</CODE></A>
  511. <DD><CODE>oscli(s) </CODE> Sends a string s to the command line
  512.       interpreter. The value <CODE>nil</CODE> is returned.
  513.  
  514. <DT><A NAME="pi"><CODE>pi</CODE></A>
  515. <DD><CODE>pi </CODE> is an approximation to the ratio of the 
  516.     circumference of a circle to its diameter.
  517.  
  518. <DT><A NAME="print"><CODE>print</CODE></A>
  519. <DD><CODE>print(x1, ... ,xn); </CODE> Print the items 
  520.        <CODE>x1, .... xn</CODE> and return
  521.        <CODE>nil</CODE>. Newlines are not automatically 
  522.        appended. The digrams <CODE>\n, \t, \\</CODE> can be used 
  523.        in strings for newline, tab and \, respectively.
  524.        <CODE>print</CODE> should not be used in a wimp program.
  525.  
  526. <DT><A NAME="put"><CODE>put</CODE></A>
  527. <DD><CODE>in buffer put {x1; .... xn; } </CODE> See
  528.     <A HREF="#in"><CODE>in</CODE></A>.
  529.  
  530. <DT><A NAME="putc"><CODE>putc</CODE></A>
  531. <DD><CODE>putc(ch,fp); </CODE> Writes the character ch to the 
  532.     iostream <CODE>fp</CODE>. Returns <CODE>nil</CODE>.
  533.  
  534. <DT><A NAME="quit"><CODE>quit</CODE></A>
  535. <DD><CODE>quit(s); </CODE> Causes the program to exit with a message
  536.        <CODE>s</CODE> to <CODE>stderr</CODE> and returns
  537.        <CODE>nil</CODE>. In wimp programs 
  538.        <CODE>wimp_closedown</CODE> is called.
  539.  
  540. <DT><A NAME="repeat"><CODE>repeat</CODE></A>
  541. <DD><CODE>repeat </CODE> is a synonym for 
  542.    <A HREF="#do"><CODE>do</CODE></A>.
  543.  
  544. <DT><A NAME="rnd"><CODE>rnd</CODE></A>
  545. <DD><CODE>rnd() </CODE> returns a random positive integer.
  546.  
  547. <DT><A NAME="return"><CODE>return</CODE></A>
  548. <DD><CODE>return x; </CODE> returns <CODE>x </CODE> as the
  549.        value of a function or method. <CODE>return; </CODE>
  550.        is equivalent to <CODE>return nil; </CODE>.
  551.  
  552. <DT><A NAME="seed"><CODE>seed</CODE></A>
  553. <DD><CODE>seed(n) ;</CODE> Seeds the random number generator 
  554.      with the integer <CODE>n </CODE> and returns 
  555.      <CODE>nil </CODE>.
  556.  
  557. <DT><A NAME="sin"><CODE>sin</CODE></A>
  558. <DD><CODE>sin(x) </CODE> is sine of the real <CODE>x </CODE>.
  559.  
  560. <DT><A NAME="sizeof"><CODE>sizeof</CODE></A>
  561. <DD><CODE>sizeof(s) </CODE> returns the number of characters in a string
  562.      <CODE>s </CODE>, or the number of components of a vector 
  563.      <CODE>s </CODE>, as an integer.
  564.  
  565. <DT><A NAME="sqrt"><CODE>sqrt</CODE></A>
  566. <DD><CODE>sqrt(x) </CODE> is square-root of the real <CODE>x </CODE>.
  567.  
  568. <DT><A NAME="start_task"><CODE>start_task</CODE></A>
  569. <DD><CODE>start_task(s) </CODE> takes a command in the string 
  570.       <CODE>s </CODE> to start up a child task, and returns its task
  571.       handle. This works both from <A HREF="Run#BobFile>BobFiles </A>
  572.       (i.e. from a command window) or from 
  573.       <A HREF="Run#BobTask>BobTasks</A> (i.e. from a taskwindow).
  574.       This function should only be used outside wimp programs 
  575.       (i.e. before <A HREF="#wimp_init><CODE>wimp_init</CODE></A>
  576.       or after <A HREF="#wimp_closedown><CODE>wimp_closedown </CODE></A>.
  577.       There are other means of starting a child task from within a wimp 
  578.       program.
  579.  
  580. <DT><A NAME="static"><CODE>static</CODE></A>
  581. <DD><CODE>static </CODE> prefix for the declaration of
  582.     static data and methods in a class definition. Such 
  583.     data and methods are shared by all instances of a 
  584.     class. Static methods may not use the variable 
  585.     <A HREF="#this"><CODE>this </CODE></A>.  A typical 
  586.     use of static variables would be a variable to count 
  587.     the number of instance objects of a certain kind.
  588. <DD> E.g.<CODE><PRE>
  589.     class foo
  590.     {
  591.      static total;
  592.      ..........  
  593.     }
  594.  
  595.     foo::foo(...)
  596.     {
  597.      if (typeof(total)) total += 1;
  598.      else total = 1;
  599.      ...............
  600.     }
  601.  
  602.     foo::current_number()
  603.     { return total; }
  604.     </PRE></CODE>
  605.     
  606.  
  607. <DT><A NAME="stderr"><CODE>stderr</CODE></A>
  608. <DD><CODE>stderr </CODE> is a built-in iostream.
  609.  
  610. <DT><A NAME="stdin"><CODE>stdin</CODE></A>
  611. <DD><CODE>stdin </CODE> is a built-in iostream.
  612.  
  613. <DT><A NAME="stdout"><CODE>stdout</CODE></A>
  614. <DD><CODE>stdout </CODE> is a built-in iostream.
  615.  
  616. <DT><A NAME="swi"><CODE>swi</CODE></A>
  617. <DD><CODE>swi(x,r) </CODE> calls SWI <CODE>x </CODE>, given
  618.     either as a string or number, with registers R0-R7 preloaded
  619.     with the first 8 components of the vector <CODE>r </CODE>,
  620.     and returns <CODE>nil </CODE> with the components of
  621.     <CODE>r </CODE> updated to the returned values in registers
  622.     R0-R7. Note that even though a SWI may pass no values in 
  623.     registers, it is necessary for the second argument to be a vector 
  624.     with at least 8 components.
  625. <DD>E.g.<CODE><PRE>
  626.     event_process(maskptr,buffer,action,user)
  627.     {
  628.      local r, respond, go_on;
  629.      r = newvector(8);
  630.      go_on = TRUE;
  631.      while(go_on)
  632.      {
  633.       r[0] = maskptr[0];
  634.       r[1] = buffer;
  635.       swi("Wimp_Poll",r);
  636.       go_on =
  637.         (typeof(respond = action[r[0]])
  638.            == BYTECODE)?respond(buffer,user,maskptr):TRUE;
  639.      }
  640.      wimp_closedown();
  641.     }      </PRE></CODE>
  642.  
  643.  
  644. <DT><A NAME="switch"><CODE>switch</CODE></A>
  645. <DD><CODE>switch (c) { .... } </CODE> is the multibranch 
  646.       conditional structure.
  647.  
  648. <DT><A NAME="sysvar"><CODE>sysvar</CODE></A>
  649. <DD><CODE>sysvar(s) </CODE>  Returns the string value of the 
  650.       string system variable <CODE>s </CODE> or <CODE>nil </CODE>
  651.       if the variable is unset.
  652. <DD> E.g. <CODE>print(sysvar("Bob$Path"),"\n");</CODE>
  653.  
  654. <DT><A NAME="tan"><CODE>tan</CODE></A>
  655. <DD><CODE>tan(x) </CODE> is tangent of the real <CODE>x </CODE>.
  656.  
  657. <DT><A NAME="this"><CODE>this</CODE></A>
  658. <DD><CODE>this </CODE> is a variable that can be used in a method
  659.   to refer to the instance object using the method.
  660. <DD>E.g.<CODE><PRE>
  661.      foo::methodA( .. )
  662.      {
  663.        .... this->methodB(...) ...
  664.      } </PRE></CODE>
  665.  
  666. <DT><A NAME="time"><CODE>time</CODE></A>
  667. <DD><CODE>time() </CODE> Returns the first 32 bits of the time in 
  668.            centiseconds since the beginning of the century.
  669.  
  670. <DT><A NAME="typeof"><CODE>typeof</CODE></A>
  671. <DD><CODE>typeof(x) </CODE> returns the integer code 
  672.     describing the type of <CODE>x </CODE>. The type of <CODE>nil </CODE>
  673.     is 0, and all other values return a nonzero value. 
  674.     This is useful for coping with undefined vector components.
  675. <DD> E.g. <CODE> a = typeof(a)?a:0;</CODE>
  676.  
  677. <DT><A NAME="until"><CODE>until</CODE></A>
  678. <DD><CODE>until c </CODE> terminating condition for 
  679.     <CODE>do/repeat </CODE> structure.
  680.  
  681. <DT><A NAME="val"><CODE>val</CODE></A>
  682. <DD><CODE>val(s) </CODE> Converts as many characters of the 
  683.       string <CODE>s </CODE> to a number as it can. Decimal 
  684.       or hexadecimal numbers (prefixed by &) are recognized. 
  685.       Note that the hexadecimal digits <CODE>a,b,c,d,e,f </CODE>
  686.       are in lower case. Reals are distinguished by a decimal 
  687.       point.
  688.  
  689. <DT><A NAME="vector"><CODE>vector</CODE></A>
  690. <DD><CODE>vector {expr1; ... exprn; } </CODE> returns a new vector
  691.     with components <CODE>expr1 ... exprn </CODE>.
  692.     There must be at least one component.
  693.  
  694. <DT><A NAME="wimp_closedown"><CODE>wimp_closedown</CODE></A>
  695. <DD><CODE>wimp_closedown() </CODE> Programs running as wimp 
  696.              tasks must use this function before terminating. 
  697.              It returns <CODE>nil </CODE>.
  698.  
  699. <DT><A NAME="wimp_init"><CODE>wimp_init</CODE></A>
  700. <DD><CODE>wimp_init(version,name,mesg_list) </CODE> registers
  701.     a task with the window manager. <CODE>version </CODE> is 
  702.     100 times the version number of RISC OS being used,
  703.     <CODE>name </CODE> is the name of the wimp task, and 
  704.     <CODE>mesg_list </CODE> is a buffer, given as a string 
  705.     or its integer address, containing the messages, stored 
  706.     as words and terminated by 0, which the task wishes to 
  707.     receive. The function returns the task handle as an 
  708.     integer.
  709.  
  710. <DT><A NAME="wimp_report"><CODE>wimp_report</CODE></A>
  711. <DD><CODE>wimp_report(s) </CODE>  displays string 
  712.      <CODE>s </CODE> in a dialogue box and returns 0 if 
  713.      no key or mouse button is clicked, 1 if the OK 
  714.      button is selected, and 2 if the CANCEL button is selected.
  715.  
  716. <DT><A NAME="while"><CODE>while</CODE></A>
  717. <DD><CODE>while c </CODE> terminating condition for 
  718.     <CODE>do/repeat </CODE> structure.
  719.  
  720. <DT><A NAME="backquote"><CODE>`</CODE></A>
  721. <DD><CODE>`(x) </CODE> Returns as an integer the 
  722.       contents of the byte at the address or string 
  723.       <CODE>x </CODE>. If <CODE>s </CODE> is a string
  724.       <CODE>`(s) </CODE> is the same as <CODE>s[0] </CODE>.
  725.  
  726. <DT><A NAME="backquote2"><CODE>``</CODE></A>
  727. <DD><CODE>``(x,c) </CODE> Place byte <CODE>c </CODE>
  728.        at address <CODE>x </CODE>, and return <CODE>c </CODE>.
  729.  
  730. <DT><A NAME="pound"><CODE>£</CODE></A>
  731. <DD><CODE>£(x) </CODE> Returns as an integer the 
  732.       contents of the word at the address or string 
  733.       <CODE>x </CODE>.
  734.  
  735. <DT><A NAME="pound2"><CODE>££</CODE></A>
  736. <DD><CODE>££(x,n) </CODE> Place integer <CODE>n </CODE>
  737.        at address <CODE>x </CODE>, and return <CODE>n </CODE>.
  738. </DL>
  739. <HR>
  740.  
  741.