Hi All,

How to remove all the elements in an array?

Sam.

Re: How to remove all element from an array? by Fred

Fred
Sat Jun 28 23:50:55 CDT 2003

You can set the entire array to a single value with:

array_name = ""

If you mean to release the entire array from being defined:

RELEASE array_name


--

Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.



Sam wrote:
> Hi All,
>
> How to remove all the elements in an array?
>
> Sam.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003



How to remove all element from an array? by Doron

Doron
Sat Jun 28 23:59:58 CDT 2003

Hi Sam,

I assume you want to keep the array and just remove all elements form it. If
that is the case then you may want to resize it.

DECLARE aMyArray[1]
aMyArray[1]=.F.

Regards,

Doron

The Farber Consulting Group, Inc.

The Creator of VisualRep - Report and Query Engine
http://www.dfarber.com/VRep.htm






"Sam" <sami_hung@canada.com> wrote in message
news:17bc01c33df8$cd0cd5a0$a601280a@phx.gbl...
> Hi All,
>
> How to remove all the elements in an array?
>
> Sam.



Re: How to remove all element from an array? by Jack

Jack
Sun Jun 29 22:15:32 CDT 2003

In article <17bc01c33df8$cd0cd5a0$a601280a@phx.gbl>,
sami_hung@canada.com says...
> Hi All,
>
> How to remove all the elements in an array?
>
> Sam.
>

You can't remove all of the elements. You can resize it to the smallest
possible size by:

DIMENSION ax[1]

and you can set all elements of the array to a fixed value by:

ax = <some value>

Re: How to remove all element from an array? by Jack

Jack
Mon Jun 30 12:24:25 CDT 2003

In article <#Ado8uwPDHA.1552@TK2MSFTNGP10.phx.gbl>,
cindy.winegarden@mvps.org says...
> Jack,
>
> Check out the ADEL() function, which goes back at least to FPW2.6 -
>
> ADEL( )
> Deletes an element from a one-dimensional array, or a row or column from a
> two-dimensional array.
>
> ADEL(ArrayName, nElementNumber [, 2])

That won't help with the original question, which was how to remove all
elements from an array since ADEL doesn't redimension the array.