This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v20 R7
OB Keys
|
OB Keys ( object ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
object | Object |
![]() |
Object to return property names | |||||
Function result | Collection |
![]() |
Collection of property names (strings) | |||||
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.
You want a collection with all first-level property names of an object:
C_OBJECT($person)
C_COLLECTION($col)
$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"
Product: 4D
Theme: Objects (Language)
Number:
1719
Created: 4D v18 R3
4D Language Reference ( 4D v20 R7)