PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Passing a fixed array in parameter to a procedure
  • Declaring a fixed array member
  • Dimension of a fixed array
  • Fixed array of arrays, associative array, queue, stack, list
  • Limits: Elements of fixed array
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
A fixed array is an "advanced" type of array: the dimensions of this array are defined during the compilation and they cannot be modified.
The dimensions of a fixed array are defined during the compilation, only if the dimensions of this array correspond to:
  • an integer,
  • a constant that was created beforehand.
Otherwise, a WLanguage error occurs during the compilation of the project.
Reminder: An array is a structured type that is used to group a set of elements of the same type. Each array element can be directly accessed by its subscript.
We advise you to use:
  • A fixed array to pass an array in parameter to the Windows API functions.
  • A dynamic array or a "simple" array when the size of the array must be modified during the program execution.
  • An associative array to store the elements indexed on any type of information.
Versions 16 and later
Universal Windows 10 App This feature is available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This feature is available for the Windows Phone applications.
Universal Windows 10 App This feature is available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This feature is available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This feature is available for the iPhone/iPad applications.
iPhone/iPad This feature is available for the iPhone/iPad applications.
Versions 18 and later
Universal Windows 10 App This feature is available in Windows Store apps mode.
Android Widget This feature is available in Android Widget mode.
New in version 18
Universal Windows 10 App This feature is available in Windows Store apps mode.
Android Widget This feature is available in Android Widget mode.
Universal Windows 10 App This feature is available in Windows Store apps mode.
Android Widget This feature is available in Android Widget mode.
Versions 21 and later
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Apple Watch This feature is available in Apple Watch mode.
New in version 21
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Apple Watch This feature is available in Apple Watch mode.
Universal Windows 10 App This feature is available in Universal Windows 10 App mode.
Apple Watch This feature is available in Apple Watch mode.
Example
// Declare a fixed array
CustomerArray is fixed array of 5 by 7 by 3 int
// Equivalent to: CustomerArray is fixed array of 5,7,3 int
// Refer to a fixed array
CustomerArray[2,5,3] = 47
// Equivalent to: CustomerArray[2][5][3] = 47
Syntax
Versions 17 and later

Declaring a fixed array


<Array Name> is fixed array [ <Dimension 1> [,<Dimension 2> ... [,<Dimension 10>]] ] <Type of Array Elements>
Example:
arrString is fixed array [10] strings
arrInt is fixed array [5,9] int
New in version 17

Declaring a fixed array


<Array Name> is fixed array [ <Dimension 1> [,<Dimension 2> ... [,<Dimension 10>]] ] <Type of Array Elements>
Example:
arrString is fixed array [10] strings
arrInt is fixed array [5,9] int

Declaring a fixed array


<Array Name> is fixed array [ <Dimension 1> [,<Dimension 2> ... [,<Dimension 10>]] ] <Type of Array Elements>
Example:
arrString is fixed array [10] strings
arrInt is fixed array [5,9] int
<Array Name> is fixed array of <Dimension 1> [by <Dimension 2> ... [by <Dimension 10>]] <Type of Array Elements>

OR

<Array Name> is fixed array of <Dimension 1> [,<Dimension 2> ... [,<Dimension 10>]] <Type of Array Elements>
<Array Name>:
Name of the array variable to declare.
<Dimension 1>...<Dimension 10>:
Dimension 1 to 10 of the array (integer value).
<Type of Array Elements>:
Type of the elements found in the array. See the different types of variables.
Versions 20 and later
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App Note: The elements that make up the array can also be arrays, fixed arrays, associative arrays, queues, stacks or lists.
New in version 20
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App Note: The elements that make up the array can also be arrays, fixed arrays, associative arrays, queues, stacks or lists.
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App Note: The elements that make up the array can also be arrays, fixed arrays, associative arrays, queues, stacks or lists.
Note: The an keyword is optional: it is an optional word.

Referring to an element in a fixed one-dimensional array:

<Array Name>[Subscript1]

Referring to an element in a fixed two-dimensional array:

<Array Name>[Subscript1, Subscript2]

OR

<Array Name>[Subscript1][Subscript2]

