`prev Menu next`

EXECUTE (Original Enhancement)
EXECUTE statements (Original Enhancement)
`EXECUTE File_Name
EXECUTE File_Name WITH (expression，expression，･･･，expression)
EXECUTE NOWAIT File_Name
EXECUTE NOWAIT File_Name WITH (expression，expression，･･･，expression)
` In the above, File_Name is a string expression whose value is a file name.
(Meanings)
When an executable file is designated, that file shall be executed.
In such a case, if the EXECUTE statement has a WITH-clause, expressions shall be evaluated and given to the program as command-line parameters, with numbers converted to strings, and strings quoted.
Example.
`EXECUTE "c:\windows\notepad.exe" WITH ("C:\BASICw32\README.TXT")
`
When a file which has an extension for BASIC programs is designated , BASIC.EXE shall be launched to run the BASIC program. The values of expressions are passed to the PROGRAM statement as parameters.
When a file excluding the above is designated, it shall be opened using the file association. The values of expressions are passed as additional parameters.
If an EXECUTE statement has NOWAIT, the control goes to the next line immediately, otherwise the control waits for the finish.
The file designated by File_Name shall be searched in the directories in order of the current directory, the directory where BASIC.EXE lies, and the directories designated in the PASS environment variable of Windows.
An EXECUTE statement is able to launch BASIC.EXE to run a BASIC program.
In such a case, the BASIC program file name is written in the WITH-clause.
When the BASIC program has a PROGRAM statement, the parameters are written succeeding the file name in the WITH-clause.
The start-up parameter for BASIC.EXE is written preceding the BASIC program file name in the WITH-clause.
The arguments written in the WITH-clause are all punctuated by commas.
Example.
`EXECUTE "A:\ABC.BAS"
EXECUTE "BASIC.EXE" WITH("A:\ABC.BAS")
` The launched BASIC.EXE terminates after the execution of "A:\ABC.BAS".
`EXECUTE "BASIC.EXE" WITH("/OR","A:\ABC.BAS")
` The launched BASIC.EXE stands by after the execution of "A:\ABC.BAS".
`EXECUTE "BASIC.EXE" WITH("/NR","A:\ABC.BAS")
` The launched BASIC.EXE stands by after loading "A:\ABC.BAS".
`EXECUTE "A:\ABC.BAS" WITH(12, "Quiz")
EXECUTE "BASIC.EXE" WITH("A:\ABC.BAS" ,12, "Quiz")
` If ABC.BAS has a PROGRAM statement, that program shall be executed with 12 and "Quiz" substituted for the program parameters.
`EXECUTE NOWAIT "A:\ABC.BAS"
EXECUTE NOWAIT "BASIC.EXE" WITH("A:\ABC.BAS")
` The current program and "A:\ABC.BAS" are executed simultaneously.

＜Notice＞
The arguments in the WITH-clause are converted into character representations and supplemented to the command-line. Note that the length of a command-line has the upper limit that may not be plentiful due to the specification of Windows.