CT AREA TO FIELD

4D - Documentation   Français   English   German   4D Chart, Command Theme List   4D Chart, Command Alphabetical List   Back   Previous   Next

version 1


CT AREA TO FIELD (area; scope; table; field{; saveOption})

ParameterTypeDescription
areaLongint4D Chart area
scopeLongintScope of the command
-2 = Document
-1 = All
0 = Selected objects
>0 = Object ID
tableIntegerTable number
fieldIntegerField number
saveOptionIntegerMethod of saving the contents of area
1 = Picture only
2 = Data only
3 = Picture and data
-1 = No change

Description

The CT AREA TO FIELD command copies the contents of area into the BLOB or Picture field specified by table and field.

CT AREA TO FIELD is useful when you want to store objects in a field of a related table or store only specific objects. CT AREA TO FIELD simply assigns the objects to field. The record in table must still be saved.

scope controls what is copied.

The optional saveOption parameter determines how the document in the 4D Chart area is saved.

If saveOption equals 1, only the picture (PICT) is saved. Objects can no longer be manipulated individually.

If saveOption equals 2, only the data concerning the objects in the 4D Chart area is saved. The image is later rebuilt using the information in the saved data. This save option is the quickest and uses the least amount of memory. If there is not enough memory for the save option chosen, a dialog box that allows you to choose another option appears.

If saveOption equals 3, both the picture and the internal data used to rebuild the image are saved. This is the normal way to save a document.

Example

This example creates a related record for an object in area.

      `Create a record to store the object
   CREATE RECORD ([Objects])   
      `Assign the relating value         
   [Objects]Key:=[Charts]Name
      `Get the object's ID            
   $Temp:=CT Get ID (Area;-1;3)   
      `Copy the object into the record      
   CT AREA TO FIELD (Area;$Temp;3;2;1)   
      `Save the record
   SAVE RECORD ([Objects])            

See Also

CT FIELD TO AREA.


4D - Documentation   Français   English   German   4D Chart, Command Theme List   4D Chart, Command Alphabetical List   Back   Previous   Next