Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to tell if an array is full

Status
Not open for further replies.

mjmnyr96

Programmer
Apr 25, 2006
7
US
I've noticed that if you try to use one of the built in functions, such as minval on an array that isnt full you get ???????? as a result. If I have a ten element array, how do I ask if element 10 is full? Thanks.
 
I lost my internet connection after posting this. I should mention that it is an array of reals.
 
If you know how many items you have put into the array, when the item count is equal to the size of the array, then it is full. You may not know how big an array is when it is passed into a function. In that case, you need to keep an item count and pass that item count into the called function.
 
Awesome, never thought of that as a way around it. Thanks a bunch.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top