How to wait with sleep, From command file to command file, Wait for user input – Gasboy CFN III Manager Manual V3.6 User Manual
Page 203
[P:]* SHIFT1 3
↵
Loading shift 3
[P:]*
MDE-4871 CFN III Manager’s Manual for Windows® XP Embedded - Version 3.6 · August 2010
Page 19-5
Command File Commands
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.
[P:]* TYPE TEST.CMD
↵
ECHO;T %D
SLEEP 2
ECHO;T %T
SLEEP 2
[P:]*
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, and so on.
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 and so on (this procedure is
known as chaining files together).
Wait for User Input
Sometimes you require 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.
Like ECHO, the PAUSE command adds a new line to the line it prints. Use the A option
(PAUSE;A) to keep it from printing the new line.
You can use PAUSE with the I option (PAUSE;I) to store user input for use by the next
command that requires user input.