Code archives/Miscellaneous/commandline compile (b3d/Bplus)

This code has been declared by its author to be Public Domain code.

Download source code

commandline compile (b3d/Bplus) by Dan2016
I guess this can be added to the Code archive.

Theese are 3 Windows commandline programs, with which you can run/debug/compile .bb files, without the need to open the blitzIDE.

Youll need to edit the blitzpath variable to the place, where you have installed blitzbasic.
On my pc, it is installed in c:\bb3d\ .

You can use them, for example, as:

1.From the Commandline.
2.In your favorite Text editor, (mine is Crimson editor), if it supports Running edited files with Commandline.
3.From your favorite File manager (Cubic explorer/FreeCommander XE) see 2.
4.Adding them to the registry (for .bb files)



p.s. If you use the b3dcompile.bat to compile a program, it will have the .bb.exe extension. (see 2nd edit note below)


Edit:
Story why did i wrote the batch files:

Few years ago, i had the path and the blitzpath entered to the Windows Environment Variables. Everything worked fine,
eg compiling/debugging/running from Crimson editor and other programs.
But then, i have downloaded a game, i think valkyrie strike(compiled exe), which suddenly refused to run, because of the missing user libs or something similar.
After searching for the sollution, (removed the 2 entries from the WeV,) the game worked fine, but now CED couldnt compile.
After few hours of experimenting with the commandline, i found the right parameters, which made all this work as intended.

Edit 5.6.2016
B3dCompile now generates filename.exe (untill now it was filename.bb.exe)

Here they are:

B3dRun.bat
@Echo Off
%~d1
cd %~dp1
set blitzpath=C:\BB3D\
set path=%blitzpath%bin\
"%blitzpath%bin\blitzcc.exe" "%1"
pause


B3dDebug.bat
@Echo Off
%~d1
cd %~dp1
set blitzpath=C:\BB3D\
set path=%blitzpath%bin\
"%blitzpath%bin\blitzcc.exe" -d "%1"
pause



B3dcompile.bat
@Echo Off
%~d1
cd %~dp1
set blitzpath=D:\BB3D\
set path=%blitzpath%bin\
"%blitzpath%bin\blitzcc.exe" -o "%~d1%~p1%~n1".exe "%1"
pause



Edit: moved the blitzpath before path, and added it to the set path, so now only blitzpath needs to be changed.
.
RuntimeError "This code is for Commandline, it is not intended to be run from BlitzBasic IDE." 

B3dRun.bat

@Echo Off
%~d1
cd %~dp1
set blitzpath=C:\BB3D\
set path=%blitzpath%bin\
"%blitzpath%bin\blitzcc.exe" "%1"
pause


B3dDebug.bat

@Echo Off
%~d1
cd %~dp1
set blitzpath=C:\BB3D\
set path=%blitzpath%bin\
"%blitzpath%bin\blitzcc.exe" -d "%1"
pause

B3dcompile.bat

@Echo Off
%~d1
cd %~dp1
set blitzpath=D:\BB3D\
set path=%blitzpath%bin\
"%blitzpath%bin\blitzcc.exe" -o "%~d1%~p1%~n1".exe "%1"
pause

Comments

Dan2016
Workarround to use the Batch files on files or paths which contain space (like c:\dos batch\test me.bb)

b3drun-path.bat
@Echo Off
REM Workarround for files/paths containing spaces (" ") 
%~d1
cd %~dp1
set blitzpath=D:\BB3D\
set path=%blitzpath%bin\
"%blitzpath%bin\blitzcc.exe" %1
pause


to call this, from ideal as external tool use:
b3drun-path.bat "%ActiveFile%"

from the registry you need to pass the parameter as "%1"
"b3drun-path.bat" "%1"



Code Archives Forum