Page 1 of 1

Getting values of environment variables

Posted: 31 Aug 2014 14:26
by Ferenc Nagy
Hi,
What is the counterpart of the envsymbol predicate of version 5.2 in the personal edition of version 7.4?

envsymbol

Posted: 1 Sep 2014 9:22
by CalmoSoft
Hi Ferenc,

Look at the 5xVIP/5xPlatformSupport/platformsupport5x/envsymbol/2.
envsymbol : (
string EnvId,
string SymbolStr)
determ (i,o).

Reads the value of an environment symbol.

Description

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.

Regards,
Gal Zsolt
(~ CalmoSoft ~)

Posted: 1 Sep 2014 10:16
by Thomas Linder Puls
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
by Ferenc Nagy
No problem. I can check existence of the environment variables in batch command files

Code: Select all

@echo Start of conpic.bat @echo Batch conversion of the given graphical file(s) @echo parameters @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.
@if "%irfan_view%" == "" goto err1

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. @goto fin :same pause File %1 has not been converted because input and output files are the same. @goto fin :err2 pause Conversion has failed because of "%irfan_view%\i_view32.exe" error. @goto fin
:err1
pause Conversion has failed because the environment variable "irfan_view" is undefined.

Code: Select all

:fin @echo End of conpic.bat