<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Adventure in Modernization</title>
	<atom:link href="http://www.rpgandprogramming.com/2010/01/adventure-in-modernization/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rpgandprogramming.com/2010/01/adventure-in-modernization/</link>
	<description>Not Role Playing Games, but the RPG programming language and the craft of programming.</description>
	<pubDate>Tue, 07 Feb 2012 05:48:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: Buck</title>
		<link>http://www.rpgandprogramming.com/2010/01/adventure-in-modernization/#comment-597</link>
		<dc:creator>Buck</dc:creator>
		<pubDate>Tue, 02 Feb 2010 16:26:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.rpgandprogramming.com/?p=208#comment-597</guid>
		<description>Brian's comment about hiding complexity with a subprocedure reflects one of the major breakthroughs in my own personal development as a programmer.  I tend to naturally think in terms of functions rather than in code, so the idea of taking a complicated bit of code and converting it to a function / subprocedure was one of those AHA! moments for me.

Not everyone will see it that way, of course, but I thought I'd throw that out there :-)</description>
		<content:encoded><![CDATA[<p>Brian&#8217;s comment about hiding complexity with a subprocedure reflects one of the major breakthroughs in my own personal development as a programmer.  I tend to naturally think in terms of functions rather than in code, so the idea of taking a complicated bit of code and converting it to a function / subprocedure was one of those AHA! moments for me.</p>
<p>Not everyone will see it that way, of course, but I thought I&#8217;d throw that out there <img src='http://www.rpgandprogramming.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis Barron</title>
		<link>http://www.rpgandprogramming.com/2010/01/adventure-in-modernization/#comment-595</link>
		<dc:creator>Curtis Barron</dc:creator>
		<pubDate>Sun, 24 Jan 2010 03:50:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.rpgandprogramming.com/?p=208#comment-595</guid>
		<description>I appreciate your response, Buck. Actually, using a data structure is the least obscure way of doing it. I may have been thinking that I didn't want to rely upon a data structure to do the formatting, since that would force the maintenance programmer to leave his C calculations and look up to the D specs to find out what the data structure was all about.

But then, he would have to go up there to see what the other fields looked like anyway, so why would that be a problem? One data structure. one calculation line, and we're done.

Thanks a lot.</description>
		<content:encoded><![CDATA[<p>I appreciate your response, Buck. Actually, using a data structure is the least obscure way of doing it. I may have been thinking that I didn&#8217;t want to rely upon a data structure to do the formatting, since that would force the maintenance programmer to leave his C calculations and look up to the D specs to find out what the data structure was all about.</p>
<p>But then, he would have to go up there to see what the other fields looked like anyway, so why would that be a problem? One data structure. one calculation line, and we&#8217;re done.</p>
<p>Thanks a lot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtis Barron</title>
		<link>http://www.rpgandprogramming.com/2010/01/adventure-in-modernization/#comment-594</link>
		<dc:creator>Curtis Barron</dc:creator>
		<pubDate>Sun, 24 Jan 2010 03:30:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.rpgandprogramming.com/?p=208#comment-594</guid>
		<description>I appreciate your response, Brian. I not sure why I didn't think of that.

Perhaps I didn't think of the %editw BIF as effectively making it a string issue. I've been a little gun-shy of the EVAL statement ever since I first attempted to multiply a number by another (using EVAL) to create a number that would overflow and truncate the high end digits (as with the famous "magic number" method of flipping dates), and got a runtime error.

I was, of course, aware of the possibility of creating a subprocedure in a service program, but when it came to creating a subprocedure or an inline calculation, it really didn't make any difference. In either case, the nested BIFs would be ugly - even if I was the only one that knew it.

Again, thanks for reading and responding.</description>
		<content:encoded><![CDATA[<p>I appreciate your response, Brian. I not sure why I didn&#8217;t think of that.</p>
<p>Perhaps I didn&#8217;t think of the %editw BIF as effectively making it a string issue. I&#8217;ve been a little gun-shy of the EVAL statement ever since I first attempted to multiply a number by another (using EVAL) to create a number that would overflow and truncate the high end digits (as with the famous &#8220;magic number&#8221; method of flipping dates), and got a runtime error.</p>
<p>I was, of course, aware of the possibility of creating a subprocedure in a service program, but when it came to creating a subprocedure or an inline calculation, it really didn&#8217;t make any difference. In either case, the nested BIFs would be ugly - even if I was the only one that knew it.</p>
<p>Again, thanks for reading and responding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Buck</title>
		<link>http://www.rpgandprogramming.com/2010/01/adventure-in-modernization/#comment-591</link>
		<dc:creator>Buck</dc:creator>
		<pubDate>Thu, 21 Jan 2010 19:48:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.rpgandprogramming.com/?p=208#comment-591</guid>
		<description>I'm not overly fond of the numeric conversion / editing trick myself.  I'm with you - I think it's a bit on the ugly side, and somewhat a stumbling block as I try to read it.  I'm far more pleased with self-documenting code; code that's so straight forward, it doesn't require a complex comment to explain it.  

Programmers from other languages (like C) will find the data structure example fairly easy, although using QUALIFIED will help that even more.  People from a pure RPG II environment might have an easier time with the explicit %subst()

For the record, I am an RPG II programmer, System/3.  I don't have much of a problem with the newer stuff in general.  MOVE almost always had some head scratcher.  A simple mis-definition of either the source or target and something odd would occur.  And that old code was loaded with MOVE and MOVELs.  Variables were defined wherever and looking up the definition of the variables involved invariably meant having a printed copy of the compiler listing handy (cross reference at the bottom.)

Of course, I'm talking about maintenance.  Writing new code wasn't nearly as stressful because one keeps all the variables straight.  But walking into someone else's code... I can't tell you how many times I scratched out the variables on scrap paper as I tried to decipher MOVE-laden code.

Kudos for doing this blog.  There aren't any other RPG programmers doing what you do, and I hope this spurs discussion about the peculiarities of our craft.  My comments are not intended as a criticism; my opinion is only one among many, and I have learnt much by being exposed to others - like yours.

H DFTACTGRP(*NO)   ACTGRP('QILE')                        
                                                         
d                 ds                                     
d  BACTNO                       11  0                    
d  ACC6                          6    overlay(bactno: 6) 
d  ACC_co                        2    overlay(bactno: 6) 
d  ACC_maj                       3    overlay(bactno: 8) 
d  ACC_min                       1    overlay(bactno: 11)
                                                         
d formatted       S              8    INZ                
                                                         
C/FREE                                                   
  eval bactno = 99999012345;                             
                                                         
  // explicit movement of data elements                  
  eval formatted = %subst(acc6: 1: 2) +                  
                   '-' +                                 
                   %subst(acc6: 3: 3) +                  
                   '-' +                                 
                   %subst(acc6: 6: 1);                   
  dsply formatted;                                       
                                                         
  // implicit movement of data elements                  
  eval formatted = acc_co +              
                   '-' +                 
                   acc_maj +             
                   '-' +                 
                   acc_min;              
  dsply formatted;                       
                                         
 /END-FREE                               
C                   EVAL      *INLR= *ON</description>
		<content:encoded><![CDATA[<p>I&#8217;m not overly fond of the numeric conversion / editing trick myself.  I&#8217;m with you - I think it&#8217;s a bit on the ugly side, and somewhat a stumbling block as I try to read it.  I&#8217;m far more pleased with self-documenting code; code that&#8217;s so straight forward, it doesn&#8217;t require a complex comment to explain it.  </p>
<p>Programmers from other languages (like C) will find the data structure example fairly easy, although using QUALIFIED will help that even more.  People from a pure RPG II environment might have an easier time with the explicit %subst()</p>
<p>For the record, I am an RPG II programmer, System/3.  I don&#8217;t have much of a problem with the newer stuff in general.  MOVE almost always had some head scratcher.  A simple mis-definition of either the source or target and something odd would occur.  And that old code was loaded with MOVE and MOVELs.  Variables were defined wherever and looking up the definition of the variables involved invariably meant having a printed copy of the compiler listing handy (cross reference at the bottom.)</p>
<p>Of course, I&#8217;m talking about maintenance.  Writing new code wasn&#8217;t nearly as stressful because one keeps all the variables straight.  But walking into someone else&#8217;s code&#8230; I can&#8217;t tell you how many times I scratched out the variables on scrap paper as I tried to decipher MOVE-laden code.</p>
<p>Kudos for doing this blog.  There aren&#8217;t any other RPG programmers doing what you do, and I hope this spurs discussion about the peculiarities of our craft.  My comments are not intended as a criticism; my opinion is only one among many, and I have learnt much by being exposed to others - like yours.</p>
<p>H DFTACTGRP(*NO)   ACTGRP(&#8217;QILE&#8217;)                        </p>
<p>d                 ds<br />
d  BACTNO                       11  0<br />
d  ACC6                          6    overlay(bactno: 6)<br />
d  ACC_co                        2    overlay(bactno: 6)<br />
d  ACC_maj                       3    overlay(bactno: <img src='http://www.rpgandprogramming.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /><br />
d  ACC_min                       1    overlay(bactno: 11)</p>
<p>d formatted       S              8    INZ                </p>
<p>C/FREE<br />
  eval bactno = 99999012345;                             </p>
<p>  // explicit movement of data elements<br />
  eval formatted = %subst(acc6: 1: 2) +<br />
                   &#8216;-&#8217; +<br />
                   %subst(acc6: 3: 3) +<br />
                   &#8216;-&#8217; +<br />
                   %subst(acc6: 6: 1);<br />
  dsply formatted;                                       </p>
<p>  // implicit movement of data elements<br />
  eval formatted = acc_co +<br />
                   &#8216;-&#8217; +<br />
                   acc_maj +<br />
                   &#8216;-&#8217; +<br />
                   acc_min;<br />
  dsply formatted;                       </p>
<p> /END-FREE<br />
C                   EVAL      *INLR= *ON</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian May</title>
		<link>http://www.rpgandprogramming.com/2010/01/adventure-in-modernization/#comment-590</link>
		<dc:creator>Brian May</dc:creator>
		<pubDate>Thu, 21 Jan 2010 15:04:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.rpgandprogramming.com/?p=208#comment-590</guid>
		<description>I'll be happy to help on this one.  First, instead of 

EVALR ACC6 = %EDITW(%DEC(%SUBST(%EDITC(BACTNO:'X'):6:6):6:0):ACCW);

I suggest:

D ACCW            C                   '     0  -   - '

EvalR = %EditW(BActNo:ACCW);

Using the EvalR will truncate the leading 5 numbers anyway.

Secondly, when you do encounter a nasty situation like your original nested BIF's, wrap it in a subprocedure in a service program and no one will have to know exactly how it works.  That's the whole point behind "Modern" RPG.</description>
		<content:encoded><![CDATA[<p>I&#8217;ll be happy to help on this one.  First, instead of </p>
<p>EVALR ACC6 = %EDITW(%DEC(%SUBST(%EDITC(BACTNO:&#8217;X'):6:6):6:0):ACCW);</p>
<p>I suggest:</p>
<p>D ACCW            C                   &#8216;     0  -   - &#8216;</p>
<p>EvalR = %EditW(BActNo:ACCW);</p>
<p>Using the EvalR will truncate the leading 5 numbers anyway.</p>
<p>Secondly, when you do encounter a nasty situation like your original nested BIF&#8217;s, wrap it in a subprocedure in a service program and no one will have to know exactly how it works.  That&#8217;s the whole point behind &#8220;Modern&#8221; RPG.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

