473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Test an Array for existance before processing data

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
Jul 19 '05 #1
2 5544
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

Jacob wrote:
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

Jul 19 '05 #2
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

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Patrick Dunford | last post by:
PHP allows control arrays in forms e.g. this is a counter editing script echo "<input name=\"counterdelname\" type=\"hidden\" value=\""; echo "<input name=\"countername\" type=\"hidden\"...
4
by: LRW | last post by:
I'm not even sure this is possible, and if it is, I'm having a hard time focusing on a function that would make it work. What I have is a dynamically generated form with dozens of rows from a...
3
by: jdemello | last post by:
When using a multidimensional associative array to cross-reference data in a second, single-dimensional array, PHP stops processing data after a few iterations. Memory usage according to the task...
4
by: Michael Trosen | last post by:
Hi Everyone, I hope someone can help, I'm pretty new to pro*c programming. I have the following application setup: a pro*c program calls a stored procedure and recieves a cursor back: the...
5
by: Larry L | last post by:
I want to play a repetitive sound, and have a user click on a button each time it plays (say 5-10 times) and measure how far off he is from the sound each time. The only way I know to play a...
4
by: lyndon hughey | last post by:
I'm having a problem setting the testing for the existance of a nodes outerxml property. Below I try to test for the existance before I access the property, but I receive a null exception error. ...
12
by: jamie | last post by:
I wish to create an array that points to, say, the middle section of a different array. eg Original array > second array-------------^ Is this at all possible?? I think that it...
8
by: killkolor | last post by:
hi! I have a unittest framework that tests a single function that in turn works with files (takes input and outputs in the same file, no return values). In the unittest class I assign a member...
22
by: Voodoo Jai | last post by:
I have a page the uses a form to pass a postcode to another page and I want to test it against an SQL Injection. What would be a safe (i.e NO DELETING of data ) statement to try and how would I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.