Skip to main content
Version: Next

OB Get type

OB Get type ( object ; property ) -> Function result

ParameterTypeDescription
objectObject🡒Structured object
propertyText🡒Property name
Function resultLongint🡐Property value type

Description

The OB Get type command returns the type of value associated with the property of the language object.

object must have been defined using the C_OBJECT command or designate a 4D object field.

In the property parameter, pass the label of the property whose type you want to find out.
Note that the property parameter is case sensitive.

The command returns a longint indicating the type of value. You can compare this value with the following constants, found in the "Field and Variable Types" theme:

ConstantTypeValue
Is BooleanLongint6
Is collectionLongint42
Is dateLongint4
Is nullLongint255
Is objectLongint38
Is realLongint1
Is textLongint2
Is undefinedLongint5

Note: For picture attributes, the command returns Is object.

Example

We want to get the type of standard values:

 var $ref : Object
 OB SET($ref;"name";"smith";"age";42)
 $type:=OB Get type($ref;"name") //$type returns 2
 $type2:=OB Get type($ref;"age") //$type2 returns 1

See also

OB GET PROPERTY NAMES
Value type