4D v13.4

ARRAY STRING

Home

 
4D v13.4
ARRAY STRING

ARRAY STRING 


 

ARRAY STRING ( strLen ; arrayName ; size {; size2} )  
Parameter Type   Description
strLen  Longint in Length of string (1... 255)
arrayName  Array in Name of the array
size  Longint in Number of elements in the array or Number of rows if size2 is specified
size2  Longint in Number of columns in a two-dimensional array

The ARRAY STRING command creates and/or resizes an array of String elements in memory.

Compatibility Note: Databases created beginning with version 11 of 4D are executed by default in Unicode mode (see the ASCII Codes section). In this mode, the functioning of the ARRAY STRING command is strictly identical to that of the ARRAY TEXT command (the strLen parameter is ignored). It is recommended to use ARRAY TEXT in new developments. The ARRAY STRING command is kept only for reasons of compatibility.

  • The strLen parameter specifies the maximum number of characters that can be contained in each array element in a string array. The length can be from 1 to 255 characters.
    Note:
    This parameter is taken into account only when the database is executed in non-Unicode mode. In Unicode mode, it is ignored (see above Compatibility Note).
  • 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 STRING to an existing array:

  • If you enlarge the array size, the existing elements are left unchanged, and the new elements are initialized to "" (empty string).
  • If you reduce the array size, the last elements deleted from the array are lost.

This example creates a process array of 100 31-character String elements:

 ARRAY STRING(31;asValues;100)

This example creates a local array of 100 rows of 50 63-character String elements:

 ARRAY STRING(63;$asValues;100;50)

This example creates an interprocess array of 50 255-character String elements and sets each element to the value “Element #” followed by its element number:

 ARRAY STRING(255;◊asValues;50)
 For($vlElem;1;50)
    ◊asValues{$vlElem}:="Element #"+String($vlElem)
 End for

 
PROPERTIES 

Product: 4D
Theme: Arrays
Number: 218

This command is deprecated and should not be used anymore

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D v11 SQL

 
SEE ALSO 

ARRAY TEXT