5.4 CGIObjs

CGIObjs is a collection of CGIObj objects. CGIObjs represent the variables (such as text box, selection box, check box) on the FORM. Each variable is represented as a CGIObj containing the name and the value of that variable.

5.4.1 Count Property

Returns the number of CGIObj objects contained in the specified CGIObjs collection.

Syntax

 Object.Count
 

Type

Long.

Attributes

Read-only.

Remarks

The CGIObjs are also included in the EnvObj collection.

Example

This example retrieves the number of form fields contained in the specified collection and the data contained in the user name field.

 Set formvars=doc.formvars
 Print "Number of fields:"&formvars.count
 Print "User name:"&formvars.Item("user_name")
 

5.4.2 Item method

Returns the CGI object corresponding to the given index.

Syntax

 Object.Item (
  Index As Variant)
 

Parameters

Index
Index can be numeric or string value. In the case of a string it represents the field name.

Return values

CGIObj object.

Remarks

By default, Item method is called for CGIObjs collection.

Example

This example retrieves the number of form fields contained in the specified collection and the data contained in the user name field.

 Set formvars=doc.formvars
 Print "Number of fields:"&formvars.count
 Print "User name:"&formvars.Item("user_name")