ARRANGING THE OUTPUT FROM A
USER-DEFINED FUNCTION
The output from user-defined functions can be arranged by using the format func-
tion (see the v function in Chapter 4) or bare output. Bare output is discussed
next.
Bare Output
After normal output, the cursor is moved to the next line so that the next entry
(either input or output) will begin at a standard position. However, bare output,
denoted by the form m+X (X can be
any expression), does not move the cursor
to the next line. Therefore, more than one variable or expression can be displayed
on the same line. For example:
Since the cursor does not return to the next line after bare output, when quad
quote (1) input is entered following the bare output, the input starts after the
last character of the bare output. Then when the input is processed, it is pre-
fixed by any bare output on the input line. For example:
146
Therefore, if quad quote input follows bare output (but only the input is to be
processed), the bare output must be removed from the input line. Following is
an example of a function that will remove the bare output:
This is how the function works:
v (:I 1.1 '1 n :I: N <-The Bare Output
I_ :I. :I B R 19 if:: A
(:I 1.) T I) 1.1 'r 'I' 1-1 :I: !: :I: !; A Ii E:: is I T' I) 1.1 'I' ! ! !
-This function will remove the bare output.
1.. '. L. .") .. "I v
'rtwti :[% RARlii: CJIJ'Tl:)IJ'I' ! ! !-The cursor appears here. Now
'I' i-l :I: S :I: !is B A
li I: (1) 1.1 'I' I) !,J 'T' ! ! ! 'I' 1.1 I: !3 :I: 8 111 I: N I) 1.1 I'
'I' li 1: !ij :I: s El :c M F' 1.1 'I'
LThis is the final result.
c3 !.I 'I' d :I: N
enter THIS IS (I] INPUT.
LOCKED FUNCTIONS
A locked function can only be
executed, copied or erased; it cannot be revised or
displayed in any way, nor can trace control and stop control (see Trace Control
and Stop Control later in this chapter) be
changed. A functionzan be
locked, or
protected, by opening or closing the function definition with a V (Voverstruck
with -), instead of a V.
When an error is encountered in a locked function, execution of that function is
abandoned (not suspended). If this function was invoked by another locked
function, execution of the second function is abandoned also, and so on, until
either (1) a statement in an unlocked function or (2) an input statement is
reached. Then DOMAIN ERROR is displayed. In the first case, the execution of
the unlocked function is suspended at the statement; in the second case, the 5100
waits for input.
Note: A locked function cannot be unlocked; therefore, if the function contains
an error, the function cannot be edited and the error corrected.
i'
147
Previous Page Next Page