"Un-dim" Array 
Author Message
 "Un-dim" Array

Hi there,

is there any way to "un-dim" a formerly dimensioned dynamic array (that
means: put it in the state that it was in before the first redim)?

Thanks in advance,
Timo



Wed, 20 Oct 2004 02:25:25 GMT  
 "Un-dim" Array


Quote:
> Hi there,

> is there any way to "un-dim" a formerly dimensioned dynamic array
(that
> means: put it in the state that it was in before the first redim)?

Maybe Erase does what you want.
--
jb

(replace y with x to reply)



Wed, 20 Oct 2004 01:28:44 GMT  
 "Un-dim" Array

Quote:

> is there any way to "un-dim" a formerly dimensioned dynamic array
> (that means: put it in the state that it was in before the first redim)?

MyArray = Array()

"Array(arglist)
The required arglist argument is a comma-delimited list of values that are
assigned to the elements of the array contained within the Variant. If no
arguments are specified, an array of zero length is created."

Eq.

--

Equinox Tetrachloride
www.cl4.org - www.insecurities.org



Wed, 20 Oct 2004 01:35:52 GMT  
 "Un-dim" Array
On Fri, 03 May 2002 19:25:25 +0100, Timo Gransch

Quote:

>Hi there,

>is there any way to "un-dim" a formerly dimensioned dynamic array (that
>means: put it in the state that it was in before the first redim)?

You have to use the UnDim function..
Just kidding. ;-)

Erase will kill the array dead, like it was never ReDimmed.
ReDim myArray(0) is just as good in most cases.

Regards, Frank



Wed, 20 Oct 2004 01:47:26 GMT  
 "Un-dim" Array
Erase.

Tom Shelton


Quote:
> Hi there,

> is there any way to "un-dim" a formerly dimensioned dynamic array (that
> means: put it in the state that it was in before the first redim)?

> Thanks in advance,
> Timo



Wed, 20 Oct 2004 02:41:00 GMT  
 "Un-dim" Array

Quote:

> Hi there,

> is there any way to "un-dim" a formerly dimensioned dynamic array (that
> means: put it in the state that it was in before the first redim)?

I'm trying to be prescient here, but if you're asking what I <think>
you're asking, "no".

If you're asking if you can recover the previous array <including> its
data, that's a "no".  You can save the dimensions in temporary variables
and use them to ReDim the array back to where it was but if it had been
modified in any way, the data are not recoverable.
Here I'm really guessing--you've ReDim'ed to a smaller size with
"Preserve" and now want the original, full size back?  Afraid only way
is to save a temporary copy of the data in that case.



Wed, 20 Oct 2004 03:20:44 GMT  
 "Un-dim" Array
simple but effective:   arraytoempty = split("", ",")


Quote:
> Hi there,

> is there any way to "un-dim" a formerly dimensioned dynamic array (that
> means: put it in the state that it was in before the first redim)?

> Thanks in advance,
> Timo



Thu, 21 Oct 2004 22:58:14 GMT  
 "Un-dim" Array

Quote:

> simple but effective:   arraytoempty = split("", ",")

This might also work in VB6:  MyArray = Array()

--
Joe Foster <mailto:jlfoster%40znet.com>   Space Cooties! <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Fri, 22 Oct 2004 11:02:44 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. dynamically dim a variable ie dim "variable"&n

2. AJOUTER UN "FIELD"

3. "late" DIM statements

4. PROB with "dim as new ADODB...."

5. Problem with "Dim as Field"

6. PROB with "dim as new ADODB...."

7. What is "Dim X%"?

8. PROB with "dim as new ADODB...."

9. Problem with "Dim as Field"

10. VB7 and "Dim WebPublic"

11. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

12. "Global db as database" vs Local "dim db as database"

 

 
Powered by phpBB® Forum Software