home *** CD-ROM | disk | FTP | other *** search
Text File | 1988-10-30 | 32.6 KB | 1,002 lines |
-
- lstcput (ld_int value_exp)
-
- Lstcput sets the value of the current list node to value_exp.
- It does not create a new node. The current location is not changed
- by this function.
-
- See also: lsthead, lsttail, lstprev, lstnext, lstsub
-
- lstcre ([init_exp...])
-
- Lstcre creates a list and returns a list descriptor. The list
- may be initialized by specifying an optional list of init_exp...
-
- Lists are collections of nodes. Each node can contain one value
- and can be connected to other nodes. Possible connections are:
-
- to a previous node
- to a subsequent (or next) node
- to an alternate (or sub) node
-
- New nodes are added to a list by push operations. These are
- identified by a "psh" suffix. Existing nodes are removed
- from a list by pop operations. These are identified by a "pop"
- suffix. The value of a node may be retrieved using list functions
- with a "get" suffix and updated using list functions with a
- "put" suffix.
-
- A current location, initially undefined, may be associated with
- each list. The current location may be set to the head or tail
- and moved to a previous, next or sub node. The current location
- may then be used to add or remove nodes and get or put the value
- of nodes.
-
- Each list is identified by its list descriptor and all list
- builtin functions require that the list descriptor be specified
- as the first argument.
-
- See also: lstfre
-
- lstcval (ld_int)
-
- Lstcval returns TRUE if the current location is set for the
- specified list descriptor and FALSE otherwise.
-
- See also: lsthead, lsttail, lstprev, lstnext, lstsub
-
- lstfre (ld_int)
-
- Lstfre frees the list specified by the list descriptor. Once a
- list is freed its storage is reused and it can no longer by
- referenced.
-
- See also: lstcre
-
- lsthead (ld_int)
-
- Lsthead moves the current location to the head of the list
- specified by ld_int. If the list is empty the current location
- remains undefined.
-
- See also: lstcget, lstcput, lstcpsh, lstcpop
-
- lsthget (ld_int)
-
- Lsthget returns the value of the head node of the list. The
- node is not removed.
-
- lsthpsh (ld_int value_exp)
- lstpsh
-
- Lsthpsh creates a new node at the head of the list specified by
- ld_int and initializes it to value_exp. Used with lsttpop, which
- removes a node from the tail of the list, it forms a simple
- FIFO queue.
-
-
- lsthput (ld_int value_exp)
-
- Lsthput sets the value of the head node of the list specified
- by ld_int to value_exp. It does not create a new node.
-
- lstnext (ld_int)
-
- Lstnext moves the current location to the next node in the list
- specified by ld_int. If no current location has been set or the list
- is empty then the current location remains undefined.
-
- See also: lstcget, lstcput, lstcpsh, lstcpop
-
- lstnval (ld_int)
-
- Lstnval returns TRUE if there is a node following the current
- location and FALSE otherwise.
-
- lstprev (ld_int)
-
- Lstprev moves the current location to the previous node in the list
- specified by ld_int. If no current location has been set or the list
- is empty then current location remains undefined.
-
- See also: lstcget, lstcput, lstcpsh, lstcpop
-
- lstpval (ld_int)
-
- Lstpval returns TRUE if there is a node preceding the current
- location and FALSE otherwise.
-
- lstread (fd_int)
-
- Lstread reads a list from the file specified by the file
- descriptor fd_int and returns a list descriptor for the new
- list. The file must be in the format created by lstwrite. Each
- list or sublist must be surrounded by parentheses and each
- element must be surrounded by quotes. Embedded quotes must
- be escaped using the \" notation. White space and text
- outside quotes is ignored.
-
- lstsget (ld_int)
-
- Lstsget returns the value of the sub node of the current
- node of the list specified by ld_int. The node is not removed.
- The current location must have been defined previously.
-
- lstsize (ld_int)
-
- Lstsize returns the total number of nodes, including sub lists,
- in the list specified by ld_int.
-
- lstsort (ld_int [compare_udf])
-
- Lstsort sorts the list specified by ld_int. A user defined
- compare function may be specified that will be invoked for each
- comparison required by the sort. The function will be passed two
- values and should return -1, 0 or 1 as the first value is less
- than, equal to or greater than the second value. Lstsort sorts
- sub lists if any exist.
-
- lstspop (ld_int)
-
- Lstspop removes the sub node of the current node from the
- list specifed by ld_int and returns its value. Once a node is
- removed it is no longer accessible. If the sub node is the
- head of a sublist then the entire sublist is freed.
-
- lstspsh (ld_int value_exp)
-
- Lstspsh creates a sub list from the current location. A sub list
- has all the attributes of a list except that it is referenced from
- a node rather than a list descriptor. This may be used to implement
- trees. A sub list node is created at the current location and
- initialized to value_exp. If there was previously a sub list then
- the new node is inserted between the current node and the sub
- list. The new node becomes the new current location.
-
- lstsput (ld_int value_exp)
-
- Lstsput sets the value of the sub node of the current node
- of the list specified by ld_int to value_exp. It does not create
- a new node. The current location must have been defined previously.
-
- lstsub (ld_int)
-
- Lstsub moves the current location to the sub node in the list
- specified by ld_int. If no current location has been set or the list
- is empty then the current location remains undefined.
-
- See also: lstcget, lstcput, lstcpsh, lstcpop
-
- lstsval (ld_int)
-
- Lstsval returns TRUE if there is a sub node at the current
- location and FALSE otherwise.
-
- lsttail (ld_int)
-
- Lsttail sets the current location of the list specified by
- ld_int to the tail of the list.
-
- See also: lstcget, lstcput, lstcpsh, lstcpop
-
- lsttget (ld_int)
-
- Lsttget returns the value of the tail node of the list. The
- node is not removed.
-
- lsttpop (ld_int)
- lstpop
-
- Lstpop removes a node from the tail of the list specified by
- ld_int and returns its value. Once a node is removed from a list
- it is no longer accessible. Used with lsthpsh, which pushes a
- node on the head of the list, it forms a simple FIFO queue.
- If the node that was removed was the current location then
- the current location becomes undefined.
-
- lsttpsh (ld_int value_exp)
-
- Lsttpsh creates and inserts a new list node at the tail of
- the list specified by ld_init. The new node becomes the new
- tail of the list.
-
- lsttput (ld_int value_exp)
-
- Lsttput sets the value of the tail node of the list specified
- by ld_int to value_exp. It does not create a new node.
-
- lstwrite (ld_int fd_int)
-
- Lstwrite writes the list specified by the list descriptor
- ld_int to the file specified by the file descriptor fd_int.
- Each list or sublist is surrounded by parenthesis and each
- list element is surrounded by quotes. The list is indented
- using tabs for readability.
-
- lt (value_num...)
- <
-
- Lt performs a less than comparison of its
- arguments from left to right and returns true if each argument
- passes the comparison, otherwise false. If only one argument is
- specified it compares it to zero and returns the result.
-
- memcre (len_int)
-
- Memcre allocates a len_int bytes (characters) of memory directly
- from the system and returns the address.
-
- Note: the address is returned in hexadecimal.
-
- memfre (address_hex)
-
- Memfre frees a block of memory previously allocated by memcre. This
- function should be used with extreme care because no check is
- performed to validate the address prior to freeing it.
-
- Note: the address must be specified in hexadecimal.
-
- memget (address_hex len_int)
-
- Memget returns len_int bytes of data read directly from the
- memory address specified by address_hex.
-
- Note: the address must be specified in hexadecimal.
-
- memput (address_hex value_exp len_int)
-
- Memput stores len_int bytes of value_exp directly into the
- memory addressed by address_hex.
-
- Note: the address must be specified in hexadecimal.
-
- mkdir (path_str)
-
- Mkdir creates a new directory specified by path_str. Each
- component of the pathname (if any) must exist except the last one.
-
- mod (dividend_exp divisor_exp)
- %
-
- Mod returns the remainder of dividend_exp divided by divisor_exp.
-
- mul (value_exp value_exp...)
- *
-
- Mul returns the product of its arguments.
-
- ne (value_num value_num...)
- <
-
- Ne returns TRUE if none of its arguments are equal to the
- leftmost argument. Otherwise it returns FALSE.
-
- not (value_int)
- !
-
- Not returns the logical negation of its arguments. A zero is
- returned for any non zero argument and a one is returned for a
- an argument that evaluates to zero.
-
- open (path_str mode_str)
-
- Open opens the file specified by path_str with a mode specified
- by mode_str. Possible values of mode_str are:
-
- a - append to end of file
- b - binary, do not map crlf to lf
- c - create file if it does not exist
- r - open file for reading
- t - truncate file
- u - update, open for reading and writing
- w - open file for writing
-
- Modes can be combined by specifying both letters. To open
- an existing file for writing and truncate it at the beginning
- you would specify "tw".
-
- Note: the "\" character is the Max escape character. If you wish
- to use it in a literal pathname be sure to specify it as "\\".
-
- Open returns a file descriptor that is used in subsequent calls
- to read and write. Operating system specific devices can be opened
- with the open function. The standard input, standard output and
- standard error devices are available as file descriptors 0, 1
- and 2 and do not need to be opened.
-
- The return code is negative if an error occurred:
-
- -2 Cannot access file
- -3 Too many open files
- -4 File not found (specify "c" to create)
-
- See also: close, write, seek, tell
-
- or (value_exp value_exp)
- |
-
- Or performs a logical OR of its arguments. It returns TRUE if
- any of its arguments are non-zero and it returns FALSE if all of
- its arguments are zero.
-
- out (port_int value_int)
-
- Out sends value_int to the hardware port specified by port_int.
-
- patalt (pat_bif pat_bif...)
-
- Patalt specifies a list of possible primitives to match the
- input text. Each primitive is invoked from left to right until a
- match occurs. If no primitive matches the input text then patalt
- fails.
-
- Example: To match either either "abc" or "xyz" use:
-
- ... patalt ("abc" "xyz") ...
-
- patarb ([min_int [max_int]])
-
- Patarb matches an arbitrary number of characters. To be useful it
- should be followed by something specific to search for, such as a
- literal, group or range. Used in this matter it will match everything
- up to the specified pattern (provided the specified pattern can be
- found).
-
- patcre (pat_bif...)
-
- Patcre creates a pattern and returns a pattern descriptor. The
- pattern descriptor may be used in subsequent calls to patmatch to
- match text. When the pattern is no longer needed it should be
- freed with patfre.
-
- A pattern is composed of a series of pattern primitives specified
- by the argument list to patcre. Each primitive supports a particular
- type of pattern matching. There are primitives to match an arbitrary
- number of characters (patarb) up to some literal text (patlit),
- primitives to match any character from a set of characters (patgrp)
- or within a range of characters (patrng). There are also primitives
- that allow a choice of possible matches (patalt) or use a previously
- defined pattern (patuse).
-
- The patcre, patmatch and patfre builtin functions are standalone
- functions that may be used like any other builtin function. They
- reference the pattern via a pattern descriptor. All the other
- pattern functions are primitives and may only be used to define
- a pattern, i.e. inside the argument list of patcre.
-
- For primitives that accept a minimum and maximum number of times
- to apply the match the default is once. If minimum is specified
- as -1 the current length of the input text is used.
-
- Example: A simple pattern to isolate the text that precedes a comma
- could be specified as follows:
-
- set (pd patcre (patset (text_var patarb ()) ","))
-
- The call to patcre would return a pattern descriptor, pd, that would
- then be used in a call to patmatch:
-
- patmatch ("abcdef,ghijkl" pd)
-
- The call to patmatch would return TRUE to indicate that match
- succeeded and text_var would be set to the string "abcdef". The
- patmatch could be done any number of times on different input
- strings. When the pattern is no longer needed it is freed:
-
- patfre (pd)
-
- See also: patmatch, patfre
-
- pateol ()
-
- Pateol matches the end of line (ascii linefeed).
-
- patfre (pd_int)
-
- Patfre frees a pattern. Once a pattern is freed its storage
- is reused and the pattern is no longer accessable.
-
- patgrp (group_str [min_int [max_int]])
-
- Patgrp matches any character that appears in group_str.
-
- patlit (literal_str [min_int [max_int]])
- ""
-
- Patlit matches the sequence of (one or more) characters specified
- by literal_str, optionally a minimum or minimum and maximum number
- of times as specified by min_int and max_int. Because this function
- is used so frequently a shorthand form of it may be specified just
- by specifying the literal string in quotes.
-
- patmatch (input_str pd_int)
-
- Patmatch attempts to match the input text specified by input_str
- using the pattern specified by pd_int. Each primitive in the pattern
- is applied to the input text until one fails to match or until all
- the primitives in the pattern have been matched. If each of the
- primitives matches then patmatch returns TRUE, otherwise it returns
- FALSE.
-
- patneg (pat_bif...)
-
- Patneg negates the status of the pattern specified by its
- arguments. If the arguments matched the input text then patneg
- fails, otherwise it succeeds.
-
- patpat (pat_buf...)
-
- Patpat groups a block of pattern primitives together, possibly
- for use in a patalt call.
-
- patrem ()
-
- Patrem matches the remainder of the input string.
-
- patrng (range_str [minimum_int [maximum_int]])
-
- Patrng matches characters in the range specified by range_str
- using the ascii collating sequence. The range_str is a two
- character string. The first character specifies the low end of
- the range and the second character specifies the high end of the
- range. A string of "gm" would match any character between "g"
- and "m" inclusive.
-
- patset (match_var pat_bif...)
-
- Patset sets the variable specified by match_var to the text
- matched by the list of builtin functions, pat_bif... The assignment
- is performed during a successful match by patmatch.
-
- patuse (pd_int)
-
- Patuse attempts to match the pattern specified by pd_int against
- the remainder of the input string. It is similar to invoking
- patmatch within a pattern.
-
- pow (x_num y_num)
-
- Pow returns x_num raised to the power y_num.
-
- put ([value_exp...])
- print
-
- Put displays the values specified by value_exp... Each value
- is output without additional spaces and the list is terminated
- with a carriage return and linefeed.
-
- See also: format, get (input)
-
- putx ([value_exp...])
- printx
-
- Putx displays the values specified by value_exp... Each value
- is output without additional spaces and the cursor is left one
- space to the right of the last character displayed.
-
- Note: when prompting for information in the integrated
- environment a prompt character must be used to distinguish
- the prompt from the response. See the Prompt form of the
- window function.
-
- quit (exitcode_int)
-
- Quit terminates the Max interpreter and returns exitcode_int
- to the operating system.
-
- See also: do, exit, for, goto, if, label, leave, loop,
- return, select, quit, until, while
-
- rand (seed_int)
-
- Rand returns a pseudo-random number. Seed_int may be used to seed
- the pseudo-random number generator.
-
- read (fd_int buf_var [len_int])
-
- Read reads the file specified by fd_int into the buffer specifed
- by buf_var. An optional length parameter, len_int, may be used to
- specify the number of bytes (characters) to read. If the length
- parameter is not specified then one line is read from the file.
- This function return the number of bytes read, which may be less
- than that requested at the end of the file.
-
- See also: open, close, write, seek, tell
-
- rename (oldpath_str newpath_str)
-
- Rename renames the file specified by oldpath_str to the new name
- specified by newpath_str.
-
- return ([retval_exp])
-
- Return is a flow of control construct. It returns from the
- currently executing builtin function. A value may be returned
- to the caller using retval_exp.
-
- Example: if a user defined function called greet is defined:
-
- define (
- greet (
- return ("hello")
- )
- )
-
- Then executing "print (greet ())" causes greet to be invoked,
- it returns "hello" and so hello is printed.
-
- See also: case, do, exit, for, goto, if, label, leave, loop,
- select, quit, until, while
-
- rmdir (dirpath_str)
-
- Rmdir removes the directory specified by dirpath_str. The
- directory must be empty.
-
- seconds ()
-
- Seconds returns the number of seconds since some fixed time in
- the past, such as January 1, 1980. This can be used for timing
- events by subtracting the difference between two times in seconds.
- It can also be formatted using day.
-
- See also: day, date, time
-
- seek (fd_int offset_int origin_str)
-
- Seek positions to a specific byte (character) in a file. The next
- read or write occurs from that location. The location is specified
- by the combination of offset_int and origin_str. Offset_int is the
- location relative to the specified origin_str. Possible values for
- origin_str are:
-
- b - beginning of file
- c - current position
- e - end of file
-
- select (
- when (test_exp
- block_fn
- ...
- )
- ...
- default (
- block_fn
- ...
- )
- )
-
- Select is a flow of control construct. It is similar to the
- case and if ... then ... else builtin functions. There is no
- global condition as there is in case. Instead the first argument
- of each "when" block is evaluated. If it returns TRUE the remainder
- of the functions in the block are executed and control is transferred
- to the function that follows the argument list terminator of the
- select function. If none of the when blocks are executed the default
- block is executed.
-
- See also: do, exit, for, goto, if, label, leave, loop,
- return, quit, until, while
-
- set (target_var... source_exp)
-
- Set assigns source_exp to each variable in the list of target
- variables. It returns source_exp as well so that set can be used
- as an assignment within another reference in the style of C.
-
- Variables are usually defined the first time a value is stored
- in them. A good way to define a variable and initialize it is to
- use set it at the beginning of the user defined function that
- references it.
-
- sin (value_num)
-
- Sin returns the sine of its argument, value_num. The argument
- should be expressed in radians. The result is in the range -1
- to 1.
-
- sqrt (value_num)
-
- Sqrt returns the square root of its argument.
-
- static (new_var [size_int])
-
- Static allocates static storage for new_var. An optional size_int
- argument may be used to specify the number of bytes (characters) to
- allocate. If it is not specified then the current default data
- storage unit (ds_unit) is allocated. Static storage can be used
- for variables that must retain their values between calls to a
- function. When the storage is no longer needed it should be freed
- using the free builtin function so that it may be reused.
-
- See also: free, sys
-
- strasc (value_str)
-
- Strasc returns the ascii code of the first character of its
- argument, value_str.
-
- See also: strchr
-
- strcat (arg_str arg_str...)
-
- Strcat returns the concatenation of its arguments. In other words,
- a string is returned that is composed of each argument joined from
- left to right without spaces.
-
- strchr (ascii_int)
-
- Strchr returns a one character string which is the ascii
- representation of its argument.
-
- strcpy (copy_str count_int)
-
- Strcpy returns a string composed of count_int instances of
- copy_str, i.e. copy_str is copied count_int times.
-
- strfnd (source_str search_str)
-
- Strfnd returns the character position in source_str of the first
- character in source_str that matches any of the characters in
- search_str. This is the reverse of strver.
-
- Example:
-
- strfnd ("abc+def*ghi" "*+")
-
- Returns 4 because the first character in the first string that
- matches any of the characters in the second string was 4, which
- matched the "+" from the second string.
-
- strind (source_str search_str)
-
- Strind returns the character position of the first occurence of
- search_str in source_str.
-
- Example:
-
- strind ("a,an,the" "an")
-
- Returns 3 because the first occurence of the second argument in
- the first is immediately following the first comma, at position 3.
-
- strlc (arg_str)
-
- Strlc converts any uppercase (A-Z) characters in arg_str to
- lowercase (a-z). Other characters are not changed.
-
- strlen (arg_str)
-
- Strlen returns the number of characters in arg_str.
-
- strsub (arg_str start_int [length_int])
-
- Strsub returns a substring of arg_str starting at the character
- position specified by start_int for a length of length_int. If
- length_int is not specified the remainder of the string is returned.
-
- strtrn (source_str inputmap_str outputmap_str)
-
- Strtrn returns a string in which every occurence of a character
- from inputmap_str in source_str has been translated to the
- corresponding character from outputmap_str. It returns null if
- inputmap_str and outputmap_str are not the same length.
-
- Example:
-
- strtrn ("cat" "abc" "xyz")
-
- Returns "zxt" because all a's (character position 1 in inputmap)
- are translated to x's (character position 1 in outputmap), all
- b's (character position 2 in inputmap) are translated to y's
- (character position 2 in outputmap), all c's are translated to
- z's etc.
-
- struc (arg_str)
-
- Struc converts any lowercase (a-z) characters in arg_str to
- uppercase (A-Z). Other characters are not changed.
-
- strver (source_str valid_str)
-
- Strver returns the position of the first character in source_str
- that is not contained in valid_str or zero if all the characters
- from source_str are contained in valid_str.
-
- sub (arg_num...)
-
- Sub returns the difference of its arguments. Each argument is
- subtracted from the one to its left. If only one argument is
- specifed then sub returns the argument minus one.
-
- sys (sysvar_str [newval_int])
-
- Sys returns the value of the specified Max internal variable. If
- newval_int is specified then the system variable is set to the
- new value. Possible values for sysvar_str are:
-
- sysalloc action when a variable requires more storage
- 0 - truncate
- 1 - print message and allocate
- 2 - allocate (default)
- 3 - error, no assignment
-
- sysbrkchk extended control c handling under dos
- 0 - disable (for non pc-compatibles)
- 1 - enable (default)
-
- syshide builtin function name hiding by udf's
- 0 - do not allow udf's with same name
- 1 - allow udf's to hide bif's (default)
-
- sysinit uninitialized variable handling
- 0 - vars return name if not init (default)
- 1 - vars raise error if not initialized
-
- sysprep input preprocessing
- 0 - no input preprocessing performed
- 1 - input preprocessing performed (default)
-
- system (command_str...)
-
- System passes each command in command_str to the shell for
- execution. To invoke a DOS command shell use "COMMAND.COM" as
- the command_str.
-
- tan (arg_num)
-
- Tan returns the tangent of its argument. The argument
- should be expressed in radians.
-
- tclear ()
-
- Tclear clears the current transient level. Any builtin functions
- defined since the last tset are cleared.
-
- See also: tset, tpush, tpop, tlevel
-
- tell (fd_int)
-
- Tell returns the position in bytes (characters) of the current
- read/write position from the beginning of the file specified by
- the file descriptor fd_int.
-
- time ()
-
- Time returns the current time in HH:MM:SS format.
-
- Where: HH Hours (0-23).
- MM Minutes (0-59).
- SS Seconds (0-59).
-
- See also: day, date, seconds
-
- tlevel ()
-
- Tlevel returns the current transient level. It may be saved and
- used later (perhaps after calling functions from a user defined
- function library) in a call to tpop to return to the same level.
-
- See also: tset, tclear, tpush, tpop
-
- tpop ([newlevel_int])
-
- Tpop returns to a previous transient level. If no argument is
- specified then one level is popped, otherwise the specified level
- is selected. No user defined functions are cleared from storage
- until a tclear is executed at the new level.
-
- See also: tset, tlcear, tpush, tlevel
-
- tpush ()
-
- Tpush allocates a new transient level. Tset's and Tclear's can
- be executed at the new level without affecting user defined
- function definitions at previous levels. A user defined function
- intended as a general purpose library routine can execute a tpush
- and tset just after entry and execute a tpop and tclear just before
- returning. This would clear any functions defined by the routine.
-
- See also: tset, tclear, tpop, tlevel
-
- tset ()
-
- Tset saves the current user defined function state. New functions
- may then be defined and a subsequent tclear will clear all of the
- new functions from memory, back to the state that was present at
- the time of the tset.
-
- See also: tclear, tpush, tpop, tlevel
-
- udfbind (arg_udf)
-
- Udfbind binds the user defined function specified by arg_udf to
- its internal address. It returns the internal address if the
- function is defined, otherwise -1. It may be used to check on
- the existence of a user defined function. Functions are normally
- bound to their internal address the first time they are referenced.
-
- See also: bind, bifbind
-
- udfdir (arg_udf...)
-
- Udfdir displays information about the user defined functions
- specified in arg_udf... or all user defined functions if no
- arguments are specified. The information includes the internal
- address, the first step number in the function, the last step
- number in the function and the maximum amount of storage
- required for function return values and variables.
-
- udfid (stepnum_int)
-
- Udfid identifies the user defined function associated with
- the step number specified by the argument. It is useful in finding
- the function associated with a step number displayed in a debug or
- error message.
-
- udflist (arg_udf [begstep_int [endstep_int]])
-
- Udflist lists the user defined function specified by arg_udf. If
- only begstep_int is specified then only that step from the function
- is listed. If begstep_int and endstep_int are specified then all
- steps between them (inclusive) are listed. If no step number
- arguments are specified then the entire function is listed.
-
- The user defined function is listed directly from its internal
- representation, without comments, and in it a format that can
- be derived from its structure.
-
- unbind (arg_fn...)
-
- Unbind unbinds a previously bound function reference. The function
- can be either a builtin function or a user defined function. Once
- unbound, a function will be bound the next time it is invoked or
- by the bind, bifbind or udfbind functions. The unbind function can
- be used to switch the binding of a function name between builtin and
- user defined functions or to bind to a new function that has just
- been defined using eval or feval.
-
- See also: bind, bifbind, udfbind
-
- until (bool_exp
- [block_fn
- ...]
- )
-
- Until is a flow of control construct. Each function in the list
- of block_fn... is executed successively. After the last function is
- executed the first argument is evaluated. If it returns FALSE the
- list is re-executed. Iteration continues until it returns TRUE.
- An until block is always executed at least once.
-
- The difference between until and while is that in until the test
- for exiting the loop is at the bottom and based on TRUE whereas in
- the while the test is at the top and the loop is not exited if
- the value is FALSE.
-
- See also: do, exit, for, goto, if, label, leave, loop,
- return, select, quit, while
-
- while (bool_exp
- [block_fn
- ...]
- )
-
- While is a flow of control construct. The first argument is
- evaluated. If it returns TRUE then each function in the list
- of block_fn... is executed. After the last function is executed
- the first argument is evaluated again. Iteration continues until
- it returns FALSE. A while block is not executed if the first
- argument evaluates to FALSE on the first iteration.
-
- See also: do, exit, for, goto, if, label, leave, loop,
- return, select, quit, until
-
- window (cmd_int [args...])
-
- Window provides an interface to the MaxEdit integrated
- environment. The first argument is a command. A preprocessor
- definition file called windef.max has been created to define
- a textual name for each of the commands. Windef.max should be
- included (using the preprocessor $include(file) facility) in
- any file that performs window operations. The following list
- summarizes the window operations that are available and the
- arguments that are required for each one.
-
- Command Arguments Description
-
- These commands establish defaults for a subsequent open:
-
- (WLocation top left bot right) ; Specify position for next open
- (WBorder style) ; border style (1 through 7)
- (WText attributes) ; set text attributes (see below)
- (WBuffer buffersize linelength) ; specify max buffer and line length
- (WTitle description) ; title window
- (WStyle attributes) ; status line/popup window attributes
-
- The following commands access and modify windows:
-
- (WOpen ) ; returns window descriptor
- (WClose wd) ; close window
- (WLink wd wd) ; links two window descriptors
- (WFile fd wd) ; associates file w/window
- (WCopy wd var) ; copies contents of wd to var
- (WGet wd var) ; gets updateable copy
- (WPut wd var) ; restores updateable copy
- (WInterpret wd) ; passes window to Max
- (WSend wd buf) ; writes buf to wd
- (WReceive wd buf) ; reads buf from wd
- (WPrompt promptchar) ; sets prompt character
- (WPosition wd row col) ; positions to row & col
- (WRefresh wd) ; refresh window
- (WErase wd) ; erase window
- (WClear) ; clear entire screen
- (WSetdp page) ; set active display page (0-3)
-
- The remaining operations enable/disable/toggle the specified mode:
-
- (WInsert 1/0/-1) ; insert mode
- (WEdit 1/0/-1) ; edit/input mode '
- (WOverflow 1/0/-1) ; save/overflow mode
- (WVerify 1/0/-1) ; verify mode
- (WStatus 1/0/-1) ; status mode
-
- Keep in mind that the names WLocation, etc, are preprocessor
- replacements defined in windef.max. If you do not use the names
- you may use the numeric codes they represent (in the range 0 to
- 26) but your functions may need to be changed with the next
- release of Max.
-
- Attributes may be specified for WText and WStyle. These attributes
- select the foreground and background style for text. The high order
- four bits of the attribute specify the background color and the low
- order four bits specify the foreground color, as follows:
-
- binary description
-
- 0001 blue
- 0010 green
- 0100 red
- 1000 blinking (foreground)/intensity (background)
-
- So to get blue characters on a red background specify four high
- order bits of 0100 (0x40) and four low order bits of 0001 (0x01)
- for an attribute byte of 0x41. Remember to use the fmhex builtin
- function to convert to decimal in the call:
-
- window (WText fmhex (0x41))
-
- Attributes can be combined additively. For example, to get blinking
- green characters use green (0010) and blink (1000) for 1010 which
- is 0x0a in hex.
-
- Many monochrome monitors only support white on black (0x07) and
- black on white (0x70).
-
- There are eight border styles available for the WBorder command:
-
- 1: single width
- 2: double width
- 3: single left/right, double top/bottom
- 4: double left/right, single top/bottom
- 5: single/double shadow
- 6: bottom half of double sides and single top
- 7: clear border
- 8: top half of double sides and single bottom
-
- To select a double wide border for the window, for example,
- use "window (WBorder 2)." All subsequent opens will use the new
- border style, until it is changed again.
-
- write (fd_int buf_str [len])
-
- Write writes the file specified by fd_int from the buffer specifed
- by buf_var. An optional length parameter, len_int, may be used to
- specify the number of bytes (characters) to write. If the length
- parameter is not specified then one line is written to the file.
- This function return the number of bytes written, which may be less
- than that requested if the storage media is full.
-
- See also: open, close, read, seek, tell
-