locked
What Wrong in Given Formula? RRS feed

  • Question

  • numberVar monthno := {rpt_Statutory_Form_3A.MONTH}+1;
    if monthno = 13 then
        monthno := 1 ;   
        MonthName(monthno,true)
    else
        MonthName(monthno,true);

    In above formula error like "the remaining text does not appear to part of formula."


    numberVar monthno := {rpt_Statutory_Form_3A.MONTH}+1;
    if monthno = 13 then
    //    monthno := 1 ;   
        MonthName(monthno,true)
    else 

        MonthName(monthno,true);

    If You Comment Where you set value of monthno then it will not give you error.can any one please tell me why?thanks

    Also Solution is here for Above Formula you can use this way but i want to know why in first formula it gives error.

    numberVar monthno := {rpt_Statutory_Form_3A.MONTH}+1;
    if monthno = 13 then     
        MonthName(1,true)
    else
        MonthName(monthno,true);

     

     

     

     

     


    Nikunj Nandaniya
    Tuesday, April 26, 2011 6:50 AM

Answers

  • Hello,

    The reason is you are nesting tests in the THEN part

    You have to wrap it in brackets:

    if monthno = 13 then
        (monthno := 1;
        MonthName(monthno,true))
    else
        MonthName(monthno,true);

    Don


    Don Williams
    Wednesday, April 27, 2011 2:10 AM