Hi,

This might help;

var i:int = 0;
var overbooked:Boolean = false;

while ( startDate <= endDate ){

    for (var a:int = 0; a <= disabledDates.length; a++) {

        stayLength[i] = year.toString() + "," + month.toString() + "," +
        startDate.toString();

        if ( disabledDates[a] == stayLength[i] ) {
            overbooked = true;
        }

    i++;
    startDate++;

}

if (overbooked)
{
    Alert.show("Date Overbooked!", "Sorry", Alert.OK);
}

Mike

On Wed, Jun 11, 2008 at 12:24 PM, tspyro2002 <[EMAIL PROTECTED]>
wrote:

>   Hi,
>
> I have a problem where I am processing dates and cross checking them
> across two Arrays. One array holds user selected dates, the other
> holds dates which are disabled.
>
> The loop I have at the minute checks them OK but outputs an Alert box
> for every date which is the same.
>
> How can I adjust the code so that only one alert box is displayed?
>
> CODE SEGMENT
>
> var i:int = 0;
>
> while ( startDate <= endDate ){
>
> for (var a:int = 0; a <= disabledDates.length; a++) {
>
> stayLength[i] = year.toString() + "," + month.toString() + "," +
> startDate.toString();
>
> if ( disabledDates[a] == stayLength[i] ) {
>
> Alert.show("Date Overbooked!", "Sorry", Alert.OK);}
>
> }
>
> i++;
> startDate++;
>
> }
>
>  
>



-- 
Teoti Graphix, LLC
http://www.teotigraphix.com

Teoti Graphix Blog
http://www.blog.teotigraphix.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to