|
||||
|
|
||||
|
PC Access for Windows Reference Guidefor PC Access Version 4.30![]() ![]() ![]()
Script Command: onFormat: on "string" {sub-command}; The on script command causes PC Access to monitor data arriving from the host for the sequence of characters that make up the trigger "string". The trigger "string" may contain wildcards. The on command is special in that it continually monitors the incoming data even when other script commands are executing. This on monitoring occurs for each script command in the block with the same label. Once your script begins executing a statement in a block with a different label, monitoring ends for all on commands in the previous block. · The on command does not stop PC Access from executing the script. Processing continues with the next statement. If processing "falls through" to the next block, any on commands in the previous block become inactive. If you want PC Access to stop executing a script temporarily and wait for one of the on commands in a block to trigger, place the idle command in the block after all of the on commands. If you only want to wait for one trigger "string", use the wait command instead as it is more concise. If the "string" you specified arrives from the host, the on command immediately processes the sub-command following the "string". The sub-command can be any valid script command except for another on command, a wait, command, or a match command. When the sub-command executes, it takes priority over any other script command currently executing, including a wait command. Example: // Would send a return if the host sent the string "PRESS ENTER" on "PRESS ENTER" send "^M"; // Would perform a goto to the labeled block called NEXT_BLOCK // if the word "Welcome" is seen on "Welcome" goto NEXT_BLOCK;
![]() ![]() ![]()
| |||