Referring to an element in a fixed N-dimensional array:

<Array Name>[Subscript1, ... , SubscriptN]

OR

<Array Name>[Subscript1]...[SubscriptN]

Passing an array in parameter to a procedure: Hide the details

<Procedure Name>(<Array Name>)
<Array Name>:
Name of the fixed array to use.
<Subscript1>:
Subscript of the element for the 1st dimension.
<Subscript2>:
Subscript of the element for the 2nd dimension.
<SubscriptN>:
Subscript of the element for the Nth dimension (N <= 10).
Note: An array cannot be handled as a whole. For example, an array cannot be assigned to another array.
Remarks

Passing a fixed array in parameter to a procedure

A fixed array can be passed in parameter to a procedure. To do so, use the following syntax:
<Procedure Name>(<Array Name>)
For example:
SupplierArray is fixed array of 10 by 50 string
// Call to the DisplayArray procedure
DisplayArray(SupplierArray)

Declaring a fixed array member

A fixed array member can be declared in:
  • A class. This fixed array is directly allocated in the memory zone of this class.
  • A composite variable. This fixed array is directly allocated in the memory zone of this composite variable.
  • A structure <Structure Name>. This fixed array is directly allocated in the memory zone of each <Structure name> variable.
For example:
Struct is structure
        n1 is int
        nArray is fixed array of 2 int
        n2 is int
END
MyStructure is Struct
Representation of the memory zone of "MyStructure":
This memory representation is compatible with the Windows APIs. Therefore, a fixed-size array can be transmitted to a function of the Windows APIs.

Dimension of a fixed array

Dimension and ..Occurrence are used to find out the number of elements in a fixed array.
Reminder: A fixed array cannot be resized.
Versions 20 and later
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Fixed array of arrays, associative array, queue, stack, list

The following syntaxes are supported:
<variable> is fixed array of 5 arrays of int
<variable> is fixed array of 5 arrays of 5 int

<variable> is fixed array of 5 fixed arrays of 5 int

<variable> is fixed array of 5 associative arrays of int
<variable> is fixed array of 5 associative arrays (withDuplicates) of int
<variable> is fixed array of 5 associative arrays (withDuplicates,wlInt) of int

<variable> is fixed array of 5 queues of int

<variable> is fixed array of 5 stacks of int

<variable> is fixed array of 5 lists of int
New in version 20
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Fixed array of arrays, associative array, queue, stack, list

The following syntaxes are supported:
<variable> is fixed array of 5 arrays of int
<variable> is fixed array of 5 arrays of 5 int

<variable> is fixed array of 5 fixed arrays of 5 int

<variable> is fixed array of 5 associative arrays of int
<variable> is fixed array of 5 associative arrays (withDuplicates) of int
<variable> is fixed array of 5 associative arrays (withDuplicates,wlInt) of int

<variable> is fixed array of 5 queues of int

<variable> is fixed array of 5 stacks of int

<variable> is fixed array of 5 lists of int
WINDEVWEBDEV - Server codeWindowsLinuxiPhone/iPadApple WatchWindows MobileUniversal Windows 10 App

Fixed array of arrays, associative array, queue, stack, list

The following syntaxes are supported:
<variable> is fixed array of 5 arrays of int
<variable> is fixed array of 5 arrays of 5 int

<variable> is fixed array of 5 fixed arrays of 5 int

<variable> is fixed array of 5 associative arrays of int
<variable> is fixed array of 5 associative arrays (withDuplicates) of int
<variable> is fixed array of 5 associative arrays (withDuplicates,wlInt) of int

<variable> is fixed array of 5 queues of int

<variable> is fixed array of 5 stacks of int

<variable> is fixed array of 5 lists of int

Limits: Elements of fixed array

  • A fixed array can include classes only if these classes have a constructor without parameter (or with optional parameters).
  • A fixed array cannot include:
    • composite variables,
    • arrays.
  • A fixed array cannot be made of composite variables.
  • AndroidAndroid Widget JavaPHP A fixed array cannot be made of arrays.
  • Java You cannot create fixed arrays of classes or structures.
  • The size of a fixed array cannot exceed 2GB.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment