all var scoped variables must be at the top of a function.

you're var'ing "the_type", then you're doin ga conditional...then more var'ing.

that conditional either has to come after the vars...or var everything
to an empty string (or 0) at the top...then set later.

On 2/2/07, daniel kessler <[EMAIL PROTECTED]> wrote:
> I'm receiving an error that I don't understand: Local variable the_day on 
> line 10 must be grouped at the top of the function body.
>
> <cfscript>
>
>       function makeDate(a_day,a_month,a_year,a_type){
>
>             var the_type = "begin";
>             // this is before the other inits cause it's necessary for year
>             if (a_type NEQ '' AND a_type NEQ undefined){
>                   the_type = a_type;
>             };
>             var the_day = 1;
>             var the_month = 1;
>             var the_year = 1966;
>             if(the_type NEQ 'begin'){
>                   the_year = (year(now()))+10;
>             }
>
>             if (a_day NEQ ''){the_day = a_day;};
>             if (a_month NEQ ''){the_month = a_month;};
>             if (a_year NEQ ''){the_year = a_year;};
>
>             return CreateODBCDate(createDate(the_year,the_month,the_day));
>       }
>
> </cfscript>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268476
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to