Environment variables

 

Environment is a computer system in that the program is compiled or the application is run.

 

Environment variables are specific configurations that affect the way how programs behave at compilation and applications behave when they are run.

 

Lycia supports a considerable number of environment variables that can be roughly divided into 3 groups (these groups correspond to the chapters in this documentation):

 

General environment variables

are well-known environment variables used on most operation systems (e.g., compare here and here)

Lycia environment variables

are environment variables specific to Lycia.

They include environment variables that store paths to search for different files, affect look and feel of your applications, specify end-user display formats; are used for debugging purposes; etc.

Database environment variables

are environment variables used to establish and configure your database connection.

Applications connecting to a database use a database driver that, in its turn, uses a database client software. The database client software usually needs specific configuration that is accomplished by setting the necessary environment variables. Database client environment variables define information such as installation directory of the client software and localization settings.

 

There are several ways to configure your environment:

 

1

You can configure your compilation and runtime environments.

2

You can configure your environment on a project and a programs level.

3

You can configure your environment on the system level.

 

The table below show where you can configure your environment with Lycia:

 

 

 

 

Runtime environment

 

you compile applications with LyciaStudio

you compile applications from Lycia Command Line

 

Environment as a whole

env.properties

environ.bat

inet.env

4gl project

from the project properties in LyciaStudio

4gl program

from the program properties in LyciaStudio

fgl_setenv()

fgl_putent()

Current session

set ENV_VAR=value

export ENV_VAR=value

 

inet.env is far more flexible as it may seem: You can create several different versions of inet.env if you need - one each application server instance you use.

 

 

 

To set the environment as a whole, you change the corresponding configuration files - inet.env, env.properties, and environ.bat.

To configure the compilation and deployment environment of a 4gl project or a 4gl program, you specify the necessary variables in the Build environment variables page of the project's or the program's Properties.

 

To configure the environment for the current command line session, you execute the corresponding command in the command line:

 

set DBDATE=DMY2-

 

 

export DBDATE=DMY2-

 

These variables will be applied only until the end of the session. Once you relaunch the Lycia Command Line, all variables will be loaded from environ.bat.

 

You can also set environment variables in your OS system environment, but we do not recommend this unless you have a considerable experience of such modifications.

 

When setting environment variables, please pay attention to these details.

 

Folder separators depend on the operation system - \ (backslash) is used for Windows and / (slash) for Unix/Linux :

 

LYCIA_DIR=C:\Program Files\Querix\Lycia 3 Development Suite 7.1\Lycia

 

LYCIA_DIR=/opt/Querix/Lycia

 

Variable indications depend on the operation system - % is used for Windows and $ for Unix/Linux :

 

LYCIA_DRIVER_PATH=%LYCIA_DIR%\lib

 

LYCIA_DRIVER_PATH=$LYCIA_DIR/lib

 

Path separators depend on the operation system - ; (semicolon) is used for Windows and : (colon) for Unix/Linux :

 

CLASSPATH=%CLASSPATH%;$LYCIA_DIR\my_java

 

CLASSPATH=$CLASSPATH:$LYCIA_DIR/my_java

 

You can update and extend environment variables by adding new values to the already existing ones:

 

PATH=C:\Windows\System32;%PATH% or PATH=%PATH%;C:\Windows\System32

 

PATH=C:/Windows/System32:$PATH or PATH=$PATH:C:/Windows/System32

 

A . (full stop) - once added to the path value - indicates the current directory:

 

FGLIMAGEPATH=%FGLIMAGEPATH%;.;%LYCIA_DIR%\images