mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-01 13:50:36 +00:00
Merge pull request #19 from SteveMcNeill/main
Add option to menu to make temp files
This commit is contained in:
commit
f57d8a5222
|
@ -331,6 +331,7 @@ FUNCTION ide2 (ignore)
|
|||
m = m + 1: i = 0: RunMenuID = m
|
||||
menu$(m, i) = "Run": i = i + 1
|
||||
menu$(m, i) = "#Start F5": i = i + 1
|
||||
menu$(m, i) = "Run only (No exe)": i = i + 1
|
||||
menuDesc$(m, i - 1) = "Compiles current program and runs it"
|
||||
menu$(m, i) = "Modify #COMMAND$...": i = i + 1
|
||||
menuDesc$(m, i - 1) = "Sets string returned by COMMAND$ function"
|
||||
|
@ -1705,7 +1706,7 @@ FUNCTION ide2 (ignore)
|
|||
|
||||
LOCATE , , 0
|
||||
clearStatusWindow 0
|
||||
|
||||
If NoExeSaved then idecompiled = 0: GOTO mustGenerateExe
|
||||
IF idecompiled THEN
|
||||
|
||||
IF iderunmode = 2 AND _FILEEXISTS(lastBinaryGenerated$) THEN
|
||||
|
@ -5766,6 +5767,15 @@ FUNCTION ide2 (ignore)
|
|||
GOTO idemrun
|
||||
END IF
|
||||
|
||||
IF menu$(m, s) = "Run only (No exe)" THEN
|
||||
PCOPY 3, 0: SCREEN , , 3, 0
|
||||
NoExeSaved = -1
|
||||
startPaused = 0
|
||||
GOTO idemrun
|
||||
END IF
|
||||
|
||||
|
||||
|
||||
IF menu$(m, s) = "Modify #COMMAND$..." THEN
|
||||
PCOPY 2, 0
|
||||
ModifyCOMMAND$ = " " + ideinputbox$("Modify COMMAND$", "#Enter text for COMMAND$", _TRIM$(ModifyCOMMAND$), "", 60, 0, 0)
|
||||
|
|
|
@ -26,6 +26,8 @@ REDIM SHARED PL(1000) AS INTEGER 'Priority Level
|
|||
REDIM SHARED PP_TypeMod(0) AS STRING, PP_ConvertedMod(0) AS STRING 'Prepass Name Conversion variables.
|
||||
Set_OrderOfOperations
|
||||
|
||||
DIM SHARED NoExeSaved AS INTEGER
|
||||
|
||||
DIM SHARED vWatchOn, vWatchRecompileAttempts, vWatchDesiredState, vWatchErrorCall$
|
||||
DIM SHARED vWatchNewVariable$, vWatchVariableExclusions$
|
||||
vWatchErrorCall$ = "if (stop_program) {*__LONG_VWATCH_LINENUMBER=0; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);};if(new_error){bkp_new_error=new_error;new_error=0;*__LONG_VWATCH_LINENUMBER=-1; SUB_VWATCH((ptrszint*)vwatch_global_vars,(ptrszint*)vwatch_local_vars);new_error=bkp_new_error;};"
|
||||
|
@ -1060,7 +1062,37 @@ IF C = 9 THEN 'run
|
|||
|
||||
'execute program
|
||||
|
||||
|
||||
|
||||
|
||||
IF iderunmode = 1 THEN
|
||||
IF NoExeSaved THEN
|
||||
'This is the section which deals with if the user selected to run the program without
|
||||
'saving an EXE file to the disk.
|
||||
'We start off by first running the EXE, and then we delete it from the drive.
|
||||
'making it a temporary file when all is said and done.
|
||||
IF os$ = "WIN" THEN
|
||||
SHELL QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) + ModifyCOMMAND$ 'run the newly created program
|
||||
SHELL _HIDE _DONTWAIT "del " + QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) 'kill it
|
||||
END IF
|
||||
IF path.exe$ = "" THEN path.exe$ = "./"
|
||||
IF os$ = "LNX" THEN
|
||||
IF LEFT$(lastBinaryGenerated$, LEN(path.exe$)) = path.exe$ THEN
|
||||
SHELL QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
|
||||
SHELL _HIDE _DONTWAIT "del " + QuotedFilename$(lastBinaryGenerated$)
|
||||
ELSE
|
||||
SHELL QuotedFilename$(path.exe$ + lastBinaryGenerated$) + ModifyCOMMAND$
|
||||
SHELL _HIDE _DONTWAIT "del " + QuotedFilename$(path.exe$ + lastBinaryGenerated$)
|
||||
END IF
|
||||
END IF
|
||||
IF path.exe$ = "./" THEN path.exe$ = ""
|
||||
NoExeSaved = 0 'reset the flag for a temp EXE
|
||||
sendc$ = CHR$(6) 'ready
|
||||
GOTO sendcommand
|
||||
END IF
|
||||
|
||||
|
||||
|
||||
IF os$ = "WIN" THEN SHELL _DONTWAIT QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) + ModifyCOMMAND$
|
||||
IF path.exe$ = "" THEN path.exe$ = "./"
|
||||
IF os$ = "LNX" THEN
|
||||
|
@ -13267,8 +13299,6 @@ ELSE
|
|||
IF idemode = 0 AND NOT QuietMode THEN PRINT "Output: "; lastBinaryGenerated$
|
||||
END IF
|
||||
|
||||
|
||||
|
||||
Skip_Build:
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue