END

END


ELSE Index Level END CASE
Syntax END
Category BASIC
Type Statement
Description indicates both the end of a series of statements executed conditionally from a "then" or "else" condition or the physical end of the program.

The "end" statement is used in two ways:

1) physical program end (optional)
.......statements.......
.....body of program....
.......statements.......
end

The trailing "end" statement is not required on FlashBASIC source code, but is helpful for program readability. Any statements after the "end" statement (in this case) are not compiled.

2) Multi-line then/else statements must have terminating "end" statements:

if logical.expression then
 statement
 .
end
Options
See Also THEN THEN | ELSE statement.block STOP ABORT
Example 10 *
input ans
if ans='n' then
print 'Please retype ':
goto 10
end

This example reprompts for "ans" if the previous "ans" is "n".

open 'md' to md else
print 'Cannot open file'
stop
end
crt 'File opened'

If the "md" file does not exist, a warning message is printed and program execution stops.  Notice that "stop" is the FlashBASIC runtime directive which indicates the termination of runtime.  The "end" statement indicates the end of the multiple line "then" statement.  Without the "stop", program execution continues with the next statement after the "end" statement.
Warnings
Compatibility D3 7.0 AP R83
ELSE Index Level END CASE