Home > Archive > Programming with dBASE > October 2005 > Counting rows in an Array









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Counting rows in an Array
Hans

2005-10-24, 8:24 pm

In the beginning om my program I declare a number of arrays. Later in a procedure I need to count the number of "rows" i the erlier declared array. How to to that?

Hans
Roland Wingerter

2005-10-24, 8:24 pm

Hans wrote

> In the beginning om my program I declare a number of arrays. Later in a
> procedure I need to count the number of "rows" i the erlier declared
> array. How to to that?

--------
Sample for a one-dimensional array:
a = new array(10)
? a.size // 10

Sample for a two-dimensional array:
a = new array(5,2)
? a.size // 10
? alen(a,1) // number of rows: 5
? alen(a,2) // number of cols: 2

Roland



Glenn

2005-10-24, 8:24 pm

Hans wrote:
> In the beginning om my program I declare a number of arrays. Later in a procedure I need to count the number of "rows" i the erlier declared array. How to to that?
>
> Hans


I believe it is rows = alen(myarray,1) so long as it is a one or two
dimensional array.

Hope that helps

Glenn

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com