ARRAY PICTURE

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 3


ARRAY PICTURE (arrayName; size{; size2})

ParameterTypeDescription
arrayNameArrayName of the array
sizeNumberNumber of elements in the array, or
Number of rows if size2 is specified
size2NumberNumber of columns in a two-dimensional array

Description

The ARRAY PICTURE command creates and/or resizes an array of Picture elements in memory.

The arrayName parameter is the name of the array.

The size parameter is the number of elements in the array.

The size2 parameter is optional; if size2 is specified, the command creates a two-dimensional array. In this case, size specifies the number of rows and size2 specifies the number of columns in each array. Each row in a two-dimensional array can be treated as both an element and an array. This means that while working with the first dimension of the array, you can use other array commands to insert and delete entire arrays in a two-dimensional array.

While applying ARRAY PICTURE to an existing array:

If you enlarge the array size, the existing elements are left unchanged, and the new elements are initialized to empty pictures. This means that Picture size applied to one of these elements will return 0.

If you reduce the array size, the last elements deleted from the array are lost.

Examples

1. This example creates a process array of 100 Picture elements:

   ARRAY PICTURE (agValues;100)

2. This example creates a local array of 100 rows of 50 Picture elements:

   ARRAY PICTURE ($agValues;100;50)

3. This example creates an interprocess array of Picture elements and loads each picture into one of the elements of the array. The array's size is equal to the number of 'PICT' resources available to the database. The array's resource name starts with "User Intf/":

   RESOURCE LIST("PICT";$aiResIDs;$asResNames)
   ARRAY PICTURE (<>agValues;Size of array($aiResIDs))
   $vlPictElem:=0
   For ($vlElem;1;Size of array(<>agValues))
      If ($asResNames="User Intf/@")
         $vlPictElem:=vlPictElem+1
         GET PICTURE RESOURCE("PICT";$aiResIDs{$vlElem};$vgPicture)
         <>agValues{$vlPictElem}:=$vgPicture
      End if
   End for
   ARRAY PICTURE (<>agValues;$vlPictElem)

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