home *** CD-ROM | disk | FTP | other *** search
- ArmBob v.1.02 Reference GCW 06/06/94
-
- ----------------- BUILT IN NAMES ---------------
-
- The following functions are built into Bob:
-
- getarg(i) string Returns the i-th argument on the
- command line.
-
- gc() nil Force a garbage collection.
-
- newvector(n) vector Create a vector of n nils in the heap.
-
- newstring(n) string Create a string of n ASCII nul codes in
- the heap.
-
- oscli(s) nil Sends a string s to the command line
- interpreter. This was called 'system' in
- Bob.
-
- sizeof(x) integer Returns the size of a string x or the
- number of components of a vector x.
-
- typeof(x) integer x can be anything. See below for the
- synonyms for the type codes.
-
- ArmBob also has the following functions:
-
- input() string Gets an input string. Leading spaces are
- not removed. This uses OS_ReadLine.
-
- quit(s) nil Causes the program to exit with a message
- string s to stderr. See ref.LowLevel for
- behaviour of this function in wimp
- programs.
-
- rnd() integer Returns a random positive integer.
-
- seed(n) nil Seeds the random number generator with
- the integer n.
-
- sysvar(s) string Gets the value of a string system variable
- named by the string s.
-
- time() integer Gets the first 32 bits of the time in
- centiseconds since the beginning of the
- century.
-
- val(s) integer Converts as many characters of the string
- s to an integer as it can. Decimal or
- hexadecimal numbers (prefixed by &) are
- recognized.
-
- start_task(s) integer Takes a command in the string s to start
- up a child task, and returns its task
- handle. This works both from BobFiles
- (i.e. from a command window) or from
- BobTasks (i.e. from a taskwindow). This
- function should only be used outside
- wimp programs (i.e. before wimp_init
- or after wimp_closedown). There are
- other means of starting a child task from
- within a wimp program.
-
-
- See also ref.types for the iostream functions
-
- fclose, getc, fopen, putc, print
-
- and for the built in iostreams stdin, stdout, stderr.
-
- See also ref.LowLevel for built-in wimp functions.
-
- Operators
- ---------
-
- Ternary:
-
- c?yes:no c an integer. If c is nonzero, evaluates to yes (no
- is not evaluated), otherwise it evaluates to no (yes
- is not evaluated).
-
- Binary:
-
- x || y x, y integers. If x is nonzero, evaluates to 1,
- without evaluating y. Otherwise it returns 0 if y
- is zero and -1 otherwise.
-
- x && y x, y integers. If x is zero it returns 0 without
- evaluating y. Otherwise it returns 0 if y is zero
- and 1 otherwise.
-
- x | y x, y integers. Returns the bitwise OR of x and y.
-
- x ^ y x, y integers. Returns the bitwise XOR of x and y.
-
- x & y x, y integers. Returns the bitwise AND of x and y.
-
- x == y x, y both integers or both strings. It returns 0
- if they are different and 1 if they are equal.
-
- x != y x, y both integers or both strings. It returns 1
- if they are different and 0 if they are equal.
-
- x < y x, y both integers or both strings. It returns 1
- if x strictly precedes y or else 0.
-
- x <= y x, y both integers or both strings. It returns 1
- x precedes or equals y or else 0.
-
- x >= y x, y both integers or both strings. It returns 1
- if y precedes or equals x or else 0.
-
- x > y x, y both integers or both strings. It returns 1 if
- if y strictly precedes x or else 0.
-
- x >> y x, y both integers. It returns x arithmetically shifted
- right by y bits.
-
- x << y If x, y are both integers it returns x shifted left by
- y bits. If x is an iostream and y a string, it outputs
- y to x and returns the result x.
-
- x + y If x, y are both integers it returns their sum. If x, y
- are both strings it returns their concatenation. If
- either x or y 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.
-
- x - y x, y both integers. The difference is returned.
-
- x * y x, y both integers. The product is returned.
-
- x % y x, y both integers. The remainder is returned.
-
- x / y x, y both integers. The quotient is returned.
-
- Unary:
-
- -x x integer. Minus x.
-
- !x x integer. Returns 0 if x is nonzero and 1 otherwise.
-
- ~x x integer. Returns the bitwise NOT of x.
-
- Binary assignment:
-
- x = y Assign y to x, and return y.
-
- x += y Assign x+y to x, and return y.
-
- x -= y Assign x-y to x, and return y.
-
- x *= y Assign x*y to x, and return y.
-
- x /= y Assign x/y to x, and return y.
-
- x %= y Assign x%y to x, and return y.
-
- x &= y Assign x&y to x, and return y.
-
- x |= y Assign x|y to x, and return y.
-
- x ^= y Assign x^y to x, and return y.
-
- x >>= y Assign x>>y to x, and return y.
-
- x <<= y Assign x<<y to x, and return y.
-
- Unary assignment:
-
- x++ Evaluate x in current expression, and then assign
- x+1 to x.
-
- x-- Evaluate x in current expression, and then assign
- x-1 to x.
-
- ++x Assign x+1 to x before further evaluation.
-
- --x Assign x-1 to x before further evaluation.
-
- Numerical Synonyms
- ------------------
- The following C source file describes the built-in numerical
- constants:
-
- /* Built in constants */
- /*
- G.C.Wraith 26/1/94
- */
- struct {char *const_keyword; int constant; } constab[] = {
- { "TRUE", 1 },
- { "FALSE", 0 },
- { "EOF", -1 },
- { "NIL", 0 },
- { "CLASS", 1 },
- { "OBJECT", 2 },
- { "VECTOR", 3 },
- { "INTEGER", 4 },
- { "STRING", 5 },
- { "BYTECODE", 6 },
- { "CODE", 7 },
- { "DICTIONARY", 8 },
- { "VARIABLE", 9 },
- { "IOSTREAM", 10 },
- { "Null_Reason_Code", 0 },
- { "Redraw_Window_Request", 1 },
- { "Open_Window_Request", 2 },
- { "Close_Window_Request", 3 },
- { "Pointer_Leaving_Window", 4 },
- { "Pointer_Entering_Window", 5 },
- { "Mouse_Click", 6 },
- { "User_Drag_Box", 7 },
- { "Key_Pressed", 8 },
- { "Menu_Selection", 9 },
- { "Scroll_Request", 10 },
- { "Lose_Caret", 11 },
- { "Gain_Caret", 12 },
- { "Poll_word", 13 },
- { "User_Message", 17 },
- { "User_Message_Recorded", 18 },
- { "User_Message_Acknowledge", 19 },
- { "Message_Quit", 0 },
- { "Message_DataSave", 1 },
- { "Message_DataSaveAck", 2 },
- { "Message_DataLoad", 3 },
- { "Message_DataLoadAck", 4 },
- { "Message_DataOpen", 5 },
- { "Message_RAMFetch", 6 },
- { "Message_RAMTransmit", 7 },
- { "Message_PreQuit", 8 },
- { "Message_PaletteChange", 9 },
- { "Message_SaveDesktop", 10 },
- { "Message_DeviceClaim", 11 },
- { "Message_DeviceInUse", 12 },
- { "Message_DataSaved", 13 },
- { "Message_ShutDown", 14 },
- { "Message_FilerOpenDir", 0x400 },
- { "Message_FilerCloseDir", 0x401 },
- { "Message_FilerOpenDirAt", 0x402 },
- { "Message_FilerSelectionDirectory", 0x403 },
- { "Message_FilerAddSelection", 0x404 },
- { "Message_FilerAction", 0x405 },
- { "Message_FilerControlAction", 0x406 },
- { "Message_FilerSelection", 0x407 },
- { "Message_AlarmSet", 0x500 },
- { "Message_AlarmGoneOff", 0x501 },
- { "Message_HelpRequest", 0x502 },
- { "Message_HelpReply", 0x503 },
- { "Message_MenuWarning", 0x400c0 },
- { "Message_ModeChange", 0x400c1 },
- { "Message_TaskInitialise", 0x400c2 },
- { "Message_TaskCloseDown", 0x400c3 },
- { "Message_SlotSize", 0x400c4 },
- { "Message_SetSlot", 0x400c5 },
- { "Message_TaskNameRq", 0x400c6 },
- { "Message_TaskNameIs", 0x400c7 },
- { "Message_TaskStarted", 0x400c8 },
- { "Message_MenusDeleted", 0x400c9 },
- { "Message_Iconize", 0x400ca },
- { "Message_WindowClosed", 0x400cb },
- { "Message_WindowInf", 0x400cc },
- { "TaskWindow_Input", 0x808c0 },
- { "TaskWindow_Output", 0x808c1 },
- { "TaskWindow_Ego", 0x808c2 },
- { "TaskWindow_Morior", 0x808c3 },
- { "TaskWindow_Morire", 0x808c4 },
- { "TaskWindow_NewTask", 0x808c5 },
- { "TaskWindow_Suspend", 0x808c6 },
- { "TaskWindow_Resume", 0x808c7 },
- { 0, 0 }};
-
- ------------- END -------------------