4D v16.3

BLOB TO VARIABLE

Home

 
4D v16.3
BLOB TO VARIABLE

BLOB TO VARIABLE 


 

BLOB TO VARIABLE ( blob ; variable {; offset} ) 
Parameter Type   Description
blob  BLOB in BLOB containing 4D variables
variable  Variable in Variable to write with BLOB contents
offset  Longint in Position of variable within BLOB
in Position of following variable within BLOB

The BLOB TO VARIABLE command rewrites the variable variable with the data stored within the BLOB blob at the byte offset (starting at zero) specified by offset.

The BLOB data must be consistent with the destination variable. Typically, you will use BLOBs that you previously filled out using the command VARIABLE TO BLOB.

If you do not specify the optional offset parameter, the variable data is read starting from the beginning of the BLOB. If you deal with a BLOB in which several variables have been stored, you must pass the offset parameter and, in addition, you must pass a numeric variable. Before the call, set this numeric variable to the appropriate offset. After the call, that same numeric variable returns the offset of the next variable stored within the BLOB.

Note: BLOB TO VARIABLE supports object variables of the C_OBJECT type. For more information, refer to the VARIABLE TO BLOB command.

After the call, if the variable has been successfully rewritten, the OK variable is set to 1. If the operation could not be performed, the OK variable is set to 0; for example, if there was not enough memory.

Note regarding Platform Independence: BLOB TO VARIABLE and VARIABLE TO BLOB use a 4D internal format for handling variables stored in BLOBs. As a benefit, you do not need to worry about byte swapping between platforms while using these two commands. In other words, a BLOB created on Windows using either of these commands can be reused on Macintosh, and vice-versa.

Example  

See the examples for the VARIABLE TO BLOB command.

The OK variable is set to 1 if the variable has been successfully rewritten, otherwise it is set to 0.



See also 

VARIABLE TO BLOB

 
PROPERTIES 

Product: 4D
Theme: BLOB
Number: 533

The OK variable is changed by the commandThis command can be run in preemptive processes

 
HISTORY 

Created: 4D v6
Modified: 4D v14

 
TAGS 

Variable, Byteswapping

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)