ASK: Difference between revisions

From Smart Box
Jump to navigation Jump to search
(→‎Example: Improved the sample code by switching the lamp off after the delay)
 
Line 15: Line 15:
  SWITCH ON OUTPUT 1
  SWITCH ON OUTPUT 1
  WAIT reply
  WAIT reply
SWITCH OFF OUTPUT 1


== Associated keywords ==
== Associated keywords ==

Latest revision as of 00:53, 14 October 2023

Syntax[edit]

ASK S/N/T,"prompt string",variable

Description[edit]

This command is used to prompt user for a keyboard input. The user can type a string or number. The ASK command is followed by either S to indicate a string, N to indicate a numeric value or T for a time value. The prompt string can be up to 70 characters in length. The response from the user is placed into the variable specified at the end of the command.

Example[edit]

ASK N,"How long should the lamp be on for ?",reply
SWITCH ON OUTPUT 1
WAIT reply
SWITCH OFF OUTPUT 1

Associated keywords[edit]