|
So in the new free form specs we are still required to use eval? Wouldn't it be nice to do the following InvoiceVariable = InvoiceFromFile instead of eval InvoiceVariable = InvoiceFromFile Aaron -----Original Message----- From: Jim Langston [mailto:jlangston@celsinc.com] Sent: Friday, September 21, 2001 11:07 AM To: rpg400-l@midrange.com Subject: RE: (no subject) RPG doesn't use brackets { } or other statement groupers, thank goodness. Since RPG doesn't use statmenent groupers, it needs definate end of statement terminators. This isn't C, like Hans said. If you want to program in C, program in C (I do at home). This is RPG, or whatever RPG is becoming. Do we really want another C clone? I don't think so. Remember, you should be able to code your example: IF A=B; Eval X = C * D; Else; X = C * B; Endif; as IF A=B; X = C * D; Else; X = C * B; Endif; in theory if you wanted to (I wouldn't but you could), although I'm not certain "they"ve taken freeform that far yet. (Took me a little scratching of my head before I realized you stuck an Eval in there <g>). Regards, Jim Langston -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On Behalf Of Bob Cozzi (RPGIV) Sent: Friday, September 21, 2001 6:30 AM To: rpg400-l@midrange.com Subject: RE: (no subject) Hans, No offense, but yes, this was the first example I've seen of the free form stuff. I had seen something in the manual, but it was mostly contrived and not clear enough. Sure I noticed and accepted a semi colon after the CHAIN or EVAL or most other operation codes. But looking at the code posted here, and seeing a semi colon after the IF conditional statement, cause me to do a double take. IF A=B; Eval X = C * D; Else; X = C * B; Endif; It just seems unnatural to me. I would have expected the parse to have been able to determine the end of the conditional clause and then accept a "command" statement next. Which of course, could be on the next line. That command statement would then be followed by a semi colon. The same holds true for the ELSE, SELECT, WHEN, ELSEIF statements. I guess there would be ambiguity on the ENDxx statement (to semi colon or not to semi colon <g>). I suppose the syntax you have is adaptable to the alterations (enhancements?) that I'm suggesting here, since it would continue to work if you added this change. Hans, as I stated publicly before, I think IBM did a good enough job (save this recent discovery) with the free-form syntax. It is much better than any of the previously viewed "grammas" that I saw. Of course since you apparently don't like to hear my comments, you've decided to no longer keep me in the early review loop, so don't blame me if I'm seeing things here for the first time. As to the C language, well RPG IV is still my favorite, with C++ a close second. I don't think I write in plain old C anymore, but I suppose C++ is syntactically similar. Just because one language does something questionable (like the lack of garbage collection) doesn't justify it being implemented in another language. Its funny you use my platform for why RPG IV did NOT need free form ("if you like C, use it") I've been saying that for 10 years. Glad to read you're quoting me on something. <vbg> Bob Cozzi _______________________________________________ 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 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.