The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
End if
#7
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
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)