Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap5_198111 - decus/20-0151/setup.rnd-update-1
There is 1 other file named setup.rnd-update-1 in the archive. Click here to see a list.
.ebb
.Title SETUP %5(57) 13-Oct-80
.Tab stops 9,17,25,33,41,49,57,,65
.Spacing 1
.Justify
.Right margin 73
.Figure 20
.Center
SETUP Documentation
.Skip 1
.Center
Alan Guenther
.Center
(revised by Joe Payne  4-Jul-75)
.Center
(revised by Ralph Swick 18-Oct-78 through 12-Oct-79)
.Skip 4
.Nt Third Revision
This manual describes version 5(56) of the SETUP program released
in March, 1980.  This manual supersedes the previous manuals of
20-Jun-79 and 12-Oct-79.  All changes to this manual since the previous edition
are noted with a vertical bar in the margin.
.en
.Indent 10
Updated 13-Oct-80:#pages 18-21,70
.Blank 5
The SETUP program was originally developed at the University of Montana
and is distributed by Carnegie-Mellon University, Pittsburgh, Pennsylvania
under the agreement that any modifications be communicated back to C-MU
and that no such modified versions be distributed to other installations
except by C-MU.
.Subtitle ***** SETUP commands
.Number 18
.Page
.bb
.Center
;Define [/save] constant <constant-name> <text>
.eb
.Skip 1
.Center
- - - - - - - - - - -
.Paragraph
The ";Define constant" command
fulfills a function very similar to the 
;Define variable command.  In the ;Define constant
statement no prompt is typed to the user,
but the string "<constant-name>" is replaced by "<text>" wherever
it appears in the MCF.
.Paragraph
The ;Define constant command would
be useful in situations where the author of a MCF wanted to allow
a simple method for changing a common parameter, but not
require the SETUP user to type in a value every time the MCF is read.
For example, a directory-name might be a constant so that it could
be easily changed in the MCF at a later time.  (A unique "trick" of constants
follows from the fact that constant/variable names look like Tops-20
directory names: if the MCF contains the directory-name <Smith> in several
places, it can be changed by simply defining the constant <Smith> to be a
different directory!)
.Nofill
.Skip 1
For example:
.Skip 1
      MCF contents
	;Define constant <semester> FALL
	 .
	 .
	 .
	@Run Update
	*<semester>
	 .
	 .
	 .
	@Print <semester>.rpt
.Skip 1
      CTL contents
	;Define constant <semester> FALL
	 .
	 .
	 .
	@Run Update
	*FALL
	 .
	 .
	 .
	@Print FALL.rpt
.Fill
.Paragraph
This example assumes that the constant <semester> changes periodically but
remains fixed for long periods before being modified again.  Using the ;Define
constant command in this manner allows the periodic changes to be made quickly
and with less chance for error.
.Paragraph
.bb
The optional switch /SAVE causes the value of this constant to be "remembered"
permanently so that it can be retrieved with a ;GET command in a different
MCF.  This function is analogous to the /SAVE switch on the ;DEFINE VARIABLE
command except that a previously saved value is not shown to the user.  This
command is also equivalent to the SETUP/VARIABLE command described in section
IV except that the constant value is generated within the MCF and the constant
name itself is defined and will be substituted in the remainder of the MCF.
.eb
.Blank 2
.Center
**** Note ****
.Break
The special constants <current-day>, <current-month>, <current-year>,
<current-user-name>, <current-hour>,
<julian-date>, <job-id> and <job-name> should not be used
in a ;Define variable or
a ;Define constant command.  <job-id> is automatically defined by the
/JOB-ID: switch at exec command level.  See section III SETUP features
for a complete explanation of the /JOB-ID: switch and the <job-id> constant.
The constant <job-name> is pre-defined by SETUP to be the file-name of the MCF,
not including the file-type; thus, if the MCF is named REPORT-GENERATION.MCF
<job-name> will have the value REPORT-GENERATION.
.Break
.Skip 1
<Current-day>, <current-month>, <current-year> and <julian-date> are defined to have the corresponding
numeric values of day, month, year, and day-of-year respectively.
<Current-hour> contains the 2-digit hour of the day and <current-user-name>
contains the logged-in username of the current job.
See Section III for more details.
.Number 20
.Page
.bb
.Center
;Define [/save] Option <option-name> <text>
.eb
.Skip 1
.Center
- - - - - - - - - - -
.Paragraph
The ";Define Option" command is very similar in function to the ;Define
Constant command; that is, no prompt is issued, but the option given in
<option-name> will be given the value "Y" or "N" depending upon the first
character of the <text>.  For example,
.Skip 1
.Indent 8
;Define option <this-is-yes> yes
.Skip 1
would have the same end result as the command
.Skip 1
.Indent 8
;Select option <this-is-yes> Please type "YES" here
.Skip 1
except that the second command would request the user to type something,
and the first would not.  This command might be useful to "recode" the user's
previous responses rather than stringing out several ;Option and ;No-option
commands (see the ;Option and ;No-option commands below).
For example, if the sequence of tests
.Skip 1
.Indent 8
;Option opta/;Option optb/;Option optc/...
.Break
.Skip 1
were to be used several times, the MCF (and CTL file) could be made more
concise by doing the following:
.Nofill
.Skip 1
	;Option opta/;Option optb/;Option optc/;Define option optabc yes
	;Option optabc/...
.Fill
.Paragraph
In this example, if any of the options "opta", "optb" or "optc" had the
value "no", then option "optabc" would not be defined and therefore treated
as having the value "no".
.Paragraph
;Define option might also be used to reduce the number of prompts issued
to the user; for example,
.Nofill
.Skip 1
	;Select option All-reports Do you want all the reports?
	;Option all-reports/;Define option account-report yes
	;Option all-reports/;Define option dept-report yes
	;Option all-reports/;Define option ssn-report yes
	;No-option all-reports/;Sel opt Account-report Do you want the
account sequence report?
	;No-option all-reports/;Sel opt Dept-report Do you want the
department sequence report?
	;No-option all-reports/;Sel opt SSN-report Do you want the
social-security number sequence report?
.Fill
.Skip 1
.Paragraph
.bb
The optional switch /SAVE causes the value of this option to be "remembered"
permanently so that it can be retrieved with a ;GET command in a different
MCF.  This function is analogous to the /SAVE switch on the ;DEFINE OPTION
command except that a previously saved value is not shown to the user.  This
command is also equivalent to the SETUP/OPTION command described in section
IV except that the option value is generated within the MCF and the option
itself is defined and may be referenced in the remainder of the MCF.
.eb
.Note
The options Restart, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday
and Sunday should not be used in a ;Select option or ;Define option command.
SETUP provides values for these options as defined in Section III. SETUP
Features.
.En
.Paragraph
;Define option may also be used to set values for options that were not
requested from the user due to a restart (/TAG: switch).  See page 36,
restarting jobs, for more details.
.Subtitle ***** SETUP error messages
.Number 70
.Page
.Left margin 5
.Indent -5
% No option name found after ;Define option command
.Break
An option name must immediately follow the word "option" in a ;Define option
command and must be entered on the same line.
.Skip 1
.Indent -5
% No option value found in ;Define option command
.Break
The option name must be followed by text beginning with either a "y" or "n"
in a ;Define option command and must be entered on the same line.
.Skip 1
.Indent -5
% Option value is not "y" or "n"
.Break
The text following the option-name in a ;Define option command must begin with
either the letter "y" or the letter "n".
.Skip 1
.Indent -5
% Switch in ;Define command is only valid for ;Define Variable
.Break
The programmer has entered a switch in a ;Define constant... or ;Define
.bb
option..., command that is not supported.  Currently only the /SAVE switch
may be used on these two commands.
.eb
.Skip 1
.Indent -5
% Invalid switch modifying SETUP command
.Break
The only supported switches after a ;Define variable command are the /allow, /save and
/verify switches.
.Skip 1
.Indent -5
?#Default value file has grown too large
.Break
The new value of the option or variable cannot be /SAVEd because the default
file has reached its maximum size.  If the number of empty words (indicated
by SETUP/LIST EMPTY) is very large, then the file should be rebuilt by
listing the contents (SETUP/LIST), deleting SETUP.BIN and redefining
all the values with SETUP/OPTION and SETUP/VARIABLE.
.Skip 1
.Indent -5
% Switch missing after SETUP command
.Break
SETUP has found a slash after a command indicating a switch, but no switch
name.  No spaces or tabs may be typed between the slash and the switch name.
.Skip 1
.Indent -5
% /DEFAULT:#switch not allowed in combination with /ALLOW and /SAVE
.Break
Neither the /ALLOW nor the /SAVE switches may be used if the /DEFAULT:
switch is specified.
.Skip 1
.Indent -5
% Value is required after this switch
.Break
A quoted string must be specified after the colon on the /DEFAULT: switch.
.Skip 1
.Indent -5
% Missing quote to delimit switch value
.Break
The string following the colon on the /DEFAULT: switch must be enclosed in
quotation marks.