Intel AEDIT-86 Life Jacket User Manual


 
Adya.cM AEDIT -86 Usage
AEDIT-86 User's Guide
8-4
8.2.2 Simulate
"IF
cond
THEN
RETURN" (to the caller)
This construct
is
done
by
using the "fail" characteristic of the
FIND
command. Recall
that
searching an empty string always fails (assuming
that
SET
Go No
is
in
effect),
but searching zero times always succeeds, regardless of the operand. The following
method may thus be used:
C(ALC)
N9
= cond \ • cond
is
any logical expression * \
<
FETN)
9
F(lND)
- <
RUBOUT)
<
ESC)
\ • Find argument
is
an empty string \
or in macro form:
...
CN9
= cond \
NL
\
XN9F-
\ RB \ BR ...
Note
that
cond must
be
a logical expression,
so
that
it
will
have the value of 0 (false)
or
-I
(OFFFFFFFFH, true). When it
is
used as a count. the absolute value, 0 (false)
or 1
(true)
is
used.
8.2.3 Simulate
"IF
cond
THEN
statemenf'
In this case, statement
is
implemented as a separate macro (named statement). This
macro
will be executed 0 or 1 times depending
on
the value of cond:
C(ALC)
N9=
cond
<
FETN)
9
E(XECUTE)
statement
or
in
macro form:
...
CN9=
cond \
NL
\
XN9E
statement \ NL.
..
Note again that cond must
be
a logical value to ensure that N9, when used
as
a
count,
is
either 0 or I.
8.2.4
Simulate
"IF
cond
THEN
statement1
ELSE
statement
2"
This
is
based
on
the example given above:
C(ALC)
N8=!(N9=cond)
\ *
"!"
is
the
NEG
operator * \
<
FETN>
9
E(XECUTE)
statementl
<
FETN)
8
E(XECUTE)
statement2
or
in
macro form:
...
CN8=!(N9=cond)
\
NL
\
XN9E
statementl \
XN8E
statement 2 \ NL.
..
Note
that
statement 1 may not change N8; if it does, statement 2 may be executed
uninten tion all
y.
8.2.5
Simulate " Advance_While cond"
This construct
is
usually needed for macros like skip to next blank, skip to next word,
etc. This
is
done using the
"IF
cond
THEN
RETURN"
method described above.
cond
in
this case must be a logical expression that involves the current cursor location