Environment variables

The following environment variables are used by Sculptor:

LOGNAME

The user logon name (returned by the Sculptor variable sys.UserName). This is standard on many UNIX systems and can be set on Windows systems if required.

PATH

The standard operating system path search list. This must include the directory $SCULPTOR/bin. Note that despite the introduction of registry variables for 32-bit Windows versions of Sculptor (see below), the environment variable PATH still defines which software is invoked from the MS-DOS command interpreter. If PATH causes a different version of Sculptor to be executed from that defined as Current Version in the registry, erroneous operation can occur.

SAGEDATA 1

This variable is ignored if SCDATA is defined. Otherwise, it is prepended at run time to the name of any file declared in a Sculptor screen form program, unless the file name begins with “\” or “/”, or contains an embedded “:”.

SCDATA 1

A prefix which is, if defined, prepended at run time to the name of any file declared in a Sculptor screen form program, unless the file name contains an embedded “:”, which is taken to indicate a remote pathname over a network or an absolute pathname on MS-DOS.

SCEXRATES

The pathname of the exchange rates file for use with the Sculptor multicurrency feature. See Multicurrency.

SCLOCALBIN

On a client, specifies the directory in which a downloaded program should be stored. If it is not set the directory $SCULPTOR/app is used. See Loading a Sculptor program from a server.

SCLOGDIR 1

Specifies the directory in which the Sculptor transaction log file _sclog is to be written. Defaults to $SCULPTOR/recover.

SCMASTER

Defines the master Sculptor directory on a server. See Loading a Sculptor program from a server

SCMASTERBIN

Defines the Sculptor program directory on a server. If set, over-rides $SCMASTER/app. See Loading a Sculptor program from a server

SCTERMW

The name of the terminal parameter file to be used by screen form programs.

SCTEXT

The default extension for configurable text files. If undefined, the default is .eng.

SCULPTOR 1

The pathname of the standard Sculptor directory.

SC_CHDIR

When due the web server configuration the nph-srep execution starts in the wrong directory this variable can be used to specify a directory to change previous the report program execution.

SC_CONSERVE_MEMORY

Destroy and create bitmaps for tables as needed. If this is not set, Sculptor keeps a bitmap permanently allocated for each table. This feature is provided for use when several large programs run concurrently and the physical memory pool is being exhausted, causing swapping. Typically, this will only be an issue in a terminal server environment such as Citrix. Note that if SC_CONSERVE_MEMORY is set, screen drawing is slower.

To use SC_CONSERVE_MEMORY, set its value to 1. Sculptor does not currently check the value, but in the future the value 0 may be interpreted as false.

SC_DEBUG_LOCKS

If set on a server, informs kfserver and local Sculptor programs that the debug record lock tool is running.

TTYNO

May be used on an MS-DOS system to define a terminal number. If set on UNIX, over-rides the system tty number.

USERID

If defined with a numerical value on an MS-DOS system, this value is returned by the Sculptor system variable sys.UserID, which is otherwise zero on such systems.

1(1,2,3,4)

These variables can have the main Sculptor version number 2, 5 or 6 appended, e.g. SCULPTOR6, SAGEDATA2. Such variables take precedence over the non version-specific equivalents. For example, Sculptor Version 5 will look for SCDATA5 before SCDATA. This makes it easier to run Sculptor 2, Sculptor 5 and Sculptor 6 on the same system. A Sculptor 2 update that supports this feature is available. Since Sculptor version 6.0.1 the environment variables SCULPTOR6, SCDATA6, SAGEDATA6, SCLOGDIR6 take precedence over the same names with a 5 suffix, which take precedence over the non-version equivalents.

Note

Since Sculptor version 6.0.0 the TRACE_NPH_SREP environment variable is not supported.

Environment variables may be used in the definition of pathnames within a Sculptor program, as in these examples:

!file Mine "$MYDIR/$MYSUBDIR/myfile"
image = "$SCULPTOR/images/myimage"

Environment variables can be set at run time by means of the putenv() function and retrieved by the getenv() function.

Note

Throughout this manual the traditional form, $variable_name, is used when referring to environment variables. This is the only form accepted by the Sculptor compiler in pathnames. The equivalent under Windows/MS-DOS is %variable_name%; this form cannot be used within the Sculptor language.


Storing variables in the registry

In Sculptor version 4.2 and later, the values above can be stored in the Windows registry (or, on other platforms, an emulation of this registry). The scconfig program is used to set values in the registry. Registry entries may be used wherever environment variables were previously used in Sculptor, without any change to the program code.

The environment variable corresponding to a registry entry can still be defined, and if defined takes precedence over the registry value. However, it is recommended that the environment is only used for temporary changes during development.


RELATED TOPICS

nph-srep environment variables