+ Reply to Thread
Results 1 to 3 of 3

Thread: EVAL Statement clarification

  1. #1
    Guest.Visitor Guest

    Default EVAL Statement clarification

    I am planning on taking the RPG certification exam, I was reviewing the EVAL opcode and had a question. Can you explain the following to me please? This example is taken from IBM's online library: Field2 = 9 Field3 = 8 After the operation the value of *in03 = *on Eval *in03 = field3 > field2 My thought is that field3 is not > field2(that makes this a false condition) therefore shouldn't *in03 be = *off(0) ******************** This example taken from the online library I understand: Field1 = 10 Field2 = 9 *in01 = *on The resulting value of the character field RES is '010' Eval RES = (field1<10) + *in01 + (field2 >= 17) I am thankful to anyone who can help me understand this.

  2. #2
    Guest.Visitor Guest

    Default EVAL Statement clarification

    0001.00 Dfld2 S 3 0 0002.00 Dfld3 S 3 0 0003.00 C eval fld2 = 9 0004.00 C eval fld3 = 8 0005.00 c eval *in03 = fld3 > fld2 0006.00 C *in03 dsply 0007.00 c eval *inlr = *on If you run this program *in03 is *off '0'

  3. #3
    Guest.Visitor Guest

    Default EVAL Statement clarification

    Oops. The manual is wrong. Thanks for finding this. I've reported it to the manual writers - it will be fixed in some future version of the manual. (I also reported that there's a problem with the *IN05 part of the example which isn't complete.) By the way, I'm glad to see you using the manual this way. You might find it useful to paste examples like this into a program and run it in the debugger. I find using the debugger helps to understand the example (and when the example is wrong like this one, when the actual answer agrees with your thinking, you can more easily be sure who's wrong, you or the manual). Barbara Morris, IBM Toronto Lab, RPG Compiler Development

+ Reply to Thread

Similar Threads

  1. routing entry clarification
    By cwscholbe@dstsystems.com in forum General
    Replies: 2
    Last Post: 03-18-2004, 11:03 PM
  2. MOVEL or EVAL vs Z-ADD
    By T.Holt in forum Programming
    Replies: 5
    Last Post: 11-09-2001, 01:27 AM
  3. EVAL with (H)
    By bibarnes@yahoo.com in forum Application Software
    Replies: 2
    Last Post: 08-24-2000, 07:35 AM
  4. Using the Eval statement in RPG IV
    By Guest.Visitor in forum Application Software
    Replies: 2
    Last Post: 08-09-2000, 01:58 PM
  5. Using EVAL
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 06-23-1998, 03:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts