SetEnv: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
m (moved SetEnv to SETENV)
No edit summary
Line 1: Line 1:
The '''SetEnv''' [[internal function]] and [[config]] are used to set session based [[environmental variables]] in [[Business Rules!]].
The '''SetEnv''' [[internal function]] and [[config]] are used to set session based [[environmental variables]] in [[Business Rules!]].


in a [[brconfig.sys]] file you can set a BR! environmental variable like
In a [[brconfig.sys]] file you can set a BR environmental variable as follows:


  SetEnv FIELD VALUE
  SetEnv FIELD VALUE


in a [[program]] you can set a BR! environmental variable like
In a [[program]] you can set a BR environmental variable as follows:


  SetEnv("FIELD","VALUE")  
  SetEnv("FIELD","VALUE")  


you can get the value of either windows environmental variables or BR! environmental variables in a program like
The value of either windows environmental variables or BR environmental variable may be accessed in a program as follows:


  Env$("FIELD")
  Env$("FIELD")


=====GUIMode=====
====GUIMode====


{{:GUIMode}}
{{:GUIMode}}


 
====Icon====
=====Icon=====


{{:Icon}}
{{:Icon}}


ENVIRONMENT VARIABLE SIMULATION
====Environment Variable Simulation====
 
The [[Env$]]( ) function, which is used to interrogate the BR environment, has been expanded to permit the simulation of setting an environment variable with configuration statements.
 
CONFIG SETENV  SIZE  '10 x 24'
 
This allows a program to use ENV$("[[Size]]") to retrieve the value "10 x 24", excluding the quotes. In the event SIZE was previously defined in the environment it will appear as set to the new value for the duration of the BR session.


SYSTEM SETENV( ) FUNCTION
The [[Env$]] function, which is used to interrogate the BR environment, has been expanded to permit the simulation of setting an environment variable with configuration statements. The ENV$ function is case insensitive.


The '''SetEnv''' [[internal function]] sets an environment variable similar to the above [[configuration statement]].  For example, SetEnv("SIZE","10 x 24") causes [[Env$]]("SIZE") to return the string "10 x 24".
CONFIG SETENV SIZE '10 x 24'


Additionally, SetEnv("[[SCRN_SIZE_POSN]]") - case insensitive - will save the current screen size and position for both the new console and the command console, provided they are not minimized to the task bar. The positions of any window that is minimized ([[graphical window]] or [[command console]]) will not be saved.
This allows a program to use ENV$("SIZE") to retrieve the value '10 x 24', excluding the quotes. In the event SIZE was previously defined in the environment it will appear as set to the new value for the duration of the BR session.


SYSTEM ENV$ VALUES
SetEnv("[[SCRN_SIZE_POSN]]") will save the current screen size and position for both the new console and the command console, provided they are not minimized to the task bar. The positions of any window that is minimized ([[graphical window]] or [[command console]]) will not be saved.


System ENV$ variables cannot be set or altered by CONFIG SETENV.
Operating System ENV$ variables cannot be set or altered by CONFIG SETENV.


See also: [[clipboard]]
See also: [[clipboard]]

Revision as of 11:37, 30 January 2012

The SetEnv internal function and config are used to set session based environmental variables in Business Rules!.

In a brconfig.sys file you can set a BR environmental variable as follows:

SetEnv FIELD VALUE

In a program you can set a BR environmental variable as follows:

SetEnv("FIELD","VALUE") 

The value of either windows environmental variables or BR environmental variable may be accessed in a program as follows:

Env$("FIELD")

GUIMode

There is a BR! provided GUIMode environmental variable (case insensitive). It's value is either ON or OFF depending on whether BR is in GUI mode.

x$=env$("GUIMode")

See also:

Env$ GUI Mode


Icon

The Icon environmental variable can be set during the execution of a program by use of SetEnv.

When the special Icon environmental variable is set it will change the icon which the business rules! application displays.

SetEnv("Icon","myicon.ico") sets the icon for the window and the taskbar to the icon specified by the second parameter (e.g. myicon).

00100 SetEnv('Icon','Myicon.ico')


Environment Variable Simulation

The Env$ function, which is used to interrogate the BR environment, has been expanded to permit the simulation of setting an environment variable with configuration statements. The ENV$ function is case insensitive.

CONFIG SETENV SIZE '10 x 24'

This allows a program to use ENV$("SIZE") to retrieve the value '10 x 24', excluding the quotes. In the event SIZE was previously defined in the environment it will appear as set to the new value for the duration of the BR session.

SetEnv("SCRN_SIZE_POSN") will save the current screen size and position for both the new console and the command console, provided they are not minimized to the task bar. The positions of any window that is minimized (graphical window or command console) will not be saved.

Operating System ENV$ variables cannot be set or altered by CONFIG SETENV.

See also: clipboard