[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|              ADEL               |
+---------------------------------+
ADEL(<array>, <expN> [,2])

-----------------------------------
Deletes element, row or column from array.
Return value - Numeric
-----------------------------------

This function deletes an element from a one-dimensional array or a row
or column from a two-dimensional array.  Deleting an element, row or
column from an array does not change the size of the array - 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 a
logical false (.F.) value.

If the element, row or column is successfully deleted, 1 is returned.

<array>
        Name of array.

<expN>
        1-D array       element number
        2-D array       row number

2
        Indicates that <expN> is a column.

+---------------------------------+
|             Example             |
+---------------------------------+

*** SELECT or USE customer database ***
IF USED('customer')
        SELECT customer
ELSE
        USE LOCFILE('customer.dbf','DBF','Where is CUSTOMER.DBF?')
ENDIF

COUNT TO m.count

*** DIMENSION array large enough to hold all of the data ***
DIMENSION companies[m.count,1]

COPY TO ARRAY companies FIELD company  && Fill the array

m.name = 'DataTech Inc.'
m.pos  = ASCAN(companies, m.name)  && Search for company

IF m.pos != 0
        *** Company found, remove it from the array ***
        = ADEL(companies, m.pos)
        m.count = m.count - 1
ENDIF
DISPLAY MEMORY LIKE companies*

-----------------------------------

See Also:  ACOPY(), AELEMENT(), AINS(), ASCAN(), ASORT()

-----------------------------------

See Also: ACOPY() AELEMENT() AINS() ASCAN() ASORT()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson