05-15-2014, 11:56 AM
boriel Wrote:An IF followed by a THEN in the same line will be a single line IF
An IF followed by a THEN and at least one command, all in the same (logical) line. Otherwise compatibility with current code would be broken, and both kinds of IF could not be mixed unless you switch on and off the option flag.
Code:
' Example of old and new IF structures in the same source,
' all of them with THEN.
#pragma short_if=TRUE ' ...or whatever name
IF PI THEN PRINT "PURE SINCLAIR BASIC IF":BORDER 1:PAPER 0:CLS
IF PI THEN
PRINT "MULTILINE IF":BEEP 3,3
END IF
if pi _
then _
print "This is a single-line IF from old sinclair code...":_
border 2: _
print "Sure!"
if pi then
print "This is modern multiline IF"
border 1
print "Sure!"
end if
Marcos Cruz
http://programandala.net
http://programandala.net