QB64.com

QB64 is a modern extended BASIC programming language that retains QBasic/QuickBASIC 4.5 compatibility and compiles native binaries for Windows, Linux, and macOS.

RUN is a control flow statement that clears and restarts the program currently in memory or executes another specified program.

The multi-modular technique goes back to when QBasic and QuickBASIC had module size constraints. In QB64 it has been implemented so that that older code can still be compiled, though it is advisable to use single modules for a single project (not counting $INCLUDE libraries), for ease of sharing and also because the module size constraints no longer exist.

Syntax

RUN [{line_number filespec$}] [command_parameter(s)]

Parameter(s)

Usage

Example(s)

Shows how RUN can reference multiple line numbers in the main module code. No line number executes first code line.


PRINT " A", " B", " C", " D"
10 A = 1
20 B = 2
30 C = 3
40 D = 4
50 PRINT A, B, C, D
60 IF A = 0 THEN 70 ELSE RUN 20    'RUN clears all values
70 IF B = 0 THEN 80 ELSE RUN 30
80 IF C = 0 THEN 90 ELSE RUN 40
90 IF D = 0 THEN 100 ELSE RUN 50
100 PRINT
INPUT "Do you want to quit?(Y/N)", quit$
IF UCASE$(quit$) = "Y" THEN END ELSE RUN  'RUN without line number executes at first code line


A       B       C       D
1       2       3       4
0       2       3       4
0       0       3       4
0       0       0       4
0       0       0       0

Do you want to quit?(Y/N)_

See Also