ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

EvalR not working for me

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EvalR not working for me

    I know it must be something obvious but both D1acct# and Wrk18 are defined as 18A in my program. (see attachments)

    WRK18 should be right justified?
    Attached Files

  • #2
    Re: EvalR not working for me

    Try:

    Code:
    EvalR Wrk18 = %trim(D1acct#);

    Comment


    • #3
      Re: EvalR not working for me

      nope it's working as it should...you are moving 18 characters from D1Acct# to 18 characters in Wrk18. i believe you are wanting
      Code:
      Wrk18 = %Trim(D1Acct#);
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #4
        Re: EvalR not working for me

        Tom, he still needs EVALR to get it right-justified.

        Comment


        • #5
          Re: EvalR not working for me

          %Trim fixes it. Thanks everyone

          Evalr Wrk18 = %Trim(D1acct#);

          Comment


          • #6
            Re: EvalR not working for me

            As a side note, I'm a little surprised this didn't blow up, converting an alpha field with blanks in it to a decimal field
            Click image for larger version

Name:	Capture 1.PNG
Views:	1
Size:	18.7 KB
ID:	126753

            Click image for larger version

Name:	Capture 2.PNG
Views:	1
Size:	19.7 KB
ID:	126754

            Comment


            • #7
              Re: EvalR not working for me

              Yes, %DEC is a nice BIF. The character field being converted with %DEC to numeric can contain embedded blanks, a + or - that precedes or follows the value, or a decimal point.

              Comment


              • #8
                Re: EvalR not working for me

                Originally posted by Viking View Post
                Tom, he still needs EVALR to get it right-justified.
                yeah i was in a hurry and screwed up my own fix suggestion
                I'm not anti-social, I just don't like people -Tommy Holden

                Comment

                Working...
                X