Jump to content
Sign in to follow this  
MagnumXL

How many fields in an array?

Recommended Posts

MagnumXL

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
Valuater

$Array_Count = UBound($array)

see help

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
MagnumXL

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
Valuater

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.