1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-06-29 11:40:38 +00:00

Detects if the last generated binary still exists at F5 or F11.

Closes #63
This commit is contained in:
FellippeHeitor 2018-09-30 19:27:05 -03:00
parent 53d3341ec3
commit bed68767e6
2 changed files with 20 additions and 11 deletions

View file

@ -1434,7 +1434,7 @@ FUNCTION ide2 (ignore)
IF idecompiled THEN IF idecompiled THEN
IF iderunmode = 2 THEN IF iderunmode = 2 AND _FILEEXISTS(lastBinaryGenerated$) THEN
LOCATE idewy - 3, 2 LOCATE idewy - 3, 2
IF os$ = "LNX" THEN IF os$ = "LNX" THEN
@ -1444,6 +1444,9 @@ FUNCTION ide2 (ignore)
END IF END IF
GOTO specialchar GOTO specialchar
ELSEIF _FILEEXISTS(lastBinaryGenerated$) = 0 THEN
idecompiled = 0
GOTO mustGenerateExe
END IF END IF
dummy = DarkenFGBG(1) dummy = DarkenFGBG(1)
@ -1452,6 +1455,7 @@ FUNCTION ide2 (ignore)
COLOR 15, 1 COLOR 15, 1
LOCATE idewy - 3, 2: PRINT "Starting program..."; LOCATE idewy - 3, 2: PRINT "Starting program...";
ELSE ELSE
mustGenerateExe:
dummy = DarkenFGBG(1) dummy = DarkenFGBG(1)
BkpIdeSystem = IdeSystem: IdeSystem = 2: GOSUB UpdateTitleOfMainWindow: IdeSystem = BkpIdeSystem BkpIdeSystem = IdeSystem: IdeSystem = 2: GOSUB UpdateTitleOfMainWindow: IdeSystem = BkpIdeSystem
COLOR 1, 7: LOCATE idewy - 4, (idewx - 8) / 2: PRINT " Status " COLOR 1, 7: LOCATE idewy - 4, (idewx - 8) / 2: PRINT " Status "

View file

@ -205,7 +205,7 @@ NEXT
DIM SHARED extension AS STRING DIM SHARED extension AS STRING
DIM SHARED path.exe$, path.source$ DIM SHARED path.exe$, path.source$, lastBinaryGenerated$
extension$ = ".exe" extension$ = ".exe"
IF os$ = "LNX" THEN extension$ = "" 'no extension under Linux IF os$ = "LNX" THEN extension$ = "" 'no extension under Linux
@ -1192,14 +1192,14 @@ IF C = 9 THEN 'run
'execute program 'execute program
IF iderunmode = 1 THEN IF iderunmode = 1 THEN
IF os$ = "WIN" THEN SHELL _DONTWAIT QuotedFilename$(CHR$(34) + path.exe$ + file$ + extension$ + CHR$(34)) + ModifyCOMMAND$ IF os$ = "WIN" THEN SHELL _DONTWAIT QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) + ModifyCOMMAND$
IF path.exe$ = "" THEN path.exe$ = "./" IF path.exe$ = "" THEN path.exe$ = "./"
IF os$ = "LNX" THEN SHELL _DONTWAIT QuotedFilename$(path.exe$ + file$ + extension$) + ModifyCOMMAND$ IF os$ = "LNX" THEN SHELL _DONTWAIT QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
IF path.exe$ = "./" THEN path.exe$ = "" IF path.exe$ = "./" THEN path.exe$ = ""
ELSE ELSE
IF os$ = "WIN" THEN SHELL QuotedFilename$(CHR$(34) + path.exe$ + file$ + extension$ + CHR$(34)) + ModifyCOMMAND$ IF os$ = "WIN" THEN SHELL QuotedFilename$(CHR$(34) + lastBinaryGenerated$ + CHR$(34)) + ModifyCOMMAND$
IF path.exe$ = "" THEN path.exe$ = "./" IF path.exe$ = "" THEN path.exe$ = "./"
IF os$ = "LNX" THEN SHELL QuotedFilename$(path.exe$ + file$ + extension$) + ModifyCOMMAND$ IF os$ = "LNX" THEN SHELL QuotedFilename$(lastBinaryGenerated$) + ModifyCOMMAND$
IF path.exe$ = "./" THEN path.exe$ = "" IF path.exe$ = "./" THEN path.exe$ = ""
DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ = ""
DO: LOOP UNTIL _KEYHIT = 0 DO: LOOP UNTIL _KEYHIT = 0
@ -5794,9 +5794,9 @@ DO
'Notice the ELSE with the SELECT CASE? Before this patch, commands like those were considered valid QB64 code. 'Notice the ELSE with the SELECT CASE? Before this patch, commands like those were considered valid QB64 code.
temp$ = UCASE$(LTRIM$(RTRIM$(wholeline))) temp$ = UCASE$(LTRIM$(RTRIM$(wholeline)))
'IF NoIDEMode THEN 'IF NoIDEMode THEN
DO WHILE INSTR(temp$, CHR$(9)) DO WHILE INSTR(temp$, CHR$(9))
ASC(temp$, INSTR(temp$, CHR$(9))) = 32 ASC(temp$, INSTR(temp$, CHR$(9))) = 32
LOOP LOOP
'END IF 'END IF
goodelse = 0 'a check to see if it's a good else goodelse = 0 'a check to see if it's a good else
IF LEFT$(temp$, 2) = "IF" THEN goodelse = -1: GOTO skipelsecheck 'If we have an IF, the else is probably good IF LEFT$(temp$, 2) = "IF" THEN goodelse = -1: GOTO skipelsecheck 'If we have an IF, the else is probably good
@ -12545,7 +12545,12 @@ END IF
IF No_C_Compile_Mode THEN compfailed = 0: GOTO No_C_Compile IF No_C_Compile_Mode THEN compfailed = 0: GOTO No_C_Compile
IF path.exe$ = "../../" OR path.exe$ = "..\..\" THEN path.exe$ = "" IF path.exe$ = "../../" OR path.exe$ = "..\..\" THEN path.exe$ = ""
IF _FILEEXISTS(path.exe$ + file$ + extension$) THEN compfailed = 0 ELSE compfailed = 1 'detect compilation failure IF _FILEEXISTS(path.exe$ + file$ + extension$) THEN
compfailed = 0
lastBinaryGenerated$ = path.exe$ + file$ + extension$
ELSE
compfailed = 1 'detect compilation failure
END IF
IF compfailed THEN IF compfailed THEN
IF idemode THEN IF idemode THEN
@ -12557,7 +12562,7 @@ IF compfailed THEN
PRINT "Check " + compilelog$ + " for details." PRINT "Check " + compilelog$ + " for details."
END IF END IF
ELSE ELSE
IF idemode = 0 THEN PRINT "OUTPUT: "; path.exe$ + file$ + extension$ IF idemode = 0 THEN PRINT "OUTPUT: "; lastBinaryGenerated$
END IF END IF