using BUILD.BAT in CMD-Box

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 794
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 111 times
Been thanked: 199 times

using BUILD.BAT in CMD-Box

Post by AUGE_OHR »

hi,

when using CMD-Box and BUILD.BAT it will include PATH for HMG

Code: Select all

SET PATH=%HMGPATH%\harbour\bin;%HMGPATH%\mingw\bin;%PATH%
this will be done every time i use it in CMD-Box ...

how to modify BUILD.BAT to SET PATH "once" ( check if already in PATH ) :idea:
have fun
Jimmy

trmpluym
Posts: 263
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 8 times
Been thanked: 34 times

Post by trmpluym »

path|find /i "%HMGPATH%\harbour\bin" >nul || set path=%HMGPATH%\harbour\bin;%path%
path|find /i "%HMGPATH%\mingw\bin" >nul || set path=%HMGPATH%\mingw\bin;%path%

User avatar
Anand
Posts: 478
Joined: Tue May 24, 2016 4:36 pm
DBs Used: DBF
Has thanked: 181 times
Been thanked: 65 times

Post by Anand »

trmpluym wrote:
Sat May 16, 2020 8:27 am
path|find /i "%HMGPATH%\harbour\bin" >nul || set path=%HMGPATH%\harbour\bin;%path%
path|find /i "%HMGPATH%\mingw\bin" >nul || set path=%HMGPATH%\mingw\bin;%path%
Never knew about this trick.
We learn each day !

Regards,

Anand
Image

User avatar
dragancesu
Posts: 762
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia
Has thanked: 28 times
Been thanked: 192 times

Post by dragancesu »

Just add c:\hmg.3.4.4 in PATH

control panel'-> system -> advanced system setting -> environment variables

in section system in PATH add hmgpath

User avatar
AUGE_OHR
Posts: 794
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 111 times
Been thanked: 199 times

Post by AUGE_OHR »

hi,
dragancesu wrote:
Sat May 16, 2020 12:03 pm
Just add c:\hmg.3.4.4 in PATH
thx

Code: Select all

rundll32.exe sysdm.cpl,EditEnvironmentVariables
it is not "only" HMG ... need it also for Extended Version or FiveWin when using *.BAT in CMD-Box
have fun
Jimmy

User avatar
AUGE_OHR
Posts: 794
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 111 times
Been thanked: 199 times

Post by AUGE_OHR »

hi,
trmpluym wrote:
Sat May 16, 2020 8:27 am
path|find /i "%HMGPATH%\harbour\bin" >nul || set path=%HMGPATH%\harbour\bin;%path%
path|find /i "%HMGPATH%\mingw\bin" >nul || set path=%HMGPATH%\mingw\bin;%path%
it is long time ago that i work with *.BAT Syntax.
how to write it with GOTO

Code: Select all

@echo off
IF EXIST %1 GOTO ERRORRAUS
// do something here
goto OKRAUS

:ERRORRAUS
CLS
ECHO.
ECHO Das File %1 existiert schon !!!

:OKRAUS
i like to "skip" Section of SET PATH when exist
have fun
Jimmy

trmpluym
Posts: 263
Joined: Tue Jul 15, 2014 6:52 pm
Location: The Netherlands
Has thanked: 8 times
Been thanked: 34 times

Post by trmpluym »

i like to "skip" Section of SET PATH when exist

Code: Select all

path|find /i "%HMGPATH%\harbour\bin" >nul || GOTO SETPATH

GOTO END

:SETPATH
set path=%HMGPATH%\harbour\bin;%path%

:END

User avatar
AUGE_OHR
Posts: 794
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany
Has thanked: 111 times
Been thanked: 199 times

Post by AUGE_OHR »

trmpluym wrote:
Sat May 16, 2020 6:27 pm
i like to "skip" Section of SET PATH when exist

Code: Select all

path|find /i "%HMGPATH%\harbour\bin" >nul || GOTO SETPATH
GOTO END

:SETPATH
set path=%HMGPATH%\harbour\bin;%path%

:END
thats it, THX
have fun
Jimmy

Post Reply