Skip to main content
Version: 20 R7 BETA

OB Keys

OB Keys ( object ) -> Function result

ParameterTypeDescription
objectObjectObject to return property names
Function resultCollectionCollection of property names (strings)

This command is not thread-safe, it cannot be used in preemptive code.

Description

The OB Keys command returns a collection of strings containing all of the enumerable property names of the object.

Only first-level property names are returned (property names of sub-objects are not returned). The order of names within the returned collection follows the definition order of the properties.

Example

You want a collection with all first-level property names of an object:

 var $person : Object
 var $col : Collection
 
 $person:=New object
 $person.lastName:="Smith"
 $person.firstName:="Jenny"
 $person.children:=New object("Mary";12;"Mark";8)
 
 $col:=OB Keys($person)
 
  //$col[0]="lastName"
  //$col[1]="firstName"
  //$col[2]="children"

See also

OB Entries
OB Values