Environment Variables and Global Signals

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Environment Variables and Global Signals >

Environment Variables and Global Signals

EVG. - Environment Variable Get

Previous Top Next


MiniRobotLanguage (MRL)

 

EVG. Command

Environment Variable Get

 

 

Intention

 

Reads Environment Variables and return their values. Depending on parameters these can be from the local or from the global Environment variables table.

 

If you specify a numbered parameter P1, then you can get the Environment variable with that number. Example:

 

EVG.#3

STS.DUMP

 

the result on theTOS (Top of stack) will look like this:

 

graphic

 

of course it can look different on your computer, as you may have other environment variables.

 

The global Environment table is been read from (32-bit) registry:

 

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

 

 

 

Syntax

 

 

EVG.[P1][|P2][|P3]

 

 

Parameter Explanation

 

P1 - (in) is taken as name for the environment-variable to get.

  Result is placed on TOS (top on stack). You can specify a "#(num)Parameter to get the Entry with that number.

"#(num)" will only work with the local table. Trying "#(num)" with the global table will result in an error.

 

P2 - (out) Result is placed in variable, if given.

 

P3 - Options

 e - (expand) will expand environment variable.

 g - (gobal) reads String from global Environment-table

     instead from local Application Table.

 n - (noexpand) will not expand the result.

 t - (table)  reads String from local Application Table

     instead of from global Environment-table

 

* Expand means %path(something)% is replaced with the real physical path.

 

In case there is no Parameter, TOS is taken as Name for the Environment-Variable to get.

Result is placed on TOS.

 

 

 

Example

 

'**********************************************

' EVG./EVS. - Sample

'**********************************************

'DBM.2

' Get %SystemRoot%

EVG.SYSTEMROOT|§§VAR

PRT.Systemroot=>§§VAR

PRT.===========================================

' EVS. without opt writes a global Environment variable

EVS.MyVar|MyValue

EVG.MyVar|§§RES|g

PRT.§§RES

PRT.===========================================

' EVS. with opt t writes a local Environment variable

EVS.MyVar|MyValue|t

EVG.MyVar|§§RES

PRT.§§RES

PRT.===========================================

DMP.4

 

 

:over

MBX.Halt to read output

'**********************************************

 

 

 

Remarks

 

-

 

 

Limitations:

 

The option to get Environment entries by their number "#(num)" will only work with the local table. Trying "#(num)" with the global table will result in an error.

 

The global environment table is read from 32-bit registry.

 

 

See also:

 

    EVE. - Environment Variable Expand

    EVS. - Environment-Variable-Set