View Full Version : EVAL Statement clarification
Guest.Visitor
01-01-1995, 02:00 AM
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.
Guest.Visitor
11-10-1999, 06:21 AM
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'
Guest.Visitor
11-10-1999, 11:39 AM
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
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.