Vtech Power Zone Edge User Manual - Page 38

Flow control Commands

Page 38 highlights

close n close a device. print n print its inputs to the output stream. type n print its inputs on the screen, and the prompt appears after the last character printed. thing n output the value associated with the variable named in the input. pause temporarily halt the execution of a procedure. wait n insert a pause before the next instruction is run. The length of the pause is the input to WAIT times 1/30 of a second. readchar (rc) output the first character from the input stream. If no character is waiting to be read, READCHAR waits for input from the keyboard. readword (rw) output in the form of a word from the input stream. If no line is waiting to be read, READWORD waits for input from the keyboard. readlist (rl) output in the form of a list from the input stream. If no line is waiting to be read, READLIST waits for input from the keyboard. cleartext (ct) clear output window content. pots print the titles of all user-defined procedures. POTS stands for "Print Out Titles". erase (er) n remove the definition of its input from the workspace. The input to ERASE must be a procedure name. eraseall (erall) remove all procedures and variables from the workspace. 6. Flow control Commands if then [commands] The must result in a value of either TRUE or FALSE. If the is TRUE then the commands in [commands] are executed. if then [commands1] If is TRUE then the commands else [commands2] in [commands1] are executed. Otherwise the commands in [commands2] are executed. label This command marks a location in the program so execution of LOGO commands can be started or resumed at this point with a GO command. go must be a label defined elsewhere in the program with a LABEL command. The GO command causes command execution to jump to the location of the LABEL command with the corresponding . 30

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46

30
close
n
close a device.
print
n
print its inputs to the output stream.
type
n
print its inputs on the screen, and the prompt appears
after the last character printed.
thing
n
output the value associated with the variable named
in the input.
pause
temporarily halt the execution of a procedure.
wait
n
insert a pause before the next instruction is run. The
length of the pause is the input to
WAIT
times 1/30
of a second.
readchar
(
rc
)
output the first character from the input stream. If no
character is waiting to be read,
READCHAR
waits
for input from the keyboard.
readword
(
rw
)
output in the form of a word from the input stream.
If no line is waiting to be read,
READWORD
waits
for input from the keyboard.
readlist
(
rl
)
output in the form of a list from the input stream. If
no line is waiting to be read,
READLIST
waits for
input from the keyboard.
cleartext
(
ct
)
clear output window content.
pots
print the titles of all user-defined procedures.
POTS
stands for “Print Out Titles”.
erase
(
er
)
n
remove the definition of its input from the workspace.
The input to
ERASE
must be a procedure name.
eraseall
(
erall
)
remove all procedures and variables from the
workspace.
6. Flow control Commands
if
<condition>
then
[commands]
The <condition> must result in a value of either
TRUE
or
FALSE
. If the <condition> is
TRUE
then the commands
in [commands] are executed.
if
<condition>
then
[commands1]
If <condition> is
TRUE
then the commands
else
[commands2]
in [commands1] are executed. Otherwise the
commands in [commands2] are executed.
label
<label>
This command marks a location in the program so
execution of
LOGO
commands can be started or resumed
at this point with a
GO
command.
go
<label>
<label> must be a label defined elsewhere in the program
with a
LABEL
command. The
GO
command causes
command execution to jump to the location of the
LABEL
command with the corresponding <label>.