Sharp mz-3500 Manual For Use page 86

Business computer eos 3.0
Hide thumbs Also See for mz-3500:
Table of Contents

Advertisement

Section C:
Utility Programs
****************
$DO
****************
$DO now inserts these words at certain places in the file.
The underly-
ing
mechanism is quite simple:
All words passed with the command
line
after
the command designation are numbered from
0
upward.
The filename
thus becomes word
0,
the word "word!" word No.1,
and so forth.
At the
places
of the text where one of the parameters is to be
inserted,
you
would
specify
a dollar sign"$",
followed by the number of
the
word
which
you
want
to
be placed there.
An
example:
You
have
a
file
"TEST.SUB" of following contents:
This is the lst word: $1
This is the 2nd word: $2, and the 3rd one: $3
We now assume that you invoke $DO by the command:
$DO TEST WORD! WORD2 'THIS IS WORD 3
1
Then, $DO would create a temporary file which looks like:
This is the 1st word: WORD!
This is the 2nd word: WORD2, and the 3rd one: THIS IS WORD 3
Up to 9 words can be passed from the command line to the text by
speci-
fying
the parameters "$1" to "$9".
Additionally,
the name of the file
just processed can also be inserted by means of specifying "$0'
11
If
y_ou
need the dollar sign by itself within the text,
there
are
no
obstacles.
You should specify it twice if a number follows immediately.
Besides,
it is good practice to duplicate dollar signs within the text,
so that they can easily be discerned from parameters.
Let's have a look at some examples:
; this works well:
$$SET FILE +SYS
; this works as well:
$SET FILE +SYS
; but here you must specify two dollar signs:
$$12345678
; in the subseqeuent line, "$1" will be subsituted by a parameter:
$12345678
EOS User's manual
Daeumling & Zimmermann
Page 73

Advertisement

Chapters

Table of Contents
loading

Table of Contents