|
Post by md on Mar 23, 2024 20:32:59 GMT 1
UNIQUE.EXE is started using GO.BAT END 66 correctly executes :66 in GO.BAT, but UNIQUE.EXE does not terminate.
Call TerminatePgm(66) SUB TerminatePgm(ErrorLevel) END ErrorLevel 'program does not end, but goes to Main Menu PRINT "After End" 'this will appear later when program is ended. xx$ = INPUT$(1) END SUB
The program displays "After End" when UNIQUE.EXE is ended. It appears to be 1-Unique.exe executing (unless another copy is hidden?) Not sure if END errorlevel can be supported? Note: It has worked without VDOS for decades to end unique.exe, xcopy files using b.bat, and restart unique.exe.
Any help would be appreciated. I just noticed this and don't know if files are backed up correctly if unique.exe is still running.
------------------------------------------------------------------ go.bat :top unique.exe :66 cmd /c b.bat goto top
Using Microsoft BASIC 7.1 PDS 7.1 Professional Development System
|
|
|
Post by Jos on Mar 24, 2024 8:07:41 GMT 1
I’m no Basic programmer...
END ErrorLevel is supposed to exit the program unconditionally, so PRINT "After End" and xx$ = INPUT$(1) should never execute?
One would expect END ErrorLevel to call DOS API 4Ch, EXIT - Terminate with return code. The standard method to exit a DOS program, also used to get to “later when program is ended”.
It’s unclear to me how GO.BAT is supposed to stop. The :66 label isn’t referred to and so seemingly without purpose since it directly follows the line with unique.exe.
cmd /c b.bat will immediately return control to go.bat. To let vDos wait for b.bat to finish, you would have to use cmd WAIT/c b.bat. Though that doesn’t explain why PRINT "After End" is executed.
Jos
|
|
|
Post by md on Mar 24, 2024 12:38:57 GMT 1
Wait fixed it! Thank you
The program ends with another errorlevel. I just posted a snippet of GO.BAT
|
|
|
Post by md on Mar 24, 2024 15:01:15 GMT 1
WAIT prevents the executable from ending so decided to just let program end. User can wait for xcopy to finish and restart the program.
|
|