Hi Bob,

You are correct, if there are no braces then the first statement
following the if is in scope... as would be the first statement
following an else if there was one.

  int i=1;
  ;

    if(i==0)
        i=2;
    else
        i=3;

    print i;

will print 3

  int i=1;
  ;

    if(i==1)
        i=2;
    else
        i=3;

    print i;
will print 2

  int i=1;
  ;

    if(i==0)
        i=2;
        i=5;
    else
        i=3;

    print i;

will give a compile error because of the ==5;

--- In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
> 
> Hi All,
> 
> I am a little confused by the scope of an IF statement.What is the
scope of
> the first ?IF? statement below taken from the fetch in the
SalesInvoiceUS
> report?  I thought that the curly brackets { and } controlled the
scope but
> there is no curly bracket { following the first IF. It appears that only
> element.execute(1) is controlled by the IF.
> 
>          }
> 
>             if (custInvoiceJour.SumMarkup)  // print freight/misc
charges
>                 element.execute(1);
> 
>               element.printBackorders();
> 
>             taxSpecPrintLevel = CustFormletterParameters::Find
> ().TaxSpecPrintLevel;
> 
>             if (taxSpecPrintLevel != TaxSpecPrintLevel::None)
>             {
> 
> Thanks,
> 
> Bob
> 
> 
> 
> Bob Brinker
> Oakdene Group, Inc.
> 2625 Butterfield Rd. (Suite 212E)
> Oak Brook, IL 60523-1261
> (630)368-1046 x/230
> (630)368-1050 (Fax)
> [EMAIL PROTECTED]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/kGEolB/TM
--------------------------------------------------------------------~-> 

Sharing the knowledge on Axapta. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Axapta-Knowledge-Village/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to