John Meyer wrote:
> if i_Error <> 0 then
>         begin
>         d_SalesTax := 0;
>         end;
>      else  <---line that is giving me the error
>          if d_SalesTax > 0 then
>          begin
>             d_SalesTax := d_SalesTax / 100
>          end;
Actually, here's the line giving the error:

if i_Error <> 0 then
        begin
        d_SalesTax := 0;
        end; <---line that is giving me the error
     else 

Remove the semicolon before else.

What you're saying is:

if [something] then {block};
else

What you should be saying is:
if [something] then {block} else {block};

Common mistake.  Keep in mind that the semicolon goes at the end of a
complete statement.  In this example your complete statement INCLUDES
the else keyword, so it's semicolon goes after that.

-Tony

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to