Hi Peter,

The plus sign ("+") is both a unary operator and a binary operator, i.e. it
can have one or two operands.  When used as a unary operator, it simply
maintains the value of the operand.  As a binary operator, it adds numeric
operands, and concatenates character operands.

The asterisk ("*") is a only binary operator, and requires two operands, so

c    eval amount2 = amount1 *
c             * 500.00

is not valid syntax, since an operand is missing.

Peter Dow
Dow Software Services, Inc.
909 793-9050 voice
909 522-3214 cellular
909 793-4480 fax


----- Original Message -----
From: <Peter_Vidal@pall.com>
To: <rpg400-l@midrange.com>
Sent: Friday, August 02, 2002 1:12 PM
Subject: RE: Error in the EVAL Statement? (when + is used more than once)


>
> "I think it's taking the second + as a sign."
>
> That may be the reason Jim.  I also tried the * and it is a error. I think
this
> clarifies my doubt on this matter.
> However, I tried this now:
>
> c                   z-add     502.34        amount1           7 2
> c                   z-add     0             amount2           7 2
>
> c                   eval      amount2 = amount1 + + 7
> c                             500.00
>
> c                   seton
>
> You know the result? 8002.34
>
> How?
> Peter Vidal
> PALL Aeropower Corp.
> Senior Programmer Analyst
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.