4D v16.3OB Get |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
OB Get
OB Get
The OB Get command returns the current value of the property of the object, optionally converted into the type specified. object must have been defined using the C_OBJECT command or designate a 4D object field. Note: This command supports attribute definitions in 4D Write Pro objects, like the WP GET ATTRIBUTES command (see example 9). However, unlike WP GET ATTRIBUTES, OB Get does not allow you to handle a picture variable or field directly as an attribute value. In the property parameter, pass the label of the property to be read. Note that the property parameter is case sensitive. By default, 4D returns the value of the property in its original type. You can "force" the typing of the value returned using the optional type parameter. To do this, in type you pass one of the following constants found in the Field and Variable Types theme:
The command returns the value of the property. Several types of data are supported. Note that:
Retrieving a text type value: C_OBJECT($ref) Retrieving a real number value converted into a longint: OB SET($ref ;"age";42) Retrieving the values of an object: C_OBJECT($ref1;$ref2) Modifying the age of an employee twice: C_OBJECT($ref_john;$ref_jim) Deserializing a date string formatted in ISO: C_OBJECT($object) Using nested objects: C_OBJECT($ref1;$child;$children) Recovery in 4D of a time stored in an object: C_OBJECT($obj_o) Examples of working with 4D object fields: // Define a value In the method of a form containing a 4D Write Pro area, you can write: If(Form event=On Validate) You can also read custom attributes of the documents: vAttrib:=OB Get([MyDocuments]My4DWP;"myatt_Last edition by")
See also
|
PROPERTIES
Product: 4D HISTORY
Created: 4D v14 ARTICLE USAGE
4D Language Reference ( 4D v16) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||