SELECT

SELECT E

EVALUATES THE EXPRESSION E AND EXECUTES AFTER THE CASE STATEMENT WHICH MATCHES THE VALUE

  • Type: Command
  • Parameter: 1
  • Group: Structures

ACTION

The command is a part of the structure SELECT/CASE/END_SELECT, and is used to define the expression E to be evaluated.

The evaluation of the expression E gives a value as result, and the statements after the CASE Which matches The value are executed.

If no CASE matches with the value, the statements following END_SELECT are executed.

SYNTAX: SELECT E

  • E: arithmetical expression.

USE

  • SELECT is used, associated with CASE and END_SELECTL, to execute one command or a group of commands depending on the value given by an expression.

ERROR

  • If E is not a correct arithmetical expression.
  • If there is no END_SELECT after SELECT.
  • If 2 values of CASE are the same.

EXAMPLE

dim v

v=5

select v

case 1:print "V is 1"

case 5:print "V is 5"

case 8:print "V is 8"

end_select

SEE ALSO

CASE

END_SELECT