
 The Indirect Command Processor allows CLI command lines to be 
 placed in a file.  The file is then executed as though the command lines 
 were entered from a terminal.  Indirect also supports other 
 numeric and string manipulation commands. 

 A summary of commands and special symbols can be obtained by typing 
 
	HELP INDIRECT SUMMARY
 
 Individual command descriptions can be obtained by typing 
 
	HELP INDIRECT commandname
 
 For the commands with many forms and similar names, type 

	HELP INDIRECT SET, HELP INDIRECT IF, HELP INDIRECT OPEN

 Operators (relational and arithmetic) are described at
 
	HELP INDIRECT OPERATORS
 
 Special symbol descriptions can be obtained by typing
 
	HELP INDIRECT symbolname

 NOTE: symbolname does not include the <sym> angle brackets.
 
 A list of Indirect error messages, including their severity class numbers,
 can be obtained by typing
 
	HELP INDIRECT ERROR

2 OPERATORS
 
 A numeric symbol or constant can be combined with another numeric
 symbol or constant by a logical or arithmetic operator to form a numeric
 expression.  Arithmetic and logical operators are:
 
		+    Add
		-    Subtract 
		*    Multiply
		/    Divide
		!    Logical inclusive OR
		&    Logical AND
		#    Logical NOT
 
 No embedded blanks or tabs are permitted between operators.
 
 The string operator
 
		+    (Concatenation)
 
 can be used to form longer strings from a collection of shorter strings.
 
 The substring operator
 
		[start:end]
 
 describes a substring range of a given string, for example, STRING[x:y],
 where x is the first position of the substring and y is the last.  If the
 total length of the string is unknown, the syntax
 
		STRING[5:*]
 
 can be used to express "from position 5 to the end of the string."
 
 Relational operators are as follows:
 
	 	EQ or =		Equal to
		NE or <>	Not equal to
		GE or >=	Greater than or equal to
		LE or <=	Less than or equal to
		GT or >		Greater than
		LT or <		Less than
 
2 SUMMARY
 
 Information about the following Indirect commands is available:
 
 .ASK		.ASKN		.ASKS		.BEGIN		.CHAIN
 .CLOSE		.DATA		.DEC		.DELAY		.DISABLE
 .ENABLE 	.END		.ERASE		.EXIT		.FORM
 .GOSUB		.GOTO		.IF		.INC		.OPEN
 .OPENA		.OPENR		.ONERR		.PARSE		.PAUSE
 .READ		.RETURN		.IFDF		.IFNDF		.IFT
 .IFF		.IFACT		.IFNACT		.IFENABLED	.IFDISABLED
 .IFINS		.IFNINS		.IFNLOA 	.IFLOA		.SETD
 .SETF		.SETL		.SETN		.SETO		.SETS
 .SETT		.STOP		.TEST		.TESTDEVICE	.TESTFILE
 .TESTPARTITION	.WAIT		.XQT		.label		
 
 Information about the following special symbols is available:
 
 ACCOUN		ALPHAN		ALTMOD		BASLIN		CLI
 CONFIG		DATE		DEFAUL		EOF		ERRCTL
 ERRNUM		ERROR		ERRSEV		ERSEEN		ESCAPE
 EXSTAT		EXSTRI		FALSE		FILERR		FILER2
 FILATR		FILSPC		FORATT		FMASK		IAS
 LIBUIC		LOCAL		LOGDEV		LOGUIC		MAPPED
 MEMSIZ		NETUIC		NETNOD		NXTSYM		NOSTAT
 NUMBER		OCTAL		PRIVIL		RAD50		RSX11D
 SEVERE		SPACE		STRLEN		SUCCES		SYDISK
 SYMTYP		SYSDEV		SYSID		SYSTEM		SYSUIC
 SYUNIT		TICLPP		TICWID		TISPED		TIME
 TIMOUT		TITYPE		TRUE		UIC		WARNIN
 
 Reserved symbols created by Indirect are:
 
  P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, COMMAN
 
 Other Indirect operations for which help is available are:
 
 SWITCHES	SUBSTITUTION of symbols		PARAMETER passing
 LIBRARY procedures	FORMATTING for readability
 ADVANCED techniques	

2 .ASK
#ASK
2 ASK
 Defines or redefines a logical symbol and assigns it a true or false value.
 
 Format:
 
	.ASK [def:tmt] sym txt
 
 where:
 
	def - Optional default value to be assigned to the symbol if a line
	      terminator is typed in response to the question or if a
	      timeout occurs.  The default can be <TRUE> or <FALSE> or
	      another logical variable.
 
	tmt - Optional decimal timeout count describing the length of time
	      before the default value is used.  The format of the parameter
	      is the same as that used for the .DELAY directive.
 
	sym - Logical symbol name consisting of 1 through 6 alphanumeric
	      characters.
 
	txt - Text to be displayed on the output display line.
 
 Example:
 
	.ASK [<TRUE>:10S] L1 Logical value
 
	  produces
 
	>* Logical value [Y/N D:Y T:10S]:
 
 See also HELP INDIRECT ASKN and HELP INDIRECT ASKS.
2 .ASKN
#ASKN
2 ASKN
 Defines or redefines a numeric symbol and assigns it an octal or decimal value.
 
 Format:
 
	.ASKN [low:high:def:tmt] sym txt
 
 where:
 
	low:high  -  Numeric values that define the range for the response.
		     The input or default value must be within the range
		     to be valid.  
 
	def       -  Optional default value to be assigned to the symbol if a
		     line terminator is typed in response to the question or
		     if a timeout occurs.  The default can be a numeric
		     expression or another numeric symbol.
 
	tmt       -  Optional decimal timeout count describing the length
		     of time before the default value is used.  The format
		     of the parameter is the same as that used for the .DELAY
		     directive.
 
	sym       -  Logical symbol name consisting of 1 through 6 alphanumeric
  		     characters.
 
	txt       -  Text to be displayed on the output display line.
 
 Example:
 
	.ASKN [1:3:2:10S] N1 Numeric value
 
	  produces
 
	>* Numeric value [O R:1-3 D:2 T:10S]:

 See also HELP INDIRECT ASK and HELP INDIRECT ASKS.
 
2 .ASKS
#ASKS
2 ASKS
 Defines or redefines a string symbol and assigns it an ASCII text string.
 
 Format:
 
	.ASKS [low:high:def:tmt] sym txt
 
 where:
 
	low:high  -  Numeric values that define the range for the response.
		     The length of the input or default value must be within
		     the range to be valid.
		     
	def       -  Optional default value to be assigned to the symbol if
		     a line terminator is typed in response to the question
		     or if a timeout occurs.  The default can be a string
		     expression or another string symbol.
 
	tmt       -  Optional decimal timeout count describing the length of
		     time before the default value is used.  The format of
		     the parameter is the same as that used for the .DELAY
		     directive.
 
	sym       -  Logical symbol name consisting of 1 through 6 alphanumeric
		     characters.
 
	txt       -  Text to be displayed on the output display line.
 
 Example:
 
	.SETS DEF "abc"
	.ASKS [1:3:DEF:10S] S1 String value
 
	  produces
 
	>* String value [S R:1-3 D:"abc" T:10S]:

 See also HELP INDIRECT ASKN and HELP INDIRECT ASK.
2 .BEGIN
#BEGIN
2 BEGIN
 
 Delimits the start of a BEGIN-END block.
 
 Format:
 
	.BEGIN
 
 Note that the .BEGIN command must appear on a line by itself.  It cannot
 be part of an .IFx command line.  A BEGIN-END block defines a set of Indirect
 commands that must be entered and exited as a unit.  Local symbols defined
 outside of the block are accessible, but those created within the block are
 deleted when Indirect exits from the block (reaches .END).
 
2 .CHAIN
#CHAIN
2 CHAIN
 
 The .CHAIN command continues execution from a new command file. Unlike
 the "@filename" construction, the current file context is not preserved.
 All local symbols are erased (unless the /LO switch is specified) and 
 execution continues at the first line of the file specified with .CHAIN.
 
 Examples:
 
	.CHAIN SYSGEN2.CMD
	.CHAIN PROCLIB/LB:PART2
