setEnvironmentVar (NotesSession - JavaScript)

Sets the value of a string or numeric environment variable.

Defined in

NotesSession

Syntax

setEnvironmentVar(vname:string, value:any) : void

setEnvironmentVar(vname:string, value:any, issystem:boolean) : void

Parameter Description
vname The name of the environment variable to set.
value The value of the environment variable. Date values are converted to strings.
boolean If true, no dollar sign character is prefixed to the variable name. If false or omitted, a dollar sign is prefixed.

Usage

If the environment variable already exists, it is assigned the new value. Otherwise, a new environment variable is added to the notes.ini (or Notes® Preferences) file.

This method prefixes a dollar sign character ($) to the name before setting the value of the environment variable, unless you specify issystem as true or have already included a dollar sign as the first character of the name. When you examine the environment variable in the notes.ini (or Notes® Preferences) file, you see the dollar sign character. When retrieving environment variables with getEnvironmentString (NotesSession - JavaScript) or getEnvironmentValue (NotesSession - JavaScript), you have the option of including or omitting the dollar sign from the variable name.

Examples

This button sets a non-system environment variable.
session.setEnvironmentVar("HomeTown", "Tokyo")
This button sets the value of a system environment variable.
session.setEnvironmentVar("PANEL_SIZE_XY", 414, true)