[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: Intializing counters



Hi Navi

While I can't see the rest of your code, it looks like you've accidentally
locked yourself out of the 'if' statement.

If #Flex > 0                                            !You can't get past
this, because it starts at 0,
    if $Company = $Prev_Company
        let #Total_Flexcash = #Total_Flexcash + #Flex   !so you never get to
this point.
        let $Prev_Company = $Company
    else
        do Print-Totals
        Let #Total_Flexcash = 0
    End-If
End-If

Try getting rid of the outer 'if' statement.


> -----Original Message-----
> From: Grewal, Navi A. [SMTP:navi.grewal@EXELONCORP.COM]
> Sent: Tuesday, August 21, 2001 10:42 AM
> To:   SQR-USERS@list.iex.net
> Subject:      Intializing counters
>
> Good Morning,
>  I am trying to calculate flex dollars for each company.
> Here is verbally what i am trying to do
> Intialize Total_flex = 0
>  Keep adding flex dollars i.e. is #Flex to Total_Flex
>  When old_company not equal to new_company print the company and
> flex_dollars
> and set Total_flex to 0 and do it again for each company and print out the
> results till i am done with all the companies.
> Can anyone send me a similiar example or guide me how to write it.
> Here is what i wrote but i know this is not correct can someone guide me
> from here
>
> If #Flex > 0
>       if $Company = $Prev_Company
>           let #Total_Flexcash = #Total_Flexcash + #Flex
>           let $Prev_Company = $Company
>       else
>          do Print-Totals
>          Let #Total_Flexcash = 0
>
>       End-If
>    End-If
> Thanks a lot in advance
> Navi
>
>
> ************************************************************************
> This e-mail and any of its attachments may contain Exelon Corporation
> proprietary information, which is privileged, confidential, or subject
> to copyright belonging to the Exelon Corporation family of Companies.
> This e-mail is intended solely for the use of the individual or entity
> to which it is addressed.  If you are not the intended recipient of this
> e-mail, you are hereby notified that any dissemination, distribution,
> copying, or action taken in relation to the contents of and attachments
> to this e-mail is strictly prohibited and may be unlawful.  If you have
> received this e-mail in error, please notify the sender immediately and
> permanently delete the original and any copy of this e-mail and any
> printout. Thank You.
> ************************************************************************