2 .CLOSE
#CLOSE
2 CLOSE
 
 Closes a secondary data file. No error is returned if the file is 
 already closed.
 
 Format:
 
	.CLOSE #n
 
 where n is the channel number of the file to be closed.
 
2 .DATA
#DATA
2 DATA
 
 Specifies a single line of data to be output to a secondary file
 previously opened by an .OPEN directive.
 
 Example:
 
	 .DATA #n This line will go into data file n
 
 One or more blanks or tabs can follow the .DATA command.  If the
 first character is a blank, it is removed and not placed in the output file.
 If the first character is a tab, it is transferred to the output file.
 
2 .END
#END
2 END
 
 Delimits the end of a BEGIN-END block.  All local symbols defined since the
 last .BEGIN command are erased by this command.
 
 Format:
 
	.END
 
 Note that an .END command must appear on a line by itself. It cannot
 be part of an .IFx command line.
 
2 .EXIT
#EXIT
2 EXIT
 
 Leaves a BEGIN-END block or a command file, optionally specifying
 exit status. The exit status value can be any 16-bit encoded value.
 This value will be available in the next outer command file as the
 value of <EXSTAT> or to the task that spawned Indirect as the exit
 status value (RSX-11M-PLUS only).
 
 Format:
 
 	.EXIT [n]
 
 where n is the numeric expression for the exit status.
 
2 .FORM
#FORM
2 FORM
 The .FORM command is an optional feature of Indirect and supported only on
 nonprivileged versions running under RSX-11M-PLUS. You must have
 a license and have installed the FMS-11/RSX V1.0 kit. Familiarize yourself
 with the documentation before attempting to use the .FORM command.
 
 The FMS-11 support included when the nonprivileged Indirect task is built
 incorporates support for the VT100 and VT52 terminals. 
 
 The syntax of the .FORM command parallels the format of the MACRO-11 call
 interface to FMS-11. You are encouraged to read the FMS-11/RSX V1.0 
 Programmers Guide, particularly the chapters on form driver operation 
 and the MACRO-11 interface.
 
 For more information, type HELP INDIRECT FORM COMMANDS and HELP INDIRECT
 FORM SUMMARY.
3 COMMANDS
 In the following summaries, square brackets enclose optional arguments. 
 Formal parameters are:
 
     LINENUM     The screen line number where form display is to begin.
     RETTRM      The name of a numeric variable to contain the code for the 
		 terminator typed by the user.
     FILENAME    The name of a string variable or string constant naming
		 the file in which the form definitions are stored.
     RETNAM      The name of the field completed by the user.
     RETINX	 The index of the field completed by the user.
     TERMINATOR  The code for the terminator to be processed.
     VALUE	 A string variable or constant to be placed in the indicated
		 field.
     FLDNAME	 The name of a field defined in the currently displayed form.
     INDEX	 In an indexed field, the index referencing the specific
		 field being addressed.
     RETVAL	 The name of a string variable into which the returned value
		 will be placed.
 
 
 String values supplied TO the .FORM command can be expressed 
 as a constant enclosed in quotation marks or as the name of a previously
 defined string variable.  For example:
 
	.FORM OPN,"FMSDEM.FLB"
		and
	.SETS LIBR "FMSDEM.FLB"
	.FORM OPN,LIBR
 
 are equivalent.
 
 String and numeric values returned FROM the .FORM command are passed
 as though a .SETS or .SETN command were being executed. This means that
 the name of the variable to receive the value must be supplied and that
 it must either be not previously defined or defined as the appropriate
 string or numeric type.  For example:
 
	.FORM GET,"CHOICE",,,,FLDVAL
 
 FLDVAL is defined or redefined as required and contains the string typed
 by the user to fill the field named CHOICE on the currently displayed
 form.
 
 The general syntax of the .FORM command is
 
	.FORM FNC,p1,p2,....pn
 
 where FNC is a three-letter code indicating which FMS operation is to
 be performed. These codes are a subset of the codes used in the MACRO-11/FMS
 interface and are summarized below.
 
 A demonstration procedure is included in LB:[1,2]INDSYS.CLB. This procedure
 library is packaged on the distribution kit with the privileged MCR
 task sources. Please refer to
 
	HELP INDIRECT INDSYS
 
 for installation information. To execute the demonstration
 procedure, type the following command line:
 
 |	@LB:[1,2]INDSYS.CLB/LB:FMSDEM<cr>
 
 After verifying the terminal type, a copy of the forms library will be
 placed in your directory. The procedure is identical to that provided
 in MACRO-11 form on the FMS/RSX V1.0 kit. Refer to the FMS documentation
 for a fuller description of the demonstration.
 
 Commands:
 
 CSH -- Clear screen and show form
 
	.FORM CSH,FLDNAME[,LINENUM]
 
 SHO -- Show form
 
	.FORM SHO,FLDNAME[,LINENUM]
 
 GET -- Get value for specified field
 
	.FORM GET,FLDNAME[,INDEX[,RETNAM[,RETINX[,RETVAL[,RETTRM]]]]]
 
 ANY -- Return any field value
 
	.FORM ANY[,RETNAM[,RETINX[,RETVAL[,RETTRM]]]]]
 
 ALL -- Return all fields
 
	.FORM ALL[,RETVAL[,RETTRM]]
 
 DAT -- Get data from form
 
	.FORM DAT,[FLDNAME],[INDEX],[RETVAL]
 
 GSC -- Get current line of scrolled area
 
	.FORM GSC,FLDNAME,RETVAL[,RETTRM]
 
 CLO -- Close forms library
 
	.FORM CLO
 
 OPN -- Open forms library
 
	.FORM OPN,FILENAME
 
 PSC -- Put to current line of scrolled area
 
	.FORM PSC,FLDNAME,VALUE
 
 TRM -- Process field terminator
 
	.FORM TRM,[FLDNAME],[VALUE],TERMINATOR [,RETNAM [,RETINX]]
 
 PUT -- Put to specified field
 
	.FORM PUT,FLDNAME,[INDEX],VALUE
 
 PAL -- Put all fields
 
	.FORM PAL [,VALUE]
 
 LST -- Output to last line of screen
 
	.FORM LST [,VALUE]
 
 RAL -- Return all fields
 
	.FORM RAL,VALUE
 
 RTN -- Return value for specified field
 
	.FORM RTN,FLDNAME,[INDEX],RETVAL
 
 SPF/SPN -- Supervisor mode control
 
	.FORM SPF
	.FORM SPN
 
 
3 SUMMARY
	.FORM CSH,FLDNAME[,LINENUM]
	.FORM SHO,FLDNAME[,LINENUM]
	.FORM GET,FLDNAME[,INDEX[,RETNAM[,RETINX[,RETVAL[,RETTRM]]]]]
	.FORM ANY[,RETNAM[,RETINX[,RETVAL[,RETTRM]]]]]
	.FORM ALL[,RETVAL[,RETTRM]]
	.FORM DAT,[FLDNAME],[INDEX],[RETVAL]
	.FORM GSC,FLDNAME,RETVAL[,RETTRM]
	.FORM CLO
	.FORM OPN,FILENAME
	.FORM PSC,FLDNAME,VALUE
	.FORM TRM,[FLDNAME],[VALUE],TERMINATOR [,RETNAM [,RETINX]]
	.FORM PUT,FLDNAME,[INDEX],VALUE
	.FORM PAL [,VALUE]
	.FORM LST [,VALUE]
	.FORM RAL,VALUE
	.FORM RTN,FLDNAME,[INDEX],RETVAL
	.FORM SPF
	.FORM SPN
 
