473,322 Members | 1,719 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,322 software developers and data experts.

array - how do you get the number of dimensions?

I want to check that an array passed in has a certain number of
dimensions - is there a way to check for this in framework 1.1 ?

Feb 15 '06 #1
11 2695
Almost everybody in this newsgroup is using VB6 or lower. While you may get
a stray answer to VB.NET (including VB2003 and VB2005 which has dropped .NET
from its name) questions here, you should ask them in newsgroups devoted
exclusively to .NET programming (the languages are different enough to
warrant separate newsgroup support). Look for newsgroups with either the
word "dotnet" or "vsnet" in their name.

For the microsoft news server, try these newsgroups for Visual Basic .NET
related questions...

microsoft.public.dotnet.languages.vb
microsoft.public.dotnet.languages.vb.upgrade
microsoft.public.dotnet.languages.vb.controls
microsoft.public.dotnet.languages.vb.data

And these for more general .NET questions

microsoft.public.dotnet.general
microsoft.public.vsnet.general

Note: There are many other .NET newgroups (use the first three "fields" from
the last two as templates when searching for them), but the above ones
should get you started.

Rick

"Mad Scientist Jr" <us*************@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I want to check that an array passed in has a certain number of
dimensions - is there a way to check for this in framework 1.1 ?

Feb 15 '06 #2
Almost everybody in this newsgroup is using VB6 or lower. While you may get
a stray answer to VB.NET / VB2003 / VB2005 questions here, you should ask
them in newsgroups
devoted exclusively to .NET programming. Look for newsgroups with either the
word "dotnet" or "vsnet" in their name.

For the microsoft news server, try these newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general
--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Mad Scientist Jr" <us*************@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I want to check that an array passed in has a certain number of
dimensions - is there a way to check for this in framework 1.1 ?

Feb 15 '06 #3
> I want to check that an array passed in has a certain number of
dimensions - is there a way to check for this in framework 1.1 ?


Http://EDais.mvps.org/DotNet/
Hope this helps,

Mike
- Microsoft Visual Basic MVP -
E-Mail: ED***@mvps.org
WWW: Http://EDais.mvps.org/
Feb 15 '06 #4
Hi,

Array.Rank property will give you the no. of dimensions.

BTW, I think he did post to the dotnet Newsgroup too.

Regards,

Cerebrus.

"Mad Scientist Jr" <us*************@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I want to check that an array passed in has a certain number of
dimensions - is there a way to check for this in framework 1.1 ?

Feb 15 '06 #5
That's strange, this posting *IS* to
microsoft.public.dotnet.languages.vb

I am using Google newsgroups
http://groups.google.com

maybe it is mistakenly posting and displaying one group as another?
Almost everybody in this newsgroup is using VB6 or lower.
For the microsoft news server, try these newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general

Feb 15 '06 #6
Mad Scientist Jr--

Did you mean that you want to know the allocated size of the array, or
how many values you have put into the array? Also,what type of array
is it: is it an arrayList member or just something like String()?

If it is like an arrayList, then you can just access the property:
arrayList.items.count.

if it is an array like string() then you have two ways to tell. You
can either use:
1) arrayName.length()
The method arrayName.length() will give you the number of elements
available in your array -> the size created. For example if you did :
redim arrayName(9)
then arrayName.length() would return 10.

or

2) UBound(arrayName).
This method returns the upperbound number for your array. For example
if you did:
redim arrayName(9)
then UBound(arrayName) would return 9.

As far as I know, there is not a way to determine from the array the
actual number of elements YOU put into the array declared like
string(), because when you give it an actual size, there is a default
value that is always inserted, so every item actually has a value.

Hope that this helps.
--mhos

Feb 15 '06 #7
"Mad Scientist Jr" <us*************@yahoo.com> schrieb
I want to check that an array passed in has a certain number of
dimensions - is there a way to check for this in framework 1.1 ?


Check it's Rank property. Usually this is only necessary if the type of the
parameter is 'Array', not integer() or integer(,) which implicitly
determines the number of dimensions.
Armin

