You can just to this
myArray.length=0;

LIKE :

myarray         = new Array()
myarray[0]      = "a";
myarray[1]      = "b";
myarray[2]      = "c";
myarray[3]      = "d";

alert(myarray.length);
alert(myarray.toString());
myarray.length = 2;

alert(myarray.length);
alert(myarray.toString());

REGARDS

WG

> -----Original Message-----
> From: John McCosker [mailto:[EMAIL PROTECTED]]
> Sent: 16 January 2003 09:17
> To: CF-Talk
> Subject: deleting Javascript Arrays
>
>
> Hi!!
>
> I am trying to delete all entries in an array so it may be reused but I am
> finding it quite
> difficult, javascripts interpreter engine trys to deal with objects not
> occupying memeory,
> but it cannot be forced by javascript to do this.
>
> I tried setting a dummy array,
>
> xmlLog = new Array()
> dummy = new Array(0)
>
> then when I want to clear xmlLog I set it to dummy,
>
> xmlLog  = dummy,
>
> all items are cleared but the array still has the original number of
> elements
> only empty.
>
> I also tried xmlLog = new Array(0) which does the same thing,
>
> would anyone have any thoughts on this,
>
> respectfully,
>
> J
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to