5.6 EnvObjs

EnvObjs is a collection of web server environment variables. Each variable is represented as a CGIObj containing the name-value pair of the specified variable.

5.6.1 Count property

Returns the number of Envobj objects contained in the specified EnvObjs collection.

Syntax

 Object.Count
 

Type

Long.

Attributes

Read-only.

Remarks

By default, Item method will be called for EnvObjs collection.

Example

This example retrieves the number of variables and the HTTP_REFERER environment variable.

 Set envvars=doc.envvars
 Print "Total number of environment variables"&envvar.count
 Print "This customer is directed
 from"&envvar.item("HTTP_REFERER")
 

5.6.2 Item method

Returns the EnvObj object corresponding to the given index.

Syntax

 Object.Item (
 index As Variant)
 

Parameters

Index
Index can be String or Numeric value. In the case of a string it represents the field name of the EnvObj object.

Return values

CGIObj

Remarks

By default, Item method is called for EnvObjs collection.

Example

This example retrieves the number of variables and the HTTP_REFERER environment variable.

 Set envvars=doc.envvars
 Print "Total number of environment variables"&envvar.count
 Print "This customer is directed
 from"&envvar.item("HTTP_REFERER")