User guide

60 CHAPTER 3. THE LIBRARY
res := release(taskid) CIN:n, POS:y, NAT:n
This Cintpos function wi l l clear the HOLD bit in the spe ci fi ed task thus making it
potential l y runnable. It returns a non zero value if successful. If the specified task does
not exist it returns zero with 101 in result2. If the released task has highe r priority
and is runnable it gaids control leaving the current task suspended in RUN state.
flag := renamefile(oldname, newname) CIN:y, POS:y, NAT:y
The call renames the file oldname as file newname, deleting newname if necessary,
returning TRUE if the renaming was successful, and FALSE otherwise. Both oldname
and newname are strings.
res := resumeco(cptr, arg) CIN:y, POS:y, NAT:y
The effec t of resumeco is almost identical t o that of callco, diffe r i ng only in the
treatment of the parent. With resumeco the parent of the calling coroutine becomes
the parent of the called coroutine, leaving the calling coroutine suspended and without
a parent. Systematic use of resumeco reduces the number of coroutines having parents
and henc e allows greater freedom in organising the flow of control betwe en coroutines.
The definition of resumeco is in blib.b and is as follows.
LET resumeco(cptr, a) = VALOF
{ LET parent = currco!co_parent
currco!co_parent := 0
IF cptr!co_parent DO abort(111)
cptr!co_parent := parent
RESULTIS changeco(a, cptr)
}
res := rewindstream(scb) CIN:y, POS:y, NAT:y
This function set the position of stream scb to its start, returning TRUE i f successful,
and FALSE oth er wi se .
ch := sardch() CIN:y, POS:y, NAT:y
This function calls sys(Sys
sardch) to read the next character from the keyboard
as soon as it is available, echoing the character to the screen.
sawrch(ch) CIN:y, POS:y, NAT:y
This function calls sys(Sys
sawrch(ch) to write the specified character to the
screen.
sawritef(format,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z)
CIN:y, POS:y, NAT:y
This function is similar to writef but performs its output using sawrch.
selectinput(scb) CIN:y, POS:y, NAT:y
This call executes cis := scb to select scb as the current input stream. It aborts
(with code 186) if scb is not an input stream.