BLOB to list

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0


BLOB to list (blob{; offset}) ListRef

ParameterTypeDescription
blobBLOBBLOB containing a hierarchical list
offsetNumberOffset within the BLOB (expressed in bytes)
New offset after reading
Function resultListRefReference to newly created list

Description

The BLOB to list command creates a new hierarchical list with the data stored within the BLOB blob at the byte offset (starting at zero) specified by offset and returns a List Reference number for that new list.

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

If you do not specify the optional offset parameter, the list data is read starting from the beginning of the BLOB. If you deal with a BLOB in which several variables or lists 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.

After the call, if the hierarchical list has been successfully created, 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 list and LIST TO BLOB use a 4D internal format for handling lists stored in BLOBs. As a benefit, you do not need to worry about byte swapping between platforms when using these two commands. In other words, a BLOB created on Windows using those two commands can be reused on Macintosh and vice-versa.

Example

In this example, the form method for a data entry form extracts a list from a BLOB field before the form appears on the screen, and stores it back to the BLOB field if the data entry is validated:

      ` [Things To Do];"Input" Form Method

   Case of 

      : (Form event=On Load)
         hList:=BLOB to list([Things To Do]Other Crazy Ideas)
         If (OK=0)
            hList:=New list
         End if 

      : (Form event=On Unload)
         CLEAR LIST(hList;*)

      : (bValidate=1)
             LIST TO BLOB(hList;[Things To Do]Other Crazy Ideas)

   End case 

See Also

LIST TO BLOB.

System Variables and Sets

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


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next