Feb 15 '06 #8
Mea culpa.

I just noticed it was crossposted

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--
"Mad Scientist Jr" <us*************@yahoo.com> wrote in message
news:11*********************@g43g2000cwa.googlegro ups.com...
That's strange, this posting *IS* to
microsoft.public.dotnet.languages.vb

I am using Google newsgroups
http://groups.google.com

maybe it is mistakenly posting and displaying one group as another?
Almost everybody in this newsgroup is using VB6 or lower.
For the microsoft news server, try these newsgroups...

microsoft.public.dotnet.general
microsoft.public.dotnet.languages.vb
microsoft.public.vsnet.general

Feb 15 '06 #9
Yes, rank was what I was looking for.

PS I am posting thru the google newsgroups site (groups.google.com),
and it is saying that this group is
microsoft.public.dotnet.languages.vb - i'm looking at it on my screen
right now.
Go to groups.google.com and search for "array - how do you get the
number of dimensions?" and you'll see the group name... so don't blame
me, blame the goog! It is not my intention to clog up the wrong groups
with irrelevant posts

: )

Feb 15 '06 #10
> That's strange, this posting *IS* to
microsoft.public.dotnet.languages.vb

I am using Google newsgroups
http://groups.google.com

maybe it is mistakenly posting and displaying one group as another?


I didn't notice the cross-post when I replied (as did others) to your
message. For future reference, the flurry of "wrong group" messages you got
is because you included microsoft.public.vb.general.discussion as one of
your groups. That group IS only meant to be only for the classic versions of
VB.

Rick
Feb 15 '06 #11
Just for completeness, and to compound the cross-posting issue (<grin>),
here's some VB-classic info on the same requirement:

The recommended approach is covered in knowledge-base article 152288:
http://support.microsoft.com/?id=152288

However, you can also look directly at the SafeArray descriptor, taking
account of whether it's provided via a Variant, and whether it's a static or
dynamic array (descriptor at different Variant offsets):
http://www.devx.com/vb2themax/Tip/18265

Tony Proctor
"Mad Scientist Jr" <us*************@yahoo.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
I want to check that an array passed in has a certain number of
dimensions - is there a way to check for this in framework 1.1 ?

Feb 16 '06 #12

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

Similar topics

1
by: zoidberg | last post by:
Hello, I have an Array that looks like this: Array ( => Array ( => Number 1 => 3
3
by: Ohmu | last post by:
Hi! How to pass an (multidimensional)array of something to a function with reference/pointer? Can anyone help me with that? Thanks, Ohmu
9
by: Tom | last post by:
Hi, I am new in programming (and certainly in C++). I want to creat a five-dimensional array. Two dimensions are numbers and other three are variable. One of the variables is an array whose...
1
by: Sam | last post by:
Hello all I have a two dimensional array (the dimensions are not known) that needs to be passed to fortran from c++, allocate the dimensions of the array in fortran code, do some filling up of...
4
by: Ovid | last post by:
Hi all, I'm having a problem trying to create a 2D array whose dimensions are determined at runtime. Below my signoff is a minimal test case that hopefully demonstrates what I'm trying to do. ...
2
by: Salman Khilji | last post by:
After reading all the FAQs, I cannot solve the following problem: I have a pointer of type double. I am supposed to 1) Allocate memory for it assuming that the pointer will be pointing to a...
2
by: louis | last post by:
I often read a recordset (ADO) into a variant array so that the array can contain text, currency, boolean, etc. VB.Net does not allow variants and the object type gives errors during conversion...
1
by: The Man with no name | last post by:
Hi, Can we create an array of user defined dimensions in the following way:? 1 Create a class( say CONSTANT) whose lone datamember is an integer which is called say num. 2 In the public section...
9
by: Grey Alien | last post by:
If I have a struct declared as : struct A { double x ; char name; struct Other other ; void * ptr ; };
3
by: Thomas Bruckner | last post by:
Hello, I've looked online for an implementation of a multidimensional packed bit array (like BitArray but with more than one dimension), and could not find any, so I'm trying to create my own....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.