2 .DISABLE
#ENABLE
2 DISABLE
#ENABLE
2 .ENABLE
#ENABLE
2 ENABLE
 With the .ENABLE and .DISABLE commands, several Indirect operating modes
 can be controlled.  These modes are:
 
   Mode   	Default	   Scope	     Default Effect
   ----         -------    -----             ------- ------
		setting
                -------
 
 ATTACH		Enabled	     G     Indirect attaches to TI: for comment lines.
 CONTROL-Z	Disabled     G     CTRL/Z in response to .ASKx exits Indirect.
 DECIMAL	Disabled     G     Numeric symbols are created as OCTAL.
 DELETE		Disabled     L     The current command file is not deleted at end.
 DETACH		Enabled	     G     Indirect detaches from TI: for command lines.
 DISPLAY	Enabled      G     Indirect displays the current fields for 
				   .ASKx and "@ <EOF>".
 ESCAPE		Disabled     G     ESCAPE or ALTMODE is legal for .ASKx 
				   response.
 ESCAPE-SEQ	Disabled     G     When Indirect attaches, escape-sequence 
				   recognition is not enabled.
 FMS		Read-only    G     If enabled, the .FORM command is supported 
				   (RSX-11M-PLUS only).
 FULL-DUPLEX	Read-only    G     If enabled, the full-duplex terminal 
				   driver is available.
 GLOBAL		Enabled	     L     Symbols of the form $xxxx are placed in a
				   global symbol table.
 LOWERCASE	Enabled      L     Indirect is not sensitive to the case of
				   commands or strings.
 MCR		Enabled      L     Commands not processed by Indirect are 
				   passed to the default CLI for the terminal.
 QUIET		Disabled     L     Comments and CLI commands are displayed on 
				   the terminal.
 SUBSTITUTION	Disabled     L     String substitution is not performed before
				   command line evaluation.
 TIMEOUT	Enabled      G     The timeout parameter of .ASKx commands is
				   processed.
 TRACE		Disabled     G     Commands processed by Indirect are not 
				   displayed on the terminal.
 TRUNCATE	Disabled     G     Truncate errors on a .READ command are 
				   not ignored.
 DATA		Disabled     L     Input lines are written to an open data file.
 OVERFLOW	Disabled     L     Allows signed numeric operations
				   that would normally cause under- or
				   overflow errors.
 
2 .DEC
#DEC
2 DEC
 
 Decrement the value of a numeric symbol by one.
 
 Format example:
 
	.DEC I
 
2 .DELAY
#DELAY
2 DELAY
 
 Delay the execution of an indirect command file for a specified
 period of time. The argument is a decimal number of time units followed
 by the character H, M, S, or T (for hours, minutes, seconds, or ticks
 respectively).
 
 Format example:
 
	.DELAY 10S		! Delay 10 seconds
 
2 .ERASE
#ERASE
2 ERASE
 
 .ERASE GLOBAL 
 
	Deletes all global symbols from the symbol table.
 
 .ERASE LOCAL 
 
	Deletes all local symbols defined in the current block
	from the symbol table.
 
 .ERASE SYMBOL global-name
 
	Erases the single symbol 'global-name' from the global symbol
	table.
 
2 .GOTO
#GOTO
2 GOTO
 
 Branches to a label.
 
 Format example:
 
		.GOTO ERROR
		.EXIT 1
	.ERROR: ; Warning, error encountered.
 
2 .GOSUB
#GOSUB
2 GOSUB
 Saves the location of the next Indirect command and branches to a label
 identifying a subroutine.  Upon execution of a .RETURN command, 
 control returns to the next command line following the .GOSUB command.
 Any parameters to the right of the label and to the left of a comment 
 are transferred to the local symbol COMMAN. The value of COMMAN can then 
 be parsed to obtain formal call parameters.
 
 Format examples:
 
	.GOSUB DCB
	.GOSUB BLDTBL DB,2,176450,210   !Build device table
 
 For the second example, the following command line will separate the call
 parameters:
 
	.PARSE COMMAN "," DEVICE COUNT CSRADR VECADR
 
2 .IF
#IF
2 IF
 
 .IF                      -  Determines whether or not a symbol satisfies 
                             one of several  possible conditions.
 
 .IFACT/.IFNACT           -  Determines whether or not a task is active.
 
 .IFDF/.IFNDF             -  Determines whether or not a symbol is defined.
 
 .IFINS/.IFNINS           -  Determines whether or not a task is installed
                             in the system.
 
 .IFLOA/.IFNLOA           -  Determines whether or not a device driver is 
			     loaded.
 
 .IFT/.IFF                -  Determines whether a logical symbol is true 
			     or false.
 
 .IFENABLED/.IFDISABLED   -  Determines whether an Indirect operating mode
			     is enabled or disabled, or whether an environmental
                             condition is met.  Legal options are:
 
				MCR, TRACE, DELETE, CONTROL-Z, GLOBAL,
				SUBSTITUTION, LOWERCASE, ESCAPE, QUIET,
				TIMEOUT, FMS, FULL-DUPLEX, DECIMAL, LOCAL,
				ESCAPE-SEQ, TRUNCATE, POTASK, DISPLAY, ATTACH,
				DETACH, OVERFLOW
 
 Examples:
 
	.IF ADDRES = "14 GARBLE ROAD" .GOTO 10
	.IFNACT PIP pip /li
	.IFDF DLG ; Long dialog
	.IFNINS PIP ins $pip/inc=20000/task=...pip
	.IFNLOA MM: loa mm:
	.IFT START .GOTO START
	.IFDISABLED QUIET PRI *.LST
2 .INC
#INC
2 INC
 
 Increment the value of a numeric symbol by one.
 
 Format example:
 
	.INC I
 
2 .LABEL:
 
#LABEL:
2 LABEL:
 
 Assigns a name to a line in the command file  so that the line 
 can be referenced.  For example:
 
		.GOTO CLNUP		! Jump to clean-up routine
		.
		.
	.CLNUP:				! Beginning of clean-up code
 
 Labels that are placed alone on command lines are called Direct Access.
 Indirect remembers the exact location of these labels, and they can be used
 to decrease search time for .GOTO and .GOSUB directives.
 
 
2 .ONERR
#ONERR
2 ONERR
 
 Defines a label to branch to upon detecting an error condition.
 The scope of the label is limited to the current BEGIN-END block or to
 the currently open command file, whichever is appropriate.
 
 Format example:
 
	.ONERR ERRSRV		! Define the label for a .GOTO ERRSRV
				! ...operation in case of error
 
 Once an error condition has occurred, another .ONERR label must be defined
 to re-enable error processing.
 
