Details of Icon Functions K through O
Succeeds if a character is available for getch() or getche() but fails
otherwise.
See also: getch() and getche()
Generates the keys in table T.
Produces a string of size i in which s1 is positioned at the left, with
s2 used for padding on the right as necessary.
Defaults:
i 1
s2 " " (blank)
See also: center() and right()
Produces a list of size i in which each value is x.
Defaults:
i 0
x &null
Loads the function named s2 from the library file s1. s2 must be a C or
compatible function that provides a particular interface expected by
loadfunc().
Produces the logarithm of r1 to the base r2.
Default:
r2 e
See also: exp()
Succeeds and produces the position in s after the longest initial sequence
of characters in c in s[i1:i2]. It fails if s[i1] is not in c.
Defaults:
s &subject
i1 &pos if s defaulted, otherwise 1
i2 0
See also: any() and match()
Produces a string of size *s1 obtained by mapping characters of s1 that
occur in s2 into corresponding characters in s3.
Defaults:
s2 string(&ucase)
s3 string(&lcase)
Produces i1 + *s1 if s1 == s2[i1+:*s1], but fails otherwise.
Defaults:
s2 &subject
i1 &pos if s2 defaulted, otherwise 1
i2 0
See also: =s, any(), and many()
If X is a set, succeeds if x is a member of X, but fails otherwise. If
X is a table, succeeds if x is a key of an element in X, but fails
otherwise. Produces x if it succeeds.
See also: delete() and insert()
Produces &subject[&pos:&pos + i] and assigns i + &pos to &pos, but
fails if i is out of range; reverses assignment to &pos if resumed.
See also: tab()
Produces the name of the variable x. If x is an identifier or a
keyword that is a variable, the name of the identifier or keyword is
produced. If x is a record field reference, the record name and field
name are produced with a separating period. If x is a string, the name
of the string and the subscript range are shown. If x is a subscripted
list or table, the type name followed by the subscripting expression is
produced.
See also: variable()
Produces an integer or real number resulting from converting x, but
fails if the conversion is not possible.
See also: integer() and real()
Produces a file resulting from opening s1 according to options in s2,
but fails if the file cannot be opened. The options are:
"r" open for reading
"w" open for writing
"a" open for writing in append mode
"b" open for reading and writing
"c" create
"t" translate line termination sequences to linefeeds
"u" do not translate line termination sequences to linefeeds
"p" pipe to/from a command -- UNIX
The default mode is to translate line termination sequences to
linefeeds on input and conversely on output. The untranslated mode
should be used when reading and writing binary files.
Default:
s2 "rt"
See also: close()
Produces an integer (ordinal) between 0 and 255 that is the internal
representation of the single character in s.
See also: char()