Page 1 of 1
Getting values of environment variables
Posted: 31 Aug 2014 14:26
What is the counterpart of the envsymbol predicate of version 5.2 in the personal edition of version 7.4?
Posted: 1 Sep 2014 9:22
Look at the 5xVIP/5xPlatformSupport/platformsupport5x/envsymbol/2
envsymbol : (
Reads the value of an environment symbol.
The envsymbol predicate searches for a symbol EnvId in the applications environment table.
If found, the value will be returned in SymbolStr; otherwise the predicate fails.
Preferably use environment::getVariable.
(~ CalmoSoft ~)
Posted: 1 Sep 2014 10:16
There is no environment support in the Personal Edition, only the Commercial Edition have environment support.
In the Commercial Edition the predicates to use are in the environment class.
The classes in 5xVip should only be used as "temporary migration support" for 5x projects, new code should never be based on these packages.
Workaround: check environment varaibales in batch command files
Posted: 1 Sep 2014 17:35
No problem. I can check existence of the environment variables in batch command files
@if "%irfan_view%" == "" goto err1
Code: Select all
@echo Start of conpic.bat
@echo Batch conversion of the given graphical file(s)
@echo #1 input filename/mask = %1
@echo #2 output filename/mask = %2
@echo The batch file needs the environment variable
@echo irfan_view showing the path to i_view32.exe.
Code: Select all
@if "%1" == "%2" goto same
@"%irfan_view%\i_view32.exe" "%1" /convert="%2" /cmdexit
@if errorlevel 1 goto err2
pause File %1 has been successfully converted to %2.
pause File %1 has not been converted because input and output files are the same.
pause Conversion has failed because of "%irfan_view%\i_view32.exe" error.
pause Conversion has failed because the environment variable "irfan_view" is undefined.