beautypg.com

How to wait with sleep, From command file to command file, Wait for user input – Gasboy CFN III Mgnr's Mnl V3.4 User Manual

Page 197

background image

MDE-4315 CFN Series CFN III Manager’s Manual for Windows NT · August 2004

Page 181

How to Use Terminal Input with Command Files

Making Your Own Commands

The example in action would look like this.

How to Wait with SLEEP

The SLEEP command causes the Site Controller to wait the specified number of seconds
before it executes the next command. For example, SLEEP 2 causes a wait of two seconds.

You can use SLEEP to display a message for a specified time before you go on to the next
command, or to give transactions a few seconds to stop after a STOP;I command.The
command below displays the date, then the time. The %D and %T in this example are
variables, which are explained later in this chapter.

From Command File to Command File

A command file contains one or more commands, which are executed sequentially; that is, the
command file executes its first command, then returns to itself and executes the second
command, etc.

However, a command file cannot call up another command file and then return to itself for
subsequent commands. Once the first command file has called up the second command file,
there is no way to return to the first command file.

Therefore, if you want to have a routine that involves two or more command files, have the
first command file finish all its commands then call the second command file, which, in turn,
will execute all its commands and then call a third command file, etc. (This procedure is
known as chaining files together.)

Wait for User Input

Sometimes you need to have a command file wait for input from the user before it continues
executing. For example, you may want to give a user time to read a message before
continuing. The command PAUSE or PAU displays its arguments and waits for the user to
enter a line of input. The program continues when the user presses ENTER.

P* TYPE SHIFT1.CMD

* load shift command
* takes one argument, the new shift number.
echo Loading shift %1
stop
load shift %1
run

P* SHIFT1 3

Loading shift 3
P*

P* TYPE TEST.CMD

ECHO;T %D
SLEEP 2
ECHO;T %T
SLEEP 2
P*

This manual is related to the following products: