Test an Array for existance before processing data

J

Jacob

I need to set up an If statement to test if an array exists and process a
block of code if it does, do nothing if it does not.

I have tried the following:

If arLocationHeir4 Then ....
- Fails with an object mismatch

If Not arLocationHeir4 = Null Then ....
- Also fails

I've tried a couple other things as well, but I cannot remember the exact
formatting of the code.

Any help would be appreciated.

Jacob
 
B

Bob Barrows

If IsArray(ar) then
on error resume next
x = ubound(ar)
if err <> 0 then
'no array
end if
else
'no array
end if

HTH,
Bob Barrows
 
E

Evertjan.

Jacob wrote on 07 jul 2003 in microsoft.public.inetserver.asp.general:
I need to set up an If statement to test if an array exists and process a
block of code if it does, do nothing if it does not.

Talking vbscript:

If TypeName(ArrayVar)<>"Empty" Then ...

NB: "Empty" is case sensitive
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top