User Tools

Site Tools


arealist_pro_v10_modified_command

AL_ModifyArrays

(areaRef:L; selector:L; row:L; count:L)

Parameter Type Description
→ areaRef longint Reference of AreaList Pro object on layout
→ selector longint Action to perform
→ row longint Position where insert or delete occurred or should occur
→ count integer Number of rows to insert or delete, starting at row

Insert or delete a number of rows (array elements) at the specified position, or inform AreaList Pro that a number of elements have been inserted or deleted.

Selector

  • 0 = count elements were inserted at row
  • 1 = insert count elements at row using INSERT IN ARRAY
  • 2 = count elements were deleted at row
  • 3 = delete count elements at row using DELETE FROM ARRAY

This value informs AreaList Pro that the arrays have been modified (selector = 0 or 2) or asks AreaList Pro to modify the arrays (selector = 1 or 3). All arrays contained in the area will be processed, including hidden columns if any.

AreaList Pro will adjust the cache and move the row and cell options (depending on the current values for ALP_Area_MoveRowOptions and ALP_Area_MoveCellOptions). Thus AL_ModifyArrays is especially useful if you want to insert or delete rows while keeping any options (e.g. formatting) that you may have set for specific rows or cells.

There is no need to update or refresh the area when calling this command. AreaList Pro will take care of the update.

Constants

constant value
AL Modify Insert info 0
AL Modify Insert action 1
AL Modify Delete info 2
AL Modify Delete action 3

New in version 10: use in field mode

As of version 10.0.1, AL_ModifyArrays can be used in field mode. This feature is usable on fields with selectors 0 (AL Modify Insert info) and 2 (AL Modify Delete info). It allows to keep the row/cell specific formatting when adding or removing one or several record(s) displayed as rows.

Example

One column (field), 3 rows, sorted, row 2 is red:

Add a record with 4D then sort, now row 2 is still red:

To avoid this:

AL_ModifyArrays (area;AL Modify Insert info;2;1) // inform AreaList Pro

Then you get this instead:

arealist_pro_v10_modified_command.txt · Last modified: 2018/02/19 12:39 by alp_admin