Functions.ADel Method (Array, Long, Long)
Deletes an element from a one-dimensional array, or a row or column from a two-dimensional array.
XSharp.VFP (in XSharp.VFP.dll) Version: 2.17
Syntax Request Example
ArrayName AS ARRAY,
nElementNumber AS LONG,
nDeleteType AS LONG
) AS DWORD
public static uint ADel(
- Type: Array
Specifies the array from which the element, row, or column is deleted.
- Type: Long
Specifies the number of the element, row, or column to delete from the array.
If the array is multidimensional, nElementNumber will specify the row.
You must include the optional 2 argument to delete a column from the array.
For more information on how to reference elements in an array, see DIMENSION Command.
- Type: Long
Deleting an element or row from an array doesn't change the size of the array;
instead, the trailing elements, rows, or columns are moved towards the start of
the array, and the last element, row, or column in the array is set to False (.F.).
If you delete a column, values of the elements in the deleted column are set to False (.F.),
but trailing elements are not moved.
If the element, row, or column is successfully deleted, 1 is returned.
The parameter to this function is a 'General Array'. The function decides at runtime if the array is a FoxPro array or a 'General' Array
2OPEN DATABASE (HOME(2) + 'Data\testdata')
4SELECT company FROM customer ;
5WHERE country = 'UK' ;
6INTO ARRAY gaCompanies
7gnCount = _TALLY
8gcName = 'Seven Seas Imports'
10DISPLAY MEMORY LIKE gaCompanies
11gnPos = ASCAN(gaCompanies, gcName)
12IF gnPos != 0
13* Company found, remove it from the array
14= ADEL(gaCompanies, gnPos)
15gnCount = gnCount - 1
17DISPLAY MEMORY LIKE gaCompanies