Sign in to follow this  
Followers 0
MagnumXL

How many fields in an array?

5 posts in this topic

I honestly did search for an answer to this.

I know it should be simple and that the solution is probably staring me in the face.

I need to return the number of fields there are in an array as a variable.

Ultimately (where the need comes from) I need to know how many Fields (Columns) there are in an Access table. But i can already return the table in an array so either answer would really help me. Thank you in advance.

Share this post


Link to post
Share on other sites



$Array_Count = UBound($array)

see help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Awesome, thank you! I guess i dont feel too bad now. Whats the logic behind calling this "UBound"?

Share this post


Link to post
Share on other sites

Welcome!

and ...I dont know why!

maybe, if you are going to use ubound() you might want to use ubound() -1

Remember that the value returned by UBound is one greater than the index of an array's last element!

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0