minimum Date from an array

Alex Tweedly alex at
Tue Jan 17 16:31:47 EST 2006

Ramesh Ramchandani wrote:

> Hello,
> I am new to Rev
> I have an array of dates that I am sending to the graph object.
> Is there a way to check the Minimum and maximum value of the dates  
> from the array.
> The graph object that I am using is using this code
> set the graphX of group "graph" to vWeek
> // vWeek is my array of dates
> put the graphX of me into tXData
> put min(tXData) into tXMin
min() used on an array will only work if the array contains only numbers.

You could convert the array values from dates to "seconds" and then use min.
But even easier would be to use the sort feature; you'll need the dates 
to be (for example) one per line,

> combine tXData using CR

and then do

> sort lines of tXData ascending dateTime

then "line 1 of tXData" is the min(), and "line -1 of tXData" is the max()

Alex Tweedly

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.19/231 - Release Date: 16/01/2006

More information about the Use-livecode mailing list