home *** CD-ROM | disk | FTP | other *** search
- <TITLE>Glossary for ArmBob 2.0</TITLE>
- <H2>Glossary for ArmBob 2.0</H2>
-
- The following words denote built in functions, values or
- operators. They do not include
- <A HREF="synonyms">predefined constants</A>.
- <P>
- <A HREF="#pling"> <CODE>!</CODE></A> ,
- <A HREF="#notequal"> <CODE>!=</CODE></A> ,
- <A HREF="#dollar"> <CODE>$</CODE></A> ,
- <A HREF="#dollar2"> <CODE>$$</CODE></A> ,
- <A HREF="#percent"> <CODE>%</CODE></A> ,
- <A HREF="#percentequal"> <CODE>%=</CODE></A> ,
- <A HREF="#and"> <CODE>&</CODE></A> ,
- <A HREF="#and2"> <CODE>&&</CODE></A> ,
- <A HREF="#andequal"> <CODE>&=</CODE></A> ,
- <A HREF="#and2equal"> <CODE>&&=</CODE></A> ,
- <A HREF="#times"> <CODE>*</CODE></A> ,
- <A HREF="#timesequal"> <CODE>*=</CODE></A> ,
- <A HREF="#plus"> <CODE>+</CODE></A> ,
- <A HREF="#plus2"> <CODE>++</CODE></A> ,
- <A HREF="#plusequal"> <CODE>+=</CODE></A> ,
- <A HREF="#minus"> <CODE>-</CODE></A> ,
- <A HREF="#minus2"> <CODE>--</CODE></A> ,
- <A HREF="#minusequal"> <CODE>-=</CODE></A> ,
- <A HREF="#arrow">-><CODE></CODE></A> ,
- <A HREF="#divide"> <CODE>/</CODE></A> ,
- <A HREF="#divideequal"> <CODE>/=</CODE></A> ,
- <A HREF="#colon"><CODE>:</CODE></A> ,
- <A HREF="#colon2"><CODE>::</CODE></A> ,
- <A HREF="#lessthan"> <CODE><</CODE></A> ,
- <A HREF="#lessthan2"> <CODE><<</CODE></A> ,
- <A HREF="#lessthanequal"> <CODE><=</CODE></A> ,
- <A HREF="#lessthan2equal"> <CODE><<=</CODE></A> ,
- <A HREF="#assign"> <CODE>=</CODE></A> ,
- <A HREF="#equal"> <CODE>==</CODE></A> ,
- <A HREF="#greater"> <CODE>></CODE></A> ,
- <A HREF="#greaterequal"> <CODE>>=</CODE></A> ,
- <A HREF="#greater2"> <CODE>>></CODE></A> ,
- <A HREF="#greater2equal"> <CODE>>>=</CODE></A> ,
- <A HREF="#query"> <CODE>?</CODE></A> ,
- <A HREF="#hat"> <CODE>^</CODE></A> ,
- <A HREF="#hatequal"> <CODE>^=</CODE></A> ,
- <A HREF="#at"> <CODE>@</CODE></A> ,
- <A HREF="#acos"> <CODE>acos</CODE></A> ,
- <A HREF="#asin"> <CODE>asin</CODE></A> ,
- <A HREF="#atan"> <CODE>atan</CODE></A> ,
- <A HREF="#break"> <CODE>break</CODE></A> ,
- <A HREF="#call"> <CODE>call</CODE></A> ,
- <A HREF="#case"> <CODE>case</CODE></A> ,
- <A HREF="#class"> <CODE>class</CODE></A> ,
- <A HREF="#continue"> <CODE>continue</CODE></A> ,
- <A HREF="#cos"> <CODE>cos</CODE></A> ,
- <A HREF="#default"> <CODE>default</CODE></A> ,
- <A HREF="#do"> <CODE>do</CODE></A> ,
- <A HREF="#else"> <CODE>else</CODE></A> ,
- <A HREF="#enum"> <CODE>enum</CODE></A> ,
- <A HREF="#exp"> <CODE>exp</CODE></A> ,
- <A HREF="#fclose"> <CODE>fclose</CODE></A> ,
- <A HREF="#floor"> <CODE>floor</CODE></A> ,
- <A HREF="#fopen"> <CODE>fopen</CODE></A> ,
- <A HREF="#for"> <CODE>for</CODE></A> ,
- <A HREF="#gc"> <CODE>gc</CODE></A> ,
- <A HREF="#getarg"> <CODE>getarg</CODE></A> ,
- <A HREF="#getc"> <CODE>getc</CODE></A> ,
- <A HREF="#if"> <CODE>if</CODE></A> ,
- <A HREF="#in"> <CODE>in</CODE></A> ,
- <A HREF="#input"> <CODE>input</CODE></A> ,
- <A HREF="#local"> <CODE>local</CODE></A> ,
- <A HREF="#log"> <CODE>log</CODE></A> ,
- <A HREF="#new"> <CODE>new</CODE></A> ,
- <A HREF="#newstring"> <CODE>newstring</CODE></A> ,
- <A HREF="#newvector"> <CODE>newvector</CODE></A> ,
- <A HREF="#nil"> <CODE>nil</CODE></A> ,
- <A HREF="#oscli"> <CODE>oscli</CODE></A> ,
- <A HREF="#pi"> <CODE>pi</CODE></A> ,
- <A HREF="#print"> <CODE>print</CODE></A> ,
- <A HREF="#put"> <CODE>put</CODE></A> ,
- <A HREF="#putc"> <CODE>putc</CODE></A> ,
- <A HREF="#quit"> <CODE>quit</CODE></A> ,
- <A HREF="#repeat"> <CODE>repeat</CODE></A> ,
- <A HREF="#rnd"> <CODE>rnd</CODE></A> ,
- <A HREF="#return"> <CODE>return</CODE></A> ,
- <A HREF="#seed"> <CODE>seed</CODE></A> ,
- <A HREF="#sin"> <CODE>sin</CODE></A> ,
- <A HREF="#sizeof"> <CODE>sizeof</CODE></A> ,
- <A HREF="#sqrt"> <CODE>sqrt</CODE></A> ,
- <A HREF="#start_task"> <CODE>start_task</CODE></A> ,
- <A HREF="#static"> <CODE>static</CODE></A> ,
- <A HREF="#stderr"> <CODE>stderr</CODE></A> ,
- <A HREF="#stdin"> <CODE>stdin</CODE></A> ,
- <A HREF="#stdout"> <CODE>stdout</CODE></A> ,
- <A HREF="#swi"> <CODE>swi</CODE></A> ,
- <A HREF="#switch"> <CODE>switch</CODE></A> ,
- <A HREF="#sysvar"> <CODE>sysvar</CODE></A> ,
- <A HREF="#tan"> <CODE>tan</CODE></A> ,
- <A HREF="#this"> <CODE>this</CODE></A> ,
- <A HREF="#time"> <CODE>time</CODE></A> ,
- <A HREF="#typeof"> <CODE>typeof</CODE></A> ,
- <A HREF="#until"> <CODE>until</CODE></A> ,
- <A HREF="#val"> <CODE>val</CODE></A> ,
- <A HREF="#vector"> <CODE>vector</CODE></A> ,
- <A HREF="#wimp_closedown"> <CODE>wimp_closedown</CODE></A> ,
- <A HREF="#wimp_init"> <CODE>wimp_init</CODE></A> ,
- <A HREF="#wimp_report"> <CODE>wimp_report</CODE></A> ,
- <A HREF="#while"> <CODE>while</CODE></A> ,
- <A HREF="#or"> <CODE>|</CODE></A> ,
- <A HREF="#orequal"> <CODE>|=</CODE></A> ,
- <A HREF="#or2"> <CODE>||</CODE></A> ,
- <A HREF="#or2equal"> <CODE>||=</CODE></A> ,
- <A HREF="#tilde"> <CODE>~</CODE></A> ,
- <A HREF="#backquote"> <CODE>`</CODE></A> ,
- <A HREF="#backquote2"> <CODE>``</CODE></A> ,
- <A HREF="#pound"> <CODE>£</CODE></A> ,
- <A HREF="#pound2"> <CODE>££</CODE></A> ,
- <HR>
- <DL>
-
- <DT><A NAME="pling"><CODE>!</CODE></A>
- <DD><CODE>!x </CODE> Returns 0 if <CODE>x </CODE>
- is nonzero and 1 otherwise. <CODE>x </CODE> must be
- an integer.
-
- <DT><A NAME="notequal"><CODE>!=</CODE></A>
- <DD><CODE>x != y </CODE> Both <CODE>x, y </CODE> must be
- integers, strings or reals. It returns 1 if they are
- different and 0 if they are equal.
-
- <DT><A NAME="dollar"><CODE>$</CODE></A>
- <DD><CODE>$(x) </CODE> is the string stored at address
- <CODE>x </CODE>. The string is terminated by any character
- with ASCII code less than 32. The address <CODE>x </CODE>
- should be an integer divisible by 4.
-
- <DT><A NAME="dollar2"><CODE>$$</CODE></A>
- <DD><CODE>$$(x,s) </CODE> returns the value of the string
- <CODE>s </CODE> and places <CODE>s </CODE> at address
- <CODE>x </CODE>.
- <DD>E.g. <CODE>$$(x,$$(y,s)); </CODE>
- stores <CODE>s </CODE> at both <CODE>x </CODE> and <CODE>y </CODE>.
-
- <DT><A NAME="percent"><CODE>%</CODE></A>
- <DD><CODE>x % y </CODE> is remainder for dividing the
- integer <CODE>x </CODE> by the integer <CODE>y </CODE>.
-
- <DT><A NAME="percentequal"><CODE>%=</CODE></A>
- <DD><CODE>x %= y </CODE> Assign <CODE>x%y </CODE> to
- <CODE>x </CODE>, and then return <CODE>x </CODE>.
-
- <DT><A NAME="and"><CODE>&</CODE></A>
- <DD><CODE>x & y </CODE> returns the bitwise XOR of
- <CODE>x </CODE> and <CODE>y </CODE>. Both <CODE>x,y </CODE>
- must be integers.
-
- <DT><A NAME="and2"><CODE>&&</CODE></A>
- <DD><CODE>x && y </CODE> If <CODE>x </CODE> is
- zero the expression returns 0 without evaluating
- <CODE>y </CODE>. Otherwise it returns 0 if
- <CODE>y </CODE> is zero and 1 otherwise. Both
- <CODE>x,y </CODE> must be integers.
-
- <DT><A NAME="andequal"><CODE>&=</CODE></A>
- <DD><CODE>x &= y </CODE> Assign <CODE>x&y </CODE>
- to <CODE>x </CODE> and then return <CODE>x </CODE>. Both
- <CODE>x,y </CODE> must be integers.
-
- <DT><A NAME="and2equal"><CODE>&&=</CODE></A>
- <DD><CODE>x &&= y </CODE> Assign <CODE>x&&y </CODE>
- to <CODE>x </CODE> and then return <CODE>x </CODE>. Both
- <CODE>x,y </CODE> must be integers.
-
- <DT><A NAME="times"><CODE>*</CODE></A>
- <DD><CODE>x * y</CODE> The values <CODE>x, y </CODE>
- are reals or integers. Their product is returned.
- The type of the result is real if either
- <CODE>x </CODE> or <CODE>y </CODE> is a real
- and integer otherwise.
-
- <DT><A NAME="timesequal"><CODE>*=</CODE></A>
- <DD><CODE>x *= y </CODE> Assign <CODE>x*y </CODE>
- to <CODE>x </CODE> and then return <CODE>x </CODE>.
-
- <DT><A NAME="plus"><CODE>+</CODE></A>
- <DD><CODE>x + y </CODE> If <CODE>x, y </CODE> are both integers
- or both reals it returns their sum. If
- <CODE>x, y </CODE> are both strings it returns their
- concatenation. If either <CODE>x </CODE> or <CODE>y </CODE>
- is a string and the other argument is an integer, the
- other argument is converted to the string consisting
- of the single character given by the ASCII code of
- the bottom 8 bits and the result is the concatenation
- of the two strings.
-
- <DT><A NAME="plus2"><CODE>++</CODE></A>
- <DD><CODE>x++ </CODE> Evaluate <CODE>x </CODE> in the current
- expression, and then assign <CODE>x+1 </CODE> to <CODE>x </CODE>.
- <DD><CODE>++x </CODE> Assign <CODE>x+1 </CODE> to <CODE>x </CODE>
- before further evaluation.
-
- <DT><A NAME="plusequal"><CODE>+=</CODE></A>
- <DD><CODE>x += y </CODE> Assign <CODE>x+y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="minus"><CODE>-</CODE></A>
- <DD><CODE>x - y </CODE> The values <CODE>x, y </CODE> are
- both integers or both reals. Their difference is returned.
-
- <DT><A NAME="minus2"><CODE>--</CODE></A>
- <DD><CODE>x-- </CODE> Evaluate <CODE>x </CODE> in the current
- expression, and then assign <CODE>x-1 </CODE> to <CODE>x </CODE>.
- <DD><CODE>--x </CODE> Assign <CODE>x-1 </CODE> to <CODE>x </CODE>
- before further evaluation.
-
- <DT><A NAME="minusequal"><CODE>-=</CODE></A>
- <DD><CODE>x -= y </CODE> Assign <CODE>x-y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="divide"></A><CODE>/</CODE></A>
- <DD></A><CODE>x / y </CODE></A> If <CODE>x </CODE> is an
- integer, then so must <CODE>y </CODE> be and an integer
- and their quotient is returned. If <CODE>x </CODE> is real
- <CODE>y </CODE> may be either an integer or a real and
- the real quotient is returned.
-
- <DT><A NAME="divideequal"><CODE>/=</CODE></A>
- <DD><CODE>x /= y </CODE> Assign <CODE>x/y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="arrow"><CODE>-></CODE></A>
- <DD><CODE>myinstance->mymethod </CODE> is the function obtained
- when method <CODE>mymethod </CODE> is instantiated for the instance
- <CODE>myinstance </CODE>.
- <DD> E.g. <CODE>print("The x-coordinate of vertex is ",
- vertex->x(),"\n");</CODE>
- <DD>Each instance object of a class has its own private copy
- of the class's data, which can only be updated or accessed
- using a method.
-
- <DT><A NAME="colon"><CODE>:</CODE></A>
- <DD><CODE>c?yes:no </CODE> see <A HREF="#query> ?</A>.
- <DD><CODE>class child:parent { ... } </CODE> declares
- <CODE> child </CODE> as a subclass of <CODE> parent </CODE>.
- Instance objects of <CODE> child </CODE> have access to the
- methods of <CODE> parent </CODE>.
-
- <DT><A NAME="colon2"><CODE>::</CODE></A>
- <DD><CODE>myclass::mymethod() </CODE> declares
- <CODE>mymethod()</CODE> to be a method for the
- <A HREF="#class">class </A> <CODE>myclass</CODE>.
-
- <DT><A NAME="lessthan"><CODE><</CODE></A>
- <DD><CODE>x < y </CODE> The values <CODE>x, y </CODE> are
- both integers, strings or reals. It returns 1
- if <CODE>x </CODE> strictly precedes <CODE>y </CODE>,
- otherwise it returns 0.
-
- <DT><A NAME="lessthan2"><CODE><<</CODE></A>
- <DD><CODE>x << y </CODE> If <CODE>x, y </CODE> are
- both integers it returns <CODE>x </CODE> shifted left by
- <CODE>y </CODE> bits. If <CODE>x </CODE> is an iostream and
- <CODE>y </CODE> a string, it outputs <CODE>y </CODE> to
- <CODE>x </CODE> and returns the result <CODE>x </CODE>.
-
- <DT><A NAME="lessthanequal"><CODE><=</CODE></A>
- <DD><CODE>x <= y </CODE> The values <CODE>x, y </CODE> are
- both integers, strings or reals. It returns 1
- if <CODE>x </CODE> precedes or equals <CODE>y </CODE>,
- otherwise it returns 0.
-
- <DT><A NAME="lessthan2equal"><CODE><<=</CODE></A>
- <DD><CODE>x <<= y </CODE> Assign <CODE>x<<y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="assign"><CODE>=</CODE></A>
- <DD><CODE>x = y </CODE> Assign <CODE>y </CODE> to
- <CODE>x </CODE> and return that value.
-
- <DT><A NAME="equal"><CODE>==</CODE></A>
- <DD><CODE>x == y </CODE> The values <CODE>x, y </CODE> are
- both integers, strings or reals. It returns 0
- if they are different and 1 if they are equal.
-
- <DT><A NAME="greater"><CODE>></CODE></A>
- <DD><CODE>x > y </CODE> The values <CODE>x, y </CODE> are
- both integers, strings or reals. It returns 1 if
- if <CODE>y </CODE> strictly precedes <CODE>x </CODE>,
- otherwise it returns 0.
-
- <DT><A NAME="greaterequal"><CODE>>=</CODE></A>
- <DD><CODE>x >= y </CODE> The values <CODE>x, y </CODE> are
- both integers, strings or reals. It returns 1 if
- if <CODE>y </CODE> precedes or equals <CODE>x </CODE>,
- otherwise it returns 0.
-
- <DT><A NAME="greater2"><CODE>>></CODE></A>
- <DD><CODE>x >> y </CODE> The values <CODE>x, y </CODE> are
- both integers. It returns <CODE>x </CODE> arithmetically shifted
- right by <CODE>y </CODE> bits.
-
- <DT><A NAME="greater2equal"><CODE>>>=</CODE></A>
- <DD><CODE>x >>= y </CODE> Assign <CODE>x>>y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="query"><CODE>?</CODE></A>
- <DD><CODE>c?yes:no </CODE> The value <CODE>c </CODE> an integer.
- If it is nonzero, the expression evaluates and returns
- the value of <CODE>yes </CODE> (<CODE>no </CODE> is
- not evaluated), otherwise it evaluates and returns
- the value of <CODE>no </CODE> (<CODE>yes </CODE> is not evaluated).
-
- <DT><A NAME="hat"><CODE>^</CODE></A>
- <DD><CODE>x ^ y </CODE> Both <CODE>x, y </CODE> are integers.
- Returns the bitwise XOR of <CODE>x </CODE> and <CODE>y </CODE>.
-
- <DT><A NAME="hatequal"><CODE>^=</CODE></A>
- <DD><CODE>x ^= y </CODE> Assign <CODE>x^y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="or"><CODE>|</CODE></A>
- <DD><CODE>x | y </CODE> Both <CODE>x, y </CODE> are integers.
- Returns the bitwise OR of <CODE>x </CODE> and <CODE>y </CODE>.
-
- <DT><A NAME="orequal"><CODE>|=</CODE></A>
- <DD><CODE>x |= y </CODE> Assign <CODE>x|y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="or2"><CODE>||</CODE></A>
- <DD><CODE>x || y </CODE> Both <CODE>x, y </CODE> are integers.
- If <CODE>x</CODE> is nonzero, the expression
- evaluates to 1, without evaluating <CODE>y</CODE>. Otherwise
- it returns 0 if <CODE>y</CODE> is zero and 1 otherwise.
-
- <DT><A NAME="or2equal"><CODE>||=</CODE></A>
- <DD><CODE>x ||= y </CODE> Assign <CODE>x||y </CODE> to
- <CODE>x </CODE>, and return <CODE>x </CODE>.
-
- <DT><A NAME="tilde"><CODE>~</CODE></A>
- <DD><CODE>~x </CODE> returns the bitwise NOT of the integer
- <CODE>x </CODE>.
-
- <DT><A NAME="at"><CODE>@</CODE></A>
- <DD><CODE>@(s) </CODE> is the address of the first character of the
- string <CODE>s</CODE>. This address is divisible by 4. Strings
- are stored as a consecutive array of bytes.
- <DD>E.g. <CODE>@s = @(s = "hello");</CODE>
-
- <DT><A NAME="acos"><CODE>acos</CODE></A>
- <DD><CODE>acos(x) </CODE> is arc-cos of the real <CODE>x</CODE>.
-
- <DT><A NAME="asin"><CODE>asin</CODE></A>
- <DD><CODE>asin(x) </CODE> is arc-sine of the real <CODE>x</CODE>.
-
- <DT><A NAME="atan"><CODE>atan</CODE></A>
- <DD><CODE>atan(x) </CODE> is arc-tangent of the real <CODE>x</CODE>.
-
- <DT><A NAME="break"><CODE>break</CODE></A>
- <DD><CODE>break; </CODE> Jump out of the current structure.
- It only makes sense within a <CODE>switch</CODE>, <CODE>do</CODE>/
- <CODE>repeat</CODE>, <CODE>for</CODE> or <CODE>while</CODE> structure.
-
- <DT><A NAME="call"><CODE>call</CODE></A>
- <DD><CODE>call(adr,r0); </CODE> Call machine code at the address
- <CODE>adr</CODE> with register R0 holding the address
- <CODE>r0</CODE>. The same calling conventions should be used
- as for C. So the code should return with MOV PC,R14 and should
- preserve registers R10 - R14. The address <CODE>r0</CODE> should
- be used for a buffer for passing data in and out.
-
- <DT><A NAME="case"><CODE>case</CODE></A>
- <DD><CODE>case x: </CODE> Part of the
- <A HREF="#switch"><CODE>switch</CODE></A> construct.
-
- <DT><A NAME="class"><CODE>class</CODE></A>
- <DD><CODE>class </CODE> Keyword introducing a class definition.
- Class definitions can only appear at the top level.
- That is to say, they cannot appear inside a
- class definition or a function definition.
- Class definitions must precede the definitions
- of any of their instance objects.
- <DD> E.g. <CODE>class point { q; /* a vector of coordinates */ }</CODE>
- <DD> We say that the class <CODE>point</CODE> has the vector
- <CODE>q</CODE> as its <EM>data</EM>.
- <EM>Methods</EM> for a class can be declared inside the class's
- definition but this is optional. They must be defined
- outside the class definition. For example, to add a method
- to <CODE>point</CODE> to read its first coordinate, we could have
- <DD> <CODE>point::x() { return q[0]; }</CODE>
- <DD> Method definitions are exactly like function definitions
- except that the class name, followed by <CODE>::</CODE>,
- prefixes the method name. The same method name can be
- used in different classes. That is to say, data and
- method names are local to a class. The variable
- <A HREF="#this"><CODE>this</CODE></A> can be used in a method to
- refer to the instance object using the method.
-
- <DT><A NAME="continue"><CODE>continue</CODE></A>
- <DD><CODE>continue; </CODE> Start the next iteration of the smallest
- enclosing <CODE>do</CODE>/<CODE>repeat, for</CODE> or
- <CODE>while</CODE> structure.
-
- <DT><A NAME="cos"><CODE>cos</CODE></A>
- <DD><CODE>cos(x) </CODE> is cosine of the real <CODE>x</CODE>.
-
- <DT><A NAME="default"><CODE>default</CODE></A>
- <DD><CODE>default: </CODE> the default alternative in the
- <A HREF="#switch"><CODE>switch</CODE></A> structure.
-
- <DT><A NAME="do"><CODE>do</CODE></A>
- <DD><CODE>do ... until/while (x); </CODE> Looping construct where the body is executed at least once.
-
- <DT><A NAME="else"><CODE>else</CODE></A>
- <DD><CODE>else </CODE> Optional part of
- <A HREF="#if"><CODE>if</CODE></A> construct.
-
- <DT><A NAME="enum"><CODE>enum</CODE></A>
- <DD><CODE>enum { x1, ... , xn } </CODE> This returns the integer
- <CODE>n</CODE> and assigns the values 0, 1, ... (n-1) to the n
- variables <CODE> x1, ... xn </CODE> in order. It is useful for
- hiding explicit indexing.
-
- <DT><A NAME="exp"><CODE>exp</CODE></A>
- <DD><CODE>exp(x) </CODE> is exponential of the real <CODE> x </CODE>.
-
- <DT><A NAME="fclose"><CODE>fclose</CODE></A>
- <DD><CODE>fclose(fp); </CODE> closes the iostream <CODE> fp </CODE>
- and returns <CODE> nil </CODE>.
-
- <DT><A NAME="floor"><CODE>floor</CODE></A>
- <DD><CODE>floor(x) </CODE> is the integer part of the real
- value <CODE> x </CODE>.
-
- <DT><A NAME="fopen"><CODE>fopen</CODE></A>
- <DD><CODE>fopen(fname,mode) </CODE> tries to open a new iostream
- connected to the file named by the string <CODE>fname</CODE>.
- If unsuccessful, returns <CODE>nil</CODE>, and otherwise returns
- the iostream itself. The mode variable can take the values
- "r" (read), "w" (write) and
- "a" (append).
-
- <DT><A NAME="for"><CODE>for</CODE></A>
- <DD><CODE>for(start;terminate;action) .... </CODE> iteration construct.
- <DD> E.g. <CODE><PRE>
- for(i = 0; i <; sizeof(v); i++)
- print("v[",i,"] = ",v[i],"\n");
- </PRE></CODE>
-
- <DT><A NAME="gc"><CODE>gc</CODE></A>
- <DD><CODE>gc(); </CODE> forces garbage collection. The value
- <CODE>nil</CODE> is returned.
-
- <DT><A NAME="getarg"><CODE>getarg</CODE></A>
- <DD><CODE>getarg(i) </CODE> returns the <CODE>i</CODE>-th
- argument on the command line as a string, if there is one, and
- <CODE>nil</CODE> if there is none. The 0-th argument is the command
- itself (the program's pathname).
- <DD> E.g. <CODE><PRE>
- for(i = 1; typeof(arg = getarg(i)); i++)
- process(arg);</PRE></CODE>
-
- <DT><A NAME="getc"><CODE>getc</CODE></A>
- <DD><CODE>getc(fp) </CODE> returns either the next byte from the
- iostream <CODE>fp</CODE> or <CODE>EOF</CODE>.
-
- <DT><A NAME="if"><CODE>if</CODE></A>
- <DD><CODE>if (condition) ... else ... </CODE> conditional construct.
- A condition is regarded as false if it is either the integer 0
- or the value <CODE>nil</CODE>. Other values count as true.
-
- <DT><A NAME="in"><CODE>in</CODE></A>
- <DD><CODE>in buffer put { x1; .... xn ;} </CODE> structure.
- <CODE>buffer</CODE> is either a string or an integer address.
- The values <CODE>x1 ... xn</CODE> are strings or integers.
-
- <DT><A NAME="input"><CODE>input</CODE></A>
- <DD><CODE>input() </CODE> Returns an input string. Leading spaces are
- not removed. To input a number use the function
- <A HREF="#val"><CODE>val</CODE></A>.
- <DD>E.g. <CODE>n = val(input());</CODE>
-
- <DT><A NAME="local"><CODE>local</CODE></A>
- <DD><CODE>local x1, ... xn ;</CODE> declares <CODE>x1, ... ,xn</CODE>
- to be local variables. This statement must precede all others in
- the body of a function or method definition.
-
- <DT><A NAME="log"><CODE>log</CODE></A>
- <DD><CODE>log(x) </CODE> is natural logarithm of the real <CODE>x</CODE>.
-
- <DT><A NAME="new"><CODE>new</CODE></A>
- <DD><CODE>new </CODE> is used to create instance objects of classes.
- <DD> E.g. for a class foo <CODE>x = new foo( ... );</CODE>
-
- <DT><A NAME="newstring"><CODE>newstring</CODE></A>
- <DD><CODE>newstring(n) </CODE> Allocates an array of
- <CODE>n</CODE> bytes in the heap, starting on a
- word boundary, initializes them to zero, and returns
- the string which has this array as its value.
-
- <DT><A NAME="newvector"><CODE>newvector</CODE></A>
- <DD><CODE>newvector(n) </CODE> Allocates space in the heap
- for an <CODE>n</CODE>-component vector, whose values
- are all <CODE>nil</CODE>, and returns this vector.
- <DD>E.g.<CODE><PRE>
- loopy = newvector(2);
- loopy[0] = loopy; </PRE></CODE>
-
- <DT><A NAME="nil"><CODE>nil</CODE></A>
- <DD><CODE>nil </CODE> the single value of type NIL. This is
- used to represent undefined quantities.
-
- <DT><A NAME="oscli"><CODE>oscli</CODE></A>
- <DD><CODE>oscli(s) </CODE> Sends a string s to the command line
- interpreter. The value <CODE>nil</CODE> is returned.
-
- <DT><A NAME="pi"><CODE>pi</CODE></A>
- <DD><CODE>pi </CODE> is an approximation to the ratio of the
- circumference of a circle to its diameter.
-
- <DT><A NAME="print"><CODE>print</CODE></A>
- <DD><CODE>print(x1, ... ,xn); </CODE> Print the items
- <CODE>x1, .... xn</CODE> and return
- <CODE>nil</CODE>. Newlines are not automatically
- appended. The digrams <CODE>\n, \t, \\</CODE> can be used
- in strings for newline, tab and \, respectively.
- <CODE>print</CODE> should not be used in a wimp program.
-
- <DT><A NAME="put"><CODE>put</CODE></A>
- <DD><CODE>in buffer put {x1; .... xn; } </CODE> See
- <A HREF="#in"><CODE>in</CODE></A>.
-
- <DT><A NAME="putc"><CODE>putc</CODE></A>
- <DD><CODE>putc(ch,fp); </CODE> Writes the character ch to the
- iostream <CODE>fp</CODE>. Returns <CODE>nil</CODE>.
-
- <DT><A NAME="quit"><CODE>quit</CODE></A>
- <DD><CODE>quit(s); </CODE> Causes the program to exit with a message
- <CODE>s</CODE> to <CODE>stderr</CODE> and returns
- <CODE>nil</CODE>. In wimp programs
- <CODE>wimp_closedown</CODE> is called.
-
- <DT><A NAME="repeat"><CODE>repeat</CODE></A>
- <DD><CODE>repeat </CODE> is a synonym for
- <A HREF="#do"><CODE>do</CODE></A>.
-
- <DT><A NAME="rnd"><CODE>rnd</CODE></A>
- <DD><CODE>rnd() </CODE> returns a random positive integer.
-
- <DT><A NAME="return"><CODE>return</CODE></A>
- <DD><CODE>return x; </CODE> returns <CODE>x </CODE> as the
- value of a function or method. <CODE>return; </CODE>
- is equivalent to <CODE>return nil; </CODE>.
-
- <DT><A NAME="seed"><CODE>seed</CODE></A>
- <DD><CODE>seed(n) ;</CODE> Seeds the random number generator
- with the integer <CODE>n </CODE> and returns
- <CODE>nil </CODE>.
-
- <DT><A NAME="sin"><CODE>sin</CODE></A>
- <DD><CODE>sin(x) </CODE> is sine of the real <CODE>x </CODE>.
-
- <DT><A NAME="sizeof"><CODE>sizeof</CODE></A>
- <DD><CODE>sizeof(s) </CODE> returns the number of characters in a string
- <CODE>s </CODE>, or the number of components of a vector
- <CODE>s </CODE>, as an integer.
-
- <DT><A NAME="sqrt"><CODE>sqrt</CODE></A>
- <DD><CODE>sqrt(x) </CODE> is square-root of the real <CODE>x </CODE>.
-
- <DT><A NAME="start_task"><CODE>start_task</CODE></A>
- <DD><CODE>start_task(s) </CODE> takes a command in the string
- <CODE>s </CODE> to start up a child task, and returns its task
- handle. This works both from <A HREF="Run#BobFile>BobFiles </A>
- (i.e. from a command window) or from
- <A HREF="Run#BobTask>BobTasks</A> (i.e. from a taskwindow).
- This function should only be used outside wimp programs
- (i.e. before <A HREF="#wimp_init><CODE>wimp_init</CODE></A>
- or after <A HREF="#wimp_closedown><CODE>wimp_closedown </CODE></A>.
- There are other means of starting a child task from within a wimp
- program.
-
- <DT><A NAME="static"><CODE>static</CODE></A>
- <DD><CODE>static </CODE> prefix for the declaration of
- static data and methods in a class definition. Such
- data and methods are shared by all instances of a
- class. Static methods may not use the variable
- <A HREF="#this"><CODE>this </CODE></A>. A typical
- use of static variables would be a variable to count
- the number of instance objects of a certain kind.
- <DD> E.g.<CODE><PRE>
- class foo
- {
- static total;
- ..........
- }
-
- foo::foo(...)
- {
- if (typeof(total)) total += 1;
- else total = 1;
- ...............
- }
-
- foo::current_number()
- { return total; }
- </PRE></CODE>
-
-
- <DT><A NAME="stderr"><CODE>stderr</CODE></A>
- <DD><CODE>stderr </CODE> is a built-in iostream.
-
- <DT><A NAME="stdin"><CODE>stdin</CODE></A>
- <DD><CODE>stdin </CODE> is a built-in iostream.
-
- <DT><A NAME="stdout"><CODE>stdout</CODE></A>
- <DD><CODE>stdout </CODE> is a built-in iostream.
-
- <DT><A NAME="swi"><CODE>swi</CODE></A>
- <DD><CODE>swi(x,r) </CODE> calls SWI <CODE>x </CODE>, given
- either as a string or number, with registers R0-R7 preloaded
- with the first 8 components of the vector <CODE>r </CODE>,
- and returns <CODE>nil </CODE> with the components of
- <CODE>r </CODE> updated to the returned values in registers
- R0-R7. Note that even though a SWI may pass no values in
- registers, it is necessary for the second argument to be a vector
- with at least 8 components.
- <DD>E.g.<CODE><PRE>
- event_process(maskptr,buffer,action,user)
- {
- local r, respond, go_on;
- r = newvector(8);
- go_on = TRUE;
- while(go_on)
- {
- r[0] = maskptr[0];
- r[1] = buffer;
- swi("Wimp_Poll",r);
- go_on =
- (typeof(respond = action[r[0]])
- == BYTECODE)?respond(buffer,user,maskptr):TRUE;
- }
- wimp_closedown();
- } </PRE></CODE>
-
-
- <DT><A NAME="switch"><CODE>switch</CODE></A>
- <DD><CODE>switch (c) { .... } </CODE> is the multibranch
- conditional structure.
-
- <DT><A NAME="sysvar"><CODE>sysvar</CODE></A>
- <DD><CODE>sysvar(s) </CODE> Returns the string value of the
- string system variable <CODE>s </CODE> or <CODE>nil </CODE>
- if the variable is unset.
- <DD> E.g. <CODE>print(sysvar("Bob$Path"),"\n");</CODE>
-
- <DT><A NAME="tan"><CODE>tan</CODE></A>
- <DD><CODE>tan(x) </CODE> is tangent of the real <CODE>x </CODE>.
-
- <DT><A NAME="this"><CODE>this</CODE></A>
- <DD><CODE>this </CODE> is a variable that can be used in a method
- to refer to the instance object using the method.
- <DD>E.g.<CODE><PRE>
- foo::methodA( .. )
- {
- .... this->methodB(...) ...
- } </PRE></CODE>
-
- <DT><A NAME="time"><CODE>time</CODE></A>
- <DD><CODE>time() </CODE> Returns the first 32 bits of the time in
- centiseconds since the beginning of the century.
-
- <DT><A NAME="typeof"><CODE>typeof</CODE></A>
- <DD><CODE>typeof(x) </CODE> returns the integer code
- describing the type of <CODE>x </CODE>. The type of <CODE>nil </CODE>
- is 0, and all other values return a nonzero value.
- This is useful for coping with undefined vector components.
- <DD> E.g. <CODE> a = typeof(a)?a:0;</CODE>
-
- <DT><A NAME="until"><CODE>until</CODE></A>
- <DD><CODE>until c </CODE> terminating condition for
- <CODE>do/repeat </CODE> structure.
-
- <DT><A NAME="val"><CODE>val</CODE></A>
- <DD><CODE>val(s) </CODE> Converts as many characters of the
- string <CODE>s </CODE> to a number as it can. Decimal
- or hexadecimal numbers (prefixed by &) are recognized.
- Note that the hexadecimal digits <CODE>a,b,c,d,e,f </CODE>
- are in lower case. Reals are distinguished by a decimal
- point.
-
- <DT><A NAME="vector"><CODE>vector</CODE></A>
- <DD><CODE>vector {expr1; ... exprn; } </CODE> returns a new vector
- with components <CODE>expr1 ... exprn </CODE>.
- There must be at least one component.
-
- <DT><A NAME="wimp_closedown"><CODE>wimp_closedown</CODE></A>
- <DD><CODE>wimp_closedown() </CODE> Programs running as wimp
- tasks must use this function before terminating.
- It returns <CODE>nil </CODE>.
-
- <DT><A NAME="wimp_init"><CODE>wimp_init</CODE></A>
- <DD><CODE>wimp_init(version,name,mesg_list) </CODE> registers
- a task with the window manager. <CODE>version </CODE> is
- 100 times the version number of RISC OS being used,
- <CODE>name </CODE> is the name of the wimp task, and
- <CODE>mesg_list </CODE> is a buffer, given as a string
- or its integer address, containing the messages, stored
- as words and terminated by 0, which the task wishes to
- receive. The function returns the task handle as an
- integer.
-
- <DT><A NAME="wimp_report"><CODE>wimp_report</CODE></A>
- <DD><CODE>wimp_report(s) </CODE> displays string
- <CODE>s </CODE> in a dialogue box and returns 0 if
- no key or mouse button is clicked, 1 if the OK
- button is selected, and 2 if the CANCEL button is selected.
-
- <DT><A NAME="while"><CODE>while</CODE></A>
- <DD><CODE>while c </CODE> terminating condition for
- <CODE>do/repeat </CODE> structure.
-
- <DT><A NAME="backquote"><CODE>`</CODE></A>
- <DD><CODE>`(x) </CODE> Returns as an integer the
- contents of the byte at the address or string
- <CODE>x </CODE>. If <CODE>s </CODE> is a string
- <CODE>`(s) </CODE> is the same as <CODE>s[0] </CODE>.
-
- <DT><A NAME="backquote2"><CODE>``</CODE></A>
- <DD><CODE>``(x,c) </CODE> Place byte <CODE>c </CODE>
- at address <CODE>x </CODE>, and return <CODE>c </CODE>.
-
- <DT><A NAME="pound"><CODE>£</CODE></A>
- <DD><CODE>£(x) </CODE> Returns as an integer the
- contents of the word at the address or string
- <CODE>x </CODE>.
-
- <DT><A NAME="pound2"><CODE>££</CODE></A>
- <DD><CODE>££(x,n) </CODE> Place integer <CODE>n </CODE>
- at address <CODE>x </CODE>, and return <CODE>n </CODE>.
- </DL>
- <HR>
-
-