Home | Reviews | GUIpedia | Forum | Fun500


BrandonTo: The Walrus
I've also replaced COSTA.EXE (the part that stays in memory while running an external program, and launches the desktop again when the external program ends) with a batch program. This reduces the memory usage when running external programs by about 50 KB RAM, while providing the exact same functionality. Once I'm done fixing and optimizing things I'll focus on adding more features, specifically some more accessories.

How exactly does that batch file work? It would be useful for a project Kyle and I am talking about.
2010-06-1410:29 PM

TheWalrusRe:To: The Walrus
I'll post it here for you, so you can have a look at it.   @ECHO OFF
 
REM This batch file replaces COSTA.EXE from previous versions of the GUI.
REM Instead of having a resident program in memory, occupying about 60 KB
REM RAM, this version only has the batch program in memory, conserving
REM a lot of conventional RAM.
 
REM This is where the path to Costa is defined.
SET COSTA099=C:\COSTA
 
IF NOT EXIST %COSTA099%\COSTA099.EXE GOTO ExeNotFound
 
REM Make sure a mouse driver is loaded.
%COSTA099%\MOUSE.COM >NUL
 
REM Start by launching the desktop. The /BOOT parameter is simply there to
REM prevent the desktop from being launched outside of this batch program,
REM since it wouldn't function properly (it would just exit whenever a link
REM on the desktop was clicked)
%COSTA099%\COSTA099.EXE /BOOT
 
 
:LoopStart
 
REM If errorlevel set by COSTA099.exe is 2 the user wants to run a program
IF ERRORLEVEL = 2 GOTO RunBat
 
REM If errorlevel is 1 the user wants to exit.
IF ERRORLEVEL = 1 GOTO Exit
 
REM If we make it here no errorlevel has been set and we can return to the
REM desktop, as the reason the desktop ended is most likely a crash. The
REM /BOOT parameter is no longer neccesary, as Costa is already running.
%COSTA099%\COSTA099.EXE
GOTO LoopStart
 
 
:RunBat
REM Run the batch file, delete it and return to the top of the loop. The
REM reason COSTA099.EXE is executed here is to prevent the errorlevel from
REM the external program affecting the errorlevel check above.
CALL %COSTA099%\DATA\TEMP\RUN.BAT
DEL %COSTA099%\DATA\TEMP\RUN.BAT
%COSTA099%\COSTA099.EXE
GOTO LoopStart
 
:ExeNotFound
ECHO.
ECHO COSTA099.EXE was not found in %COSTA099%.
ECHO.
ECHO Run SETUP.EXE to fix this issue.
ECHO.
SET COSTA099=
GOTO EndOfBAT
 
:Exit
SET COSTA099=
CLS
ECHO Thank you for using The Costa Graphical Shell.
ECHO.
 
:EndOfBAT   Quite simple, quite effective.
2010-06-154:04 PM

agumaRe:To: The Walrus
or, you could create a batch file in the GUI right before you run an external app, for example "temp.bat" and then put "temp.bat" in the keyboard buffer and exit. Now it's at the DOS console and DOS checks the keyboard buffer, it's "temp.bat", so that's what it runs, as if you typed it yourself. then temp.bat runs the program, and when it's done, it runs your GUI. it would eliminate the need for a batch file at startup :) ha, and you guys thought i couldn't code 
2010-06-158:35 PM

TheWalrusRe:To: The Walrus
I did think of that actually, after I read it in some QB tutorial a while ago. The reason I chose the other approach is that I sometimes run Costa from within Windows 98, in which case the method you mentioned won't work. But if you're targeting plain DOS only, it would be a good way to do it.
2010-06-166:06 PM

BASIC Programming Help


2021 Brandon Cornell