4D v14.3OB Is defined |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
OB Is defined
|
OB Is defined ( object {; property} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
object | Object |
![]() |
Structured object | |||||
property | Text |
![]() |
If passed = property to check, if omitted = check object | |||||
Function result | Boolean |
![]() |
If property omitted: True if object is defined, otherwise False. If property passed: True if property is defined, otherwise False |
|||||
The OB Is defined command returns True if object or property is defined, and False otherwise.
object must have been created using the C_OBJECT command.
By default, if you omit the property parameter, the command checks whether the object is defined. An object is defined if its contents has been initialized.
Note: An object can be defined but empty. To find out if an object is undefined or empty, use the OB Is empty command.
If you pass the property parameter, the command checks whether this property exists in object. Note that the property parameter is case sensitive.
Syntax testing the initialization of an object:
Test for existence of a property:
C_OBJECT($ref)
OB SET($ref;"name";"smith";"age";42)
//...
If(OB Is defined($ref;"age"))
//...
End if
This test is equivalent to:
If(OB Get type($Object;"name")#Is undefined)
Product: 4D
Theme: Objects (Language)
Number:
1231
Created: 4D v14
4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)