One Question. How do I compile and run the program from the IDE?
Hi JaViS , thanks for your comment.
Well it's easy, I'm explain you.
Resumed, it's a simple batch file that comunicates the code and the binary files of bennuGD.
You need to do the next:
1.
Create a batch file (In my case I called it compile.bat) on the same path of your game code (each game use her own batch file). For example, you game calls "Tetris" and the
main.prg file is located on
C:\Code\Tetris\ . Put this .bat file in the same folder that your main.prg
2.
Get the path of your BennuGD bin folder, in my case
C:\BennuGD\bin\3. Edit the .bat file like this:
@echo off
set "mainPath=C:\Code\Tetris\"
set "bennuPath=C:\BennuGD\bin\"
set "mainFile=main"
set "extension=.prg"
if exist %bennuPath%stderr.txt del %bennuPath%stderr.txt
if exist %bennuPath%stdout.txt del %bennuPath%stdout.txt
if exist %mainPath%*.dcb del %mainPath%*.dcb
pushd %mainPath%
%bennuPath%bgdc.exe %mainPath%%mainFile%%extension%
if exist %bennuPath%stdout.txt del %bennuPath%stdout.txt
if exist %bennuPath%stderr.txt del %bennuPath%stderr.txt
if exist %bennuPath%stderr.txt goto salida
%bennuPath%bgdi.exe %mainPath%%mainFile%
if exist %mainPath%stderr.txt type %mainPath%stderr.txt
:salida
pause
If you need it (or someone) you can download a copy of my .bat file
hereThis file get the main paths and the main file of your code. Next, send at the compiler
bgdc.exe the main.prg file and then, run the game compiled with
bgdi.exeHow execute this on Visual Studio Code?1. Go into your Visual Studio Code and the folder of your game code (C:\Code\Tetris)
2. Doble click on main.prg (now you see the file at the right)
3. Go to menu
View > Open debug console and at the
botton of your vsc appears a new window. Then, in this window click on
Terminal and you will see something like windows command line (it's the same, you can use the commands of cmd like dir, cls, xcopy, etc)
4. This terminal
must has your game folder as currect folder.
5. Now,
you can write compile.bat here in the terminal, press enter and the code it's executed and any error o something response of the compiler writes here.