2 .OPEN
#OPEN
2 OPEN
 
 .OPEN [#channel_number] filename
 
      Creates an output file on the indicated channel.
 Format examples:
 
 	.OPEN DATA.DAT
 
 .OPEN returns the FCS-11 status code for the operation in the special 
 symbol <FILERR>.
 
 Alternative forms .OPENA and .OPENR are described below.

 .OPENA [#channel_number] filename
 
      If the indicated file exists, opens it for an append operation.
      If the file does not exist, a new file is created in the same manner
      as for .OPEN.
 
 .OPENA returns the FCS-11 status code for the operation in the special 
 symbol <FILERR>.

	.OPENA #3 DB4:DATALOG.LST

 
 .OPENR [#channel_number] filename
 
      Opens the indicated file for a read operation by means of the .READ
      command.
 
 .OPENR returns the FCS-11 status code for the operation in the special 
 symbol <FILERR>.

	.OPENR #3 DB4:DATALOG.LST

2 .PARSE
#PARSE
2 PARSE
 Strings can be parsed into substrings with the .PARSE command.
 The command line is in the form:
 
	.PARSE <string> <control-string> <var1> <var2> ... <varn>
 
 The string is decomposed into substrings as specified by the
 control string.  The substrings are stored in the specified variables.
 The first character of the control string delimits the first
 substring, the second character of the control string delimits the
 second substring, and so on.  The last character of the control string
 is repeated if the number of destination variables exceeds the
 length of the control string.
 
 If there are more variables specified than substrings, the additional variables
 are set to be null strings.  If there are fewer variables than parsable
 substrings, the last variable contains the unparsed fragment of <string>.
 The symbol <STRLEN> contains the actual number of substrings processed
 (including explicit null substrings).
 
 For an example, type HELP INDIRECT PARSE EXAMPLE
3 EXAMPLE
 
 An example of using the .PARSE command is:
 
	.PARSE COMMAN " ," FILE A1 A2 A3 A4 A5
 
 Given that COMMAN contains "TESTFILE IND,MCR,,LOA", the results would
 be:
 
	FILE=	TESTFILE
	A1=	IND
	A2=	MCR
	A3=	Null
	A4=	LOA
	A5=	Null
 
	<STRLEN> would contain a 5.
 
 Note that the explicit null substring is counted in <STRLEN>.
 
 
2 .PAUSE
#PAUSE
2 PAUSE
 
 Stop Indirect from processing to allow user action.  Indirect displays
 the command line you must enter to resume Indirect operation.
 
 Format:
 
	.PAUSE
2 .READ
#READ
2 READ
 
 Files can be opened and read by using the following commands:
 
   .OPENR [#file] <filespec>	Open a file for reading.
 
   .READ [#file] <variable>	Read next record into specified string
				variable.
 
   <EOF>			After a .READ, true if end-of-file
				encountered, false if not.
 
   <FILERR>			Contains the FCS-11 error code if an
				error ocurred on the .READ operation.
 
 
 For more information, type HELP INDIRECT READ DETAILS
 For an example, type HELP INDIRECT READ EXAMPLE
 
3 DETAILS
 
To read from a data file, the file must first be opened successfully
using the .OPENR command.  Records can then be read using the .READ
command until either <EOF> is set to true or <FILERR> returns an error
code.  When processing is complete, the file should be closed using
a .CLOSE command.
 
The .OPENR command has the same format as the .OPEN and .OPENA commands,
and also sets the special variables <FILSPC>, <FILATR>, and <FILERR>.
 
The .READ command is similar in format to the .DATA command,
except that, instead of having as its argument the text to be written
out to a file, the argument is a string variable.  The entire record
is written into the string variable. If an error occurs while 
reading a file, the variable is unchanged from its previous state.
 
The <EOF> variable is set by the .READ command.  This means
specifically that its state is unknown following an .OPENR
command.  If an end-of-file has occurred, both <EOF> and <FILERR>
are set to indicate the end-of-file.
 
3 EXAMPLE
 
The following indirect command file routine lists a file on
the terminal:
 
		.OPENR FILE
		.IF <FILERR> NE 1 .GOTO ERROR
 
	.LOOP:	.READ A
		.IFT <EOF> .GOTO DONE
		.IF <FILERR> NE 1 .GOTO ERROR
	; 'A'
		.GOTO LOOP
 
	.DONE:	.CLOSE
 
2 .RETURN
#RETURN
2 RETURN
 
 Effects an exit from a subroutine and returns to the command
 line immediately following the corresponding .GOSUB subroutine call.
 
 Format:
 
	.RETURN
 
2 .STOP
#STOP
2 STOP
 
 Immediately stop command file execution, optionally specifying
 the exit status for the Indirect task.
 
 The .STOP command is synonymous with the logical end-of-file command (/).
 
 Format example:
 
	.STOP 1
 
2 .SET
#SET
2 SET

 .SETN variable numeric-expression
 .SETD variable
 .SETO variable
 
    Define or redefine a numeric symbol and assign it a specific
    numeric value. The .SETO and .SETD directives change the
    default radix of the variable to be octal or decimal respectively.
 
 .SETS variable string-expression
 
    Defines or redefines a string symbol and assigns the symbol a
    specific ASCII-character string value.
 
 .SETT variable
 .SETF variable
 .SETL variable logical-expression
 
    Define or redefine a logical symbol and assign the symbol a
    true or false value.
 
 Examples:
 
 	.SETN NUM COUNT*2
	.SETS ADDRES "14 GARBLE ROAD"
	.SETT MALE
	.SETL FLAG FLAG!NEWERR
2 .TEST
#TEST
2 TEST
 The .TEST command is used to determine the symbol type and return a
 type code in <SYMTYP>.  If the symbol is a string, the command tests
 the length of the string or locates a substring.
 
 Format examples:
 
	.TEST ADDRES
	.IF <STRLEN> GT 20.     ; Length of response too long
 
	.TEST ADDRES "STREET"   ! Look for the string "STREET" in the string
				! ...contained in ADDRESS.
	.IF <STRLEN> = 0 .GOTO NOTFND  ! <STRLEN> = the character position
				       ! where "STREET" begins.
 
 If the variable being tested is a string, then the following symbols
 are set to reflect characteristics about the string:
 
	<RAD50>, <ALPHAN>, <NUMBER>, <OCTAL>
 
 If the variable being tested is numeric and octal, then the following symbol
 is set to reflect the symbol radix:
 
	<OCTAL>
 
 See also HELP INDIRECT TESTDEVICE
			TESTPARTITION
			TESTFILE
2 .TESTDEVICE
#TESTDEVICE
2 TESTDEVICE
 Allows a command file to acquire information
 about any device in the system. The returned data, including error 
 indication, is found as a string in <EXSTRI>. For example:
 
	.TESTDEVICE MP:
 
 This command obtains information about the indicated device and
 returns a string in the string symbol <EXSTRI>.  The various fields can
 be isolated with the .PARSE or .TEST substring directives.  The string
 is in the following format:
 
	DB3:,140210,4405,31276,1000,atr,atr,...,atr,
 
 where:
	DB3: is the translated device name for "MP:"
 
	The next four parameters are the four device-characteristics
		words in octal notation
 
	"atr" are various device attributes from the following list:
 
		NSD	"No such device" is configured in this system
		LOD	The device driver is loaded
		UNL	The device driver is not loaded
		ONL	The device is on-line
		OFL	The device is off-line
		MTD	The device is a mountable volume and is mounted
		NMT	The device is not mountable or is not mounted
		FOR	The device is mountable and mounted foreign
		NFO	The device is not mountable or not mounted foreign
		PUB	The device is a public device
		NPU	The device is not a public device
		ATT	The device is attached to another task
		ATU	The device is attached to this copy of Indirect
		NAT	The device is not attached
		ALO	The device is allocated to another terminal
		ALU	The device is allocated to this terminal
		NAL	The device is not allocated
 
 See also HELP INDIRECT TEST
			TESTPARTITION
			TESTFILE
2 .TESTPARTITION
#TESTPARTITION
2 TESTPARTITION
 Allows a command procedure to obtain information about
 the current or any other partition in the system. It can be used to
 verify that a partition is of sufficient size before an INSTALL command
 is issued or that it is present before special systems are loaded. The 
 syntax of the directive is:
 
	.TESTPARTITION partition-name
 
 where "partition-name" is any one- to six-character legal partition name.
 If the character "*" is found, then it is assumed the reference is to
 the same partition in which this version of Indirect is executing. The
 returned data is in the form:
 
	partition-name,base in 32-word units,size in 32-word units,type,
 
 If the partition is not found, the error
 
	,,,NSP,
 
 (No such partition) is returned.  For example:
 
	.TESTPARTITION GEN
	;'<EXSTRI>'
 
 might show:
 
	;GEN,1500,2303,SYS,
 
 The partition type is SYS for system-controlled, USR for user-controlled,
 or NSP for an unknown partition.
 
 
 See also HELP INDIRECT TEST
			TESTDEVICE
			TESTFILE
2 .TESTFILE
#TESTFILE
2 TESTFILE
 Determines if a specific file exists or the translation of assigned
 devices.  The format of the command line is:
 
	.TESTFILE filespec
 
 The output of the command is contained in the <FILSPC> and <FILERR>
 special symbols.  <FILSPC> returns the fully qualified file specification
 and <FILERR> returns the FCS status code from the look-up.  (For more
 information on these special symbols, type HELP INDIRECT FILE.)
 
 
 If no file name is included in the file specification, only device
 translation is performed.  If a file name is included, the
 specified file is searched for and the fully qualified file specification
 returned in <FILSPC>.
 
 For several examples, type HELP INDIRECT TESTFILE EXAMPLES
 
 See also HELP INDIRECT TEST
			TESTPARTITION
			TESTDEVICE
3 EXAMPLES
 
An example of using the .TESTFILE command for logical device
translation:
 
	.TESTFILE TI:
 
 Returns:		<FILERR> = 1.
			<FILSPC> = TT10:.DAT;0
 
An example of using the .TESTFILE command for file information:
 
	.TESTFILE MP:IND.MAP
 
If the file exists:	<FILERR> = 1.
			<FILSPC> = DR1:[101,300]IND.MAP;6
 
If not:			<FILERR> = 230.
			<FILSPC> = DR1:[101,300]IND.MAP;0
 
2 FILE
 
After a .TESTFILE, .OPEN, .OPENA, .OPENR, or .DATA operation, the two
special symbols <FILSPC> and <FILERR> are returned.
 
<FILSPC> is a string symbol that contains the fully qualified
file specification.
 
<FILERR> is a decimal numeric symbol that contains the
status code resulting from the previous operation.  The code
will be one of the following:
 
	1.	  Operation was successful.
 
negative word	  Operation failed; code is an operating-system error code.
 
postitive word    Operation failed; code is a file-system error code.
but negative
lower bye
 
For example, the error code -1. means "Insufficient dynamic
storage", while 230. (-26. as a byte) means "No such file."
 
For a complete listing of all error codes, see the IAS/RSX-11 I/O
Operations Manual.
 
 
 
2 .WAIT
#WAIT
2 WAIT
 Wait for a specified task to finish executing or get exit status from a
 previously completed task that was started with the .XQT directive.
 
 Format examples:
 
	.WAIT PAYROL
	.WAIT PIP		! Wait for the copy of PIP running
				! ...on this terminal to complete
2 .XQT
#XQT
2 XQT
 Initiate a task, pass a command line to it, and then continue indirect
 command file processing.
 
 Format example:
 
	.XQT MAC TEST,TEST=TEST
 
 In this case, use the .WAIT MAC command line to verify that the MAC task
 has completed and exited.
2 ACCOUN
 <ACCOUN> is a string symbol that contains certain accounting information
 from the user's RSX-11M-PLUS accounting block. On RSX-11M or if accounting
 is not running on M-PLUS, this symbol returns a series of commas with null 
 entries.  The string returned is in the following format:
 
      User_name,Session_id,Account_number,CPU,DIR,QIO,TAS,Active_tasks,
 
 User_name         The first 14. characters of the user name as it appears 
		   in the system account file followed by the first initial
 Session_id        The three-letter session-ID code followed by the unique
	           login number
 Account_number    The user's account number as it appears in the system 
                   account file
 CPU               CPU ticks used since login
 DIR               Total system directives issued since login
 QIO               Total QIO directives issued since login
 TAS               Total tasks run since login
 Active_tasks      Current count of active tasks
 
 The individual fields can be isolated with the .PARSE command:
 
	.PARSE <ACCOUN> "," NAME SID ACNT CPU DIR QIO TAS ACT JUNK
 
 Note that since double precision arithmetic is not available in Indirect,
 these count values cannot be converted to numeric form and manipulated
 in arithemetic expressions.
 
2 ALPHAN
 
 <ALPHAN> is a logical symbol TRUE if last response to a .ASKS query was 
 an alphanumeric string; else FALSE. <ALPHAN> is also set by a .TEST
 command.
 
2 ALTMOD
 
 <ALTMOD> is a logical symbol set TRUE if last question was answered
 with an ALTmode or ESCape; else FALSE.
 
2 BASLIN
 
 <BASLIN> is a logical symbol set TRUE if the current operating system
 is a baseline configuration. This option is used by DIGITAL system
 generation procedures to determine what resources are available for
 the SYSGEN process.
2 CLI
 
 <CLI> is a string symbol set to "MCR", "DCL", or another 1- through 
 6-character CLI name, depending on the current command line interpreter
 for the terminal.
 
2 CONFIG
 
 <CONFIG> is a string symbol that contains the build-time parameters and
 values for the current running version of Indirect.
 
2 DATE
 
 <DATE> is a string symbol set to the current date.  The date is in the 
 format dd-mmm-yy.
 
2 DEFAUL
 
 <DEFAUL> is a logical symbol set TRUE if the answer to the last question was
 defaulted; else FALSE.
 
2 EOF
 
 <EOF> is a logical symbol set to <TRUE> if the last .READ command resulted
 in reading past the end of the file.  If you type a CTRL/Z in response to
 a .ASKx command and Control-Z mode is .ENABLEd, then <EOF> is also set
 to <TRUE>.
 
 Format example:
 
	.READ #3 nxtlin
	.IFT <EOF> .GOTO END
 
2 ERRCTL
 
 <ERRCTL> is a numeric symbol that controls Indirect processing upon
 encountering an error.  It is treated as an 8-bit mask with bits 0
 through 7 set to indicate that the user's .ONERR target routine will
 process that class of error.  If the bit is clear, Indirect exits after
 printing the error information.
 
 The eighth bit (the sign bit or 200 octal) is used to control whether
 Indirect will print any indication of an error.  If the bit is set,
 no error information is printed.  
 
 The initial default value for <ERRCTL> is 1, which implies that only
 class 1 errors can be handled with an .ONERR address and that error messages
 will be printed.
 
 You are cautioned about indiscriminate use of this mask because debugging
 a command file becomes very difficult.  Refer to HELP INDIRECT ERRORS
 for a list of error messages and their assigned class values.
 
 If you attempt to trap errors other than default class 1, note that 
 processing cannot continue in most cases.  The error service routine is
 limited to a fatal error message and .EXIT.  The internal state of Indirect
 is unknown in all but class 1 error cases.
 
 
2 ERRNUM
 
 After processing an error, Indirect places in <ERRNUM> the error number
 associated with the error. This value can be used for error-type-specific
 processing in an .ONERR routine. See HELP INDIRECT ERRORS for a list
 of error messages and their assigned numbers.
 
2 SEVERE
#ERROR 
2 SUCCES
#ERROR
2 WARNIN
#ERROR
2 ERROR
The five symbols below are defined as a convenience for determining the
exit status of a command. Their values are:
 
	<WARNIN> = 0
	<SUCCES> = 1
	<ERROR>  = 2
	<SEVERE> = 4
	<NOSTAT> = 17
 
 Note that a user or program can encode more than just the low-order 3 bits
 of the exit status.  If this is the case, a comparison in the following
 form will not always succeed:
 
	.IF <EXSTAT> = <SUCCES> .GOTO CONTIN
 
 In this case, the appropriate bits must be masked in order to isolate the
 reserved success/fail status field of the exit status. A general form is
 
	.IF <SUCCES> = <EXSTAT>&7 .GOTO CONTIN
 
2 ERRSEV
 
 After processing an error, Indirect places in <ERRSEV> the error severity
 mask associated with the error. This bit mask corresponds with the bits
 of the mask <ERRCTL> used to control Indirect error processing.
 
2 ERSEEN
 
 <ERSEEN> is a logical symbol that takes the value <TRUE> if any of the
 following conditions are true:
 
	1. <FILERR> < 0	  if a negative error code was returned
 
	2. (<EXSTAT>&7) .GT. 1.  if an exit status value worse than
				 <WARNING> was returned
 
	3. <EOF> is TRUE
 
	4. <ERRNUM> is non-zero
 
	5. If you have specifically used the command line
 
			.SETT <ERSEEN>
 
 
 If you use the command line .SETF <ERSEEN>, the following side effects
 are noted:
 
	1. <FILERR> is set to 0
	2. <EXSTAT> is set to 0
	3. <EOF> is set to <FALSE>
	4. <ERRNUM> is set to 0
 
2 ESCAPE
 
 <ESCAPE> is a logical symbol set TRUE if last question was answered
 with an ESCape or ALTmode; else FALSE.
 
2 EXSTAT
 
 <EXSTAT> is a numeric symbol that contains the exit status value as set
 by the last exiting task or by the .EXIT command.
 
 	warning		=	0	=	<WARNIN>
	success		=	1	=	<SUCCES>
	error		=	2	=	<ERROR>
	severe error	=	4	=	<SEVERE>
	no status	=      17	=	<NOSTAT>
 
 For more information, type HELP INDIRECT ERROR.
 
2 EXSTRI
 <EXSTRI> is a string symbol used to return string results from a
 more deeply nested command file to the calling command file.
 To allow controlled return of values from a nested file, the
 <EXSTRI> symbol can be set with a string value. In a fashion similar
 to <EXSTAT>, the string value is propagated back to the CALLING file.
 
 Examples:
 
 !		@deeperfile param1 param2 param3
 !		.sets result <EXSTRI>
 
 
	OR
 
 !		.gosub maktab
 !		.sets switch <exstri>
 
 For an extended example, please refer to:
 
	HELP INDIRECT ADVANCED
 
 Note that <EXSTRI> is set to null when Indirect waits for the completion
 of a task.
 
2 FALSE
 
 <FALSE> is a logical literal symbol used in comparisons with other logical
 symbols to determine if they have a false value.
 
2 FILERR
 
 After a .TESTFILE, .OPENx, or .READ statement, <FILERR> contains the
 FCS-11 or I/O driver status code resulting from the operation. These
 codes are documented in the RSX-11M/M-PLUS I/O Drivers Reference
 Manual.
 
 For an extended example of code translation to messge strings, see
 HELP INDIRECT ADVANCED.
 
2 FILER2
 
 <FILER2> contains the FMS error code that was returned from the last
 .FORM directive issued.  
 
2 FILATR
 The special symbol <FILATR> returns the 7 words of file-attribute
 information contained in the FCS-11 File Descriptor Block. The data
 is from the FDB used in the last preceding .OPENx operation. Refer
 to the IAS/RSX-11 I/O Operations Manual for a description of file attributes
 and the values of each field.
 
2 FILSPC
 The string symbol <FILSPC> contains the fully qualified specification
 for the file referred to with the last .OPENx or .TESTFILE directive
 operation, or in the last specification for a nested command file.
 
 Examples:
 
	.SETS CMDSPC <FILSPC>	! Save the name of "this" command file
 
	.TESTFILE TI:
	.SETS TERMIN <FILSPC>	! Get the name of "this" terminal
 
2 FORATT
 
 <FORATT> is a numeric symbol that contains the octal value of the file 
 attributes used in opening all data files.  This symbol can be reset with 
 the .SETN directive to allow foreign-attribute files to be written.
 
2 FMASK
 
 <FMASK> is a string symbol that contains the octal value of the three
 system feature mask words, separated by commas to allow easy parsing by
 the .PARSE directive.
 
2 IAS
#RSX11D
2 LIBUIC
 
 <LIBUIC> is a string symbol set to the UIC containing nonprivileged
 utility tasks; format is [g,m].  This special symbol has a meaningful
 value on RSX11M-PLUS systems only.  The string symbol is a constant
 with the value of [1,54] for RSX11M systems.
2 LOCAL
 <LOCAL> is a logical symbol set to TRUE if the terminal from which
 Indirect is executing ("TI:") is flagged by the terminal driver
 as a local terminal.
 
2 LOGDEV
 <LOGDEV> is a string symbol equal to the device name and unit number of
 the user's login account. This value is available only on systems supporting
 the multiuser SYSGEN option; otherwise, <LOGDEV> is set with "SY0".
 
2 LOGUIC
 <LOGUIC> is assigned the login UIC for the current user. In systems without
 multiuser protection, <LOGUIC> is assigned the current default UIC.
 
2 MAPPED
 
 <MAPPED> is a logical symbol set to TRUE if the current system supports
 memory management; else FALSE.
 
2 MEMSIZ
 
 <MEMSIZ> is a numeric symbol assigned the size of memory in K words
 (1K = 1024.).
 
2 NETUIC
 <NETUIC> is a string symbol that contains the value of the UIC/DIRECTORY
 string used on the system volume to hold the DECnet tasks. This symbol is
 used with the <SYSUIC> and <LIBUIC> symbols to separate and manage the 
 components of your system. (Meaningful on RSX11M-PLUS systems only).
2 NETNOD
 <NETNOD> is a string symbol that contains the name of this system in
 a DECnet network. 
2 NOSTAT
 
 <NOSTAT> is a numeric literal symbol that is used in comparisons to
 determine if a value returned from a task was an actual valid exit 
 status.
 
2 NUMBER
 
 <NUMBER> is a logical symbol used to verify that the last string entered
 in response to an .ASKS directive or tested in the last .TEST directive
 contains only numeric characters. An empty string also sets <NUMBER> to
 <TRUE>.
 
2 NXTSYM
 
 <NXTSYM> is a unique string/operation symbol used in the utility library
 procedure INDDMP to display the current contents of the local and global
 symbol tables.
 
2 OCTAL
 <OCTAL> is a logical symbol set to TRUE if the numeric answer to the
 last .ASKN command or the value of the symbol tested in the last
 .TEST command is octal.  If the .TEST command referenced a string
 and only the numeric characters 0 through 7 were found in the string,
 <OCTAL> is set to TRUE.
2 PRIVIL
 <PRIVIL> is a logical symbol set to TRUE if the current user is
 privileged. 
2 RAD50
 <RAD50> is a logical symbol set to TRUE if the last string tested
 or typed in response to a .ASK question contained only characters in
 the Radix-50 character set; else FALSE.
2 RSX11D
 
 <RSX11D> and <IAS> are logical symbols set to TRUE if the current system
 is RSX-11D or IAS; otherwise, it is set to FALSE.
 
2 SPACE
 
 <SPACE> is a numeric symbol set to the number of free bytes left in the
 symbol table.  This value does not include symbol table space that could
 be gained by a later automatic extension of the Indirect task.
 
2 STRLEN
 
 <STRLEN> is a numeric symbol set by the .TEST command to the length in
 bytes of the tested string. Upon initial entry into Indirect, <STRLEN>
 contains the count of valid parameters passed in the command line. 
 
2 SYDISK
 
 <SYDISK> is a string symbol set to the system disk mnemonic.  There is
 no associated unit number (see <SYUNIT>).
 
2 SYMTYP
 As a result of a .TEST command, <SYMTYP> contains a numeric code
 indicating the type of symbol tested. The values returned are:
 
	Logical = 0
	Numeric = 2
	String  = 4
 
2 SYSDEV
 
 <SYSDEV> is a string symbol that contains the physical device specification 
 of the system boot device.
 
2 SYSID
 
 <SYSID> is a string symbol that contains the 1- through 6-character 
 operating system baselevel number.
 
2 SYSTEM
 
 <SYSTEM> is a numeric symbol set with the value 1 if the system is
 RSX-11M or 6 for RSX-11M-PLUS.
 
2 SYSUIC
 
 <SYSUIC> is a string symbol set to the current system UIC; format is
 [g,m].
 
2 SYUNIT
 
 <SYUNIT> is a numeric symbol set to the unit number of the system device.
 See <SYDISK>.
 
2 TIME
 
 <TIME> is a string symbol set to the current time; format is hh:mm:ss.
 
2 TICLPP
 
 At initialization, Indirect attempts to determine the current page length
 setting for the terminal. This value is defaulted to 24. if the information
 is not available; otherwise, it is the size of the screen or page in
 decimal lines.
2 TICWID
 
 At initialization, Indirect attempts to determine the current page width
 setting for the terminal. This value is defaulted to 80. if the information
 is not available; otherwise, it is the size of the screen or page in
 decimal characters per line.
2 TIMOUT
 
 <TIMOUT> is set <TRUE> if timeout mode is .ENABLEd and the last .ASKx 
 directive timed out waiting for a user response.
 
2 TITYPE
 At initialization, Indirect attempts to determine the terminal type for
 the terminal that initiated execution. If the request for information
 fails, this value is set to zero; otherwise, the value is as documented
 in the RSX-11M/M-PLUS I/O Drivers Reference Manual. Sample values 
 in octal notation are:
 
	VT52  = 11
	VT100 = 15
	LA120 = 16
2 TISPED
 
 At initialization, Indirect attempts to determine the baud rate for
 host-to-terminal character transmission. This information is useful
 in determining the quality and quantitiy of information to be
 transmitted. The value returned is as documented in the RSX-11M/M-PLUS
 I/O Drivers Reference Manual. Sample values in ocatal notation are:
 
	110 baud  =  5
	300 baud  = 11
	1200 baud = 13
	2400 baud = 16
	4800 baud = 20
	9600 baud = 22
2 TRUE
 
 <TRUE> is a logical constant used for comparisons with the .IF directive
 or as a default for the .ASK directive.
 
2 UIC
 
 <UIC> is a string symbol set to the current UIC; format is [g,m].
2 P0
#PARAMETER
2 P1
#PARAMETER
2 P2
#PARAMETER
2 P3
#PARAMETER
2 P4
#PARAMETER
2 P5
#PARAMETER
2 P6
#PARAMETER
2 P7
#PARAMETER
2 P8
#PARAMETER
2 P9
#PARAMETER
2 COMMAN
#PARAMETER
2 PARAMETER
 Parameters can be passed to an indirect command file by appending
 a space to the file specification, followed by the space-delimited
 parameters.  For example:
 
	cli>@file arg1 arg2 arg3 ... argn
 
 The entire command line, except for the initial at sign (@), will appear
    in the reserved symbol COMMAN.
 The file specification will appear in P0.
 The first eight parameters will appear in P1 through P8.
 The number of parameters passed (including the filespec) will appear
    in <STRLEN>.
 Any trailing information in the command line beyond the eight
    parameters will appear in P9.
 
 If any non-blank characters exist to the right of the subroutine name
 in a .GOSUB statement, these characters are placed in COMMAN but
 not .PARSEd into P0 through P9.  In this way, a simple formal
 call mechanism can be implemented. 
 
 For information on performing alternative command parses as well as
 additional parses on the arguments, see the description of the .PARSE
 command.
2 SUBSTITUTION
 
 Symbol substitution is triggered by Indirect detecting an apostrophe (')
 in its input line.  If substitution mode is .ENABLEd, the string after
 the apostrophe is assumed to be a symbol name.  The name is looked up
 in the appropriate symbol table and its value, converted to a string,
 substituted for the apostrophes and symbol name.
 
 For example, assume the following command series:
 
	.ENABLE SUBSTITUTION
	.SETN COUNT 9.	! The numeric symbol COUNT has the value of 9.
	; Current value of COUNT is 'COUNT'
 
 The characters "'COUNT'" will be replaced with "9" and the resulting
 line displayed on the terminal.
 
 For more examples and an explanation of substitution format control, type
 
		HELP INDIRECT SUBSTITUTION FORMAT
3 FORMAT
 The conversion of numeric values to strings, and the placement of
 string and logical values in the substitution operation can be controlled
 by use of a format control string.  The syntax for specification of the
 string is as follows:
 
	.....'symbol%format-string'......
 
 The format string begins with a percent sign (%) and terminates with 
 the second of the two apostrophes required to flag the 
 substitution operation. The format string itself is one or more of the
 following factors. Note that no consistency check is performed and in
 the case of conflicting specifications, the last specified option
 holds.
 
    Format Factor		Effect
    ------ ------		------
 
	C		Compress leading, embedded, and trailing blanks
			and remove embedded nulls.
	D		Force decimal conversion if 'symbol' is
			a numeric variable.
	O		Force octal conversion if numeric.
	S		Perform signed conversion if numeric.
	M		Perform magnitude conversion if numeric.
	Z		Return leading zeros if positive numeric value.
	Rn		Right-justify the resulting string, truncating
			to 'n' decimal characters if required.
	Ln		Left-justify with truncation to 'n' if required.
	V		Value insert. The first byte of 'variable' is
			moved to the output string. This is the ASCII
			equivalent of the low byte of a numeric symbol 
			or the octal value of the first byte of a string 
			variable.
	X		Convert the variable to Radix-50-equivalent characters.
 
2 LIBRARY
 Command procedures are indirect command files inserted into a
 universal library by the LBR utility.  These procedures can then be
 referenced with the /LB:module switch. 
 
 Command libraries are built by creating a universal library and inserting 
 commmand files as in the example below.  These procedures are then
 referenced by means of a command line as follows:
 
	>@CMDLIB/LB:PROC
 
 The default file type is .CLB.  The variants to this syntax are:
 
 >@CMDLIB/LB:module	Open CMDLIB.CLB and use module "module"
 
 >@CMDLIB/LB		Attempt to locate module .MAIN. in the library
			as though you had typed "@CMDLIB/LB:.MAIN."
 
 >@/LB:module		NOTE THIS......
 
			If this command is issued from a file (or terminal)
			NOT in a library, the /LB: switch is ignored and
			the command is treated as though you had
			typed "@MODULE.CMD".  NOTE: the default device
			and directory for the lookup of "module" is the
			SAME AS THE CURRENT FILE, not necessarily the
			terminal default.
 
			If this command is issued from within a library,
			then the module is looked up in the current
			library.
 
 		This last default behavior allows a collection of
		procedures to be developed in a given directory with
		commands of the form "@/LB:module" or ".CHAIN /LB:module".
		When subsequently placed in a library, no source changes 
		are required.
 
  To create a library of command procedures, use commands patterned after
  the following example:
 
	MCR command line interpreter syntax:
 
	LBR PROCLIB.CLB/CR::::UNI	       ; CREATE THE UNIVERSAL LIBRARY
	LBR PROCLIB.CLB=MAINPROC.CMD/IN:.MAIN. ; INSERT DEFAULT PROCEDURE
	LBR PROCLIB.CLB=OTHER.CMD/IN	       ; INSERT OTHER PROCEDURES
 
 
2 FORMATTING
 When writing Indirect command procedures, it is important to adhere to
 a common commenting and formatting style to make your procedure files
 readable and maintainable by others. The following suggestions will
 aid in this goal.
 
 1. Document the module function with a block comment at the beginning
    of the module. An example is:
 
	.;+ .INDEX -- Produce list of modules in a command library
	.;+	Version 2.3 - 24-Oct-80 - Updated by JEP
	.;
	.; This procedure will extract and display a list of all command
	.; modules contained in a given command library. Each module
	.; that adheres to the ".;+" comment format will have its
	.; extracted function and version data displayed.
	.;
	.; Call:
	.;	@LB:[1,2]INDSYS.CLB/LB:.INDEX
	.;
	.;
 
 2. Use comments on individual command lines to explain the use of variables
    and purpose of operations.  For example:
 
		.SETN ERRET 0	     ! Initialize error return number
		.SETS ERSTR ""	     ! Set error string to null
		.TEST COMMAN "/NOER" ! Determine whether the /NOERROR switch
				     ! ...appeared in the input command
 
		etc...
 
 3. Format the command file with labels beginning at the left margin and
    a leading tab before all other commands.  For example:
 
	.LOOP:
		.INC LOPCTR	! Increment loop counter
		.IFF ERFLG .GOTO EXIT
 
		etc...
 
 	.EXIT:	.EXIT 1		! Exit with success
 
 4. Use form feeds to separate sections of long command files for readability.
    The form-feed character, if it appears at the beginning or embedded
    within an Indirect command line, will be treated as a line terminator.
    If it is the only character on a line, the line is treated as though
    it were blank and is discarded by Indirect.
 
2 SWITCHES
 Indirect processes several switches on the initial command line. These are
 shown in their NON-default forms.
 
	>@file/TR	   Trace the file execution. As each line of the
			   command file is processed, it is displayed with
			   its nesting level and an exclamation mark. This
			   can also be controlled with the .ENABLE TRACE
			   directive.
 
	>@file/NOMCR	   Supress the passing of commands to the command
	      /NOCLI	   line interpreter.  They are used with the /TR
			   switch to test the logical flow of command
			   files without executing any other tasks.  This
			   can also be controlled with the .DISABLE MCR
			   directive.
 
	>@file/DE	   Indicate to Indirect that when all operations on
			   "file" are complete, the file is to be deleted.
 
	>@file/LO	   Indicate that when the new file is executing, the 
			   file can have access to the local symbols created 
			   by the next outer file. This is used in calling 
			   the procedure for dumping the symbol table. For
			   more information, see:
 
				HELP INDIRECT ADVANCED DUMP
 
	>@file/LB:module   Indicate that "file" is a universal library of
			   command procedures and that "module" is the
			   particular procedure to be executed. For more
			   information, see:
 
				HELP INDIRECT LIBRARY
 
2 ERRORS
 Errors of severity 1 are those trapped by use of the .ONERR command.
 Severity 0 errors are never trapped and severity 2 errors are trapped
 by use of the <ERRCTL> symbol.
 
    Severity 			Message
    --------			-------
 
 	0	Initalization error. Reinstall Indirect with a larger increment
 	0	@ <EOF>
 	1	Invalid keyword
 	1	String substitution error
 	1	Subroutine nesting too deep
 	1	.RETURN without .GOSUB
 	1	Illegal file number
 	1	File already open
 	1	File not open
 	1	Bad range or default specification
 	1	Illegal nesting
 	1	Null control string
 	1	Spawn failure
 	1	Too many concurrent .XQTs
 	1	Label not at beginning of line
 	1	Undefined symbol 
 	1	Undefined label
 	1	Data file error, Code 
 	1	Redefining symbol to different type 
 	1	Symbol type error 
 	2	Command file open error
 	2	Symbol table overflow 
 	2	Numeric under- or overflow
 	2	Syntax error
 	2	File not found
 	2	No pool space
 	2	File read error
 	2	String expression larger than 132. bytes
 	2	Maximum indirect file depth exceeded
 	2	Redefining a read-only symbol
 
 If Indirect fails to complete initialization when invoked, it will print
 an "Initialization error" message and display a code for the type of failure
 detected.  These codes are:
 
	1.  Unable to acquire system data such as UIC, etc.
	2.  Impure area setup failed.
	3.  Unable to acquire task-specific data.
	4.  Unable to acquire terminal-type data.
	5.  Unable to get "SY:" disk name and data.
	6.  Unable to allocate enough space for command and data I/O
	      buffers.  For privileged Indirect tasks, this means that the
	      task was not installed with a sufficient increment (/INC=nnn).
	      The system manager should remove and reinstall Indirect
      	      with a larger increment value or in a larger partition.
	      For nonprivileged Indirect, this means that the EXTEND
	      TASK directive failed to return sufficient space for INDIRECT
	      to allocate the buffers.
	7.  Initialization of allocated buffers failed.
	8.  Initialization of DATA file structures failed.
	9.  Allocation of FCS-11 buffers for data and command files failed
	10. Symbol table initialization failed.
	11. Initialization clean-up failed.
	12. Unable to obtain initial command line.
       >12. Error codes greater than 12. are returned by FMS-11 and
	      other initialization modules.
 
 Error number 6 (insufficient buffer space) is the only initialization error
 that should be encountered by the user. All other error codes of value 12
 or less should be reported via the SPR process to DIGITAL.
 
2 ADVANCED
 Several advanced techniques are described here for those users who have
 the need to create and maintain relatively sophisticated command procedure
 files.  This information can be obtained by typing
 
	HELP INDIRECT ADVANCED topic
 
 where "topic" is one of the following:
 
    EXSTRI  <EXSTRI> passing of return values from a nested command file
    CODE    Translation of <FILERR> codes to message strings
    OPTIONS Determining the system SYSGEN options
    SPEED   Cluster similar commands for speed increase in overlaid versions
    INDSYS  Use of system procedure libraries
    DUMP    Display of the Indirect local and global symbol tables
 
3 EXSTRI
 The <EXSTRI> "exit string" special symbol can be used to return more
 information from a nested command file than just an exit status in
 <EXSTAT>.  Global symbols are also available for this process but
 require preallocation and management of symbol names.  <EXSTRI>
 is set to null whenever Indirect waits for a task exit.  
3 CODE
 A canned library procedure has been provided to translate the error codes
 returned in the <FILERR> special symbol into "real" error message
 strings.  The calling sequence for this procedure is illustrated in the
 following example:
 
!	.;
 
!	.; Test for the presence of a user file
!	.;
!		.testfile userlog.dat
!		.if <filerr> = 1 .goto haveit
!		.sets filnam <filspc>
 
!		@LB:[1,2]INDSYS/LB:QIOERR '<filerr>'
!	;
 
!	; File access error on file "'filnam'", Error = '<EXSTRI>'
!	;
!		.goto exit
 
 The procedure QIOERR looks up the error code, whether it is an FCS-11
 error or an executive error, and returns the corresponding message string
 in the variable <EXSTRI>.  If the code is unknown or reserved for future
 allocation, the appropriate message is also returned.
 
 By examining the code in QIOERR, you can construct a reasonably
 optimal mechanism for displaying specific application error messages, 
 thereby removing them from the mainline application for speed enhancement.
 
3 OPTIONS
 A canned library procedure has been provided to allow a procedure to
 determine what the SYSGEN options were for the Executive of the currently 
 running system.  The options are those which would be utilized by a
 privileged task performing bit test instructions on the Executive location
 $FMASK.  You must refer to the Executive and SYSGEN code for fuller
 documentation of the use of $FMASK.  To illustrate the use of this
 procedure, assume you wanted to determine whether the current
 system has been SYSGENed with multiuser protection.  If the bit
 FE.MUP is set in Executive location $FMASK, then this condition is true.
 The following code fragment will serve to provide the required information:
 
!	.ENABLE SUBSTITUTION
!	@LB:[1,2]INDSYS/LB:INDSFN MUP
!	.SETL MLTUSR '<EXSTRI>'
 
 The procedure INDSFN returns in the exit string <EXSTRI> the constant
 <TRUE> or <FALSE>, according to the state of the FE.MUP bit.
 
 Warning: Do not attempt to break apart the INDSFN procedure. The definition
          of the $FMASK bits is subject to change from release to release.
 
3 SPEED
 Indirect is an interpretive language and as such suffers speed constraints,
 particularly for complex operations. There are several techniques that can
 be used to enhance the operational speed.  The techniques are:
 
 1. When possible, group similar commands.  If a series of .SET commands
    are needed, do not mix them with other commands.  Most commands are
    processed in an overlay.  If the required overlay is still in memory
    from processing the previous command, a disk read delay is not required.
 
    If a series of commands is to be conditionally executed, do not repeat the
    conditional in front of each line.  Cluster the commands into a block and
    precede the block with a single .IF command and a .GOTO command to skip
    the block.
 
 2. If Indirect is task-built with the large buffer FCS-11 (this is the
    RSX-11M-PLUS default), it will attempt to open the command input file 
    with the biggest buffer for which it has space.  This implies that if
    simultaneously  open .DATA files, which share the same buffer pool, can be
    minimized, command input from a file is enhanced.  The technique is to
    open files for .READ or .DATA commands in a serial fashion if the
    application permits it.
 
 3. Take advantage of the direct access labels.  When searching for a label
    as a target of a .GOTO or .GOSUB command, Indirect scans forward to the
    end of the file, rewinds, and searches forward again to the end before 
    giving up with a missing label error. If the label is known as a direct 
    access label, Indirect can position the file directly to the record 
    containing the label without any searching.
 
3 INDSYS
 The procedures supplied in the procedure library LB:[1,2]INDSYS.CLB are:
 
     INDCFG - Display the current build parameters for the running Indirect
	      task.
     INDDMP - Dump to the terminal the contents of the Indirect symbol
	      table.
     INDPRF - A sample procedure to fully parse file-name strings.
     INDSFN - Return system configuration information.
     INDVFY - Display the values of all the special symbols.
     QIOERR - Return a string expansion of the <FILERR> error codes.
     FMSDEM - RSX/FMS-11 demonstration (for RSX-11M-PLUS only).
     FMSERR - Define the FMS/RSX-11 V1.0 error and function codes.
     .INDEX - Display the index of procedures in the library.
 
3 DUMP
 A canned procedure has been provided to display on the terminal the contents
 of the local and global symbol tables. This procedure is called as follows:
 
!	@LB:[1,2]INDSYS/LB:INDDMP/LO output-option
 
 where the parameter "output-option" is one of the following:
 
	null   The symbol table is displayed on TI:.
	#n     The symbol table is output to channel #n, where the
	       caller has previously opened a file for output.
 
 The /LO switch allows the INDDMP procedure to have access to the 
 local symbols of the caller and subverts the normal masking operation of
 a file nest.
 
 The output display contains the symbol name, type, and value.
