Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

New Year's Resolutions for RPG IV Programmers

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

  • New Year's Resolutions for RPG IV Programmers

    ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
    This is a discussion about New Year's Resolutions for RPG IV Programmers.

    Click here for the article.


  • #2
    New Year's Resolutions for RPG IV Programmers

    ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
    IBM needs to add refactoring support in the LPEX editor for WDSC. Most importantly, they need to give us the ability to highlight a block of code and extract it into a subprocedure (just like the Java editor lets you extract code into a method). It would make the move to using procedures significantly easier.

    Comment


    • #3
      New Year's Resolutions for RPG IV Programmers

      ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
      > Most importantly, they need to give us the ability to highlight a > block of code and extract it into a subprocedure
      I sat in on a talk with George Farr at the end of 2005 and I remember him saying that the subprocedure feature you're describing would be in a future release of wdsc. Not sure what release that is but it should be coming sometime.

      Comment


      • #4
        New Year's Resolutions for RPG IV Programmers

        ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
        Where can I find out more about "Program Entry Parameter Lists"? I have heard that there is a method to eliminate the *ENTRY/PLIST, but I have not seen an example or description of how it works.

        Comment


        • #5
          New Year's Resolutions for RPG IV Programmers

          ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
          brad: are you talking about using PR and PI to define the parms being passed? or actually having an intuitive program structure that you can pass "anything"? use the PR PI to describe parms coming in. this does not require an ENTRY/PLIST, although the conceptual idea is the same, or close enough to it, that i do not need to be berated for using "SAME" in the the sentence.... hoo-ah! -bret myrick

          Comment


          • #6
            New Year's Resolutions for RPG IV Programmers

            ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
            As mentioned, subroutines have long since replaced subprocedures. Bob, I think you want to edit that and switch it. rd

            Comment


            • #7
              New Year's Resolutions for RPG IV Programmers

              ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
              Bob is talking about replacing the old *ENTRY PLIST parms with a modern prototype. Go here for an example: http://faq.midrange.com/data/cache/304.html And stick CONST on the prototype parms that the program should NOT change. Chris

              Comment


              • #8
                New Year's Resolutions for RPG IV Programmers

                ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                no, no, ralph: he is probably talking about a company who's manager is tired of the "frivolous" abilities of the as/400 and is insisting that IBM supply a system/34 or System/3 environment, so we can get things done the right way! -bret myrick

                Comment


                • #9
                  New Year's Resolutions for RPG IV Programmers

                  ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                  I use lots of subroutines, and I haven't been making subprocedures of them. I've been reserving subprocedures for that little niche of a component routine, not quite enough to justify a small program but with enough local variables and lines of code to isolate into a subprocedure. But I had decided for my personal projects to go the route that Bob describes, with a model of a Java class of methods (subprocedures) per source file approach, with each module able to be compiled with a program or service program, or into a standalone program, with all the code /free. I see plenty of it in new code elsewhere as well, but before this I had never got into the whole binding thing for everything I do. It's just an environment thing, though. Well, subroutines worked good when we had 4K paging and stuck the init routine at the end so it wouldn't take up valuable space up front. Now people use 4K for a freakin field for a URL. Hey who cares? All these software systems that are supposed to be so much better have so much memory and speed now it doesn't matter how bad (or "good") the programming is. How could IT possibly blow having gigs of memory and gigahertz's of CPU? I mean software is obviously developed so much better and runs so much faster than it used to be, any business can see that. They must be deliriously happy by now. rd

                  Comment


                  • #10
                    New Year's Resolutions for RPG IV Programmers

                    ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                    Here's a fun bit, Ralph. You can use subroutines inside of procedures; they're in effect local to the procedure. But they have access to the procedure variables as if they were global among the subroutines. So if I have a situation where I call a piece of logic passing an operation code which conditionally executes related parts of the logic, I put all of the code into subrotuines within a procedure and then all the procedure mainline does is execute the subroutines based on the opcode. Sometimes I use a SELECT, and sometimes I even use the good old fixed-format CASEQ statement. It allows me to hide the internal working of the procedure from the caller, and yet doesn't require me to pass data between the various logical functions (almost like instance variables in a class). It's not perfect, but in those cases where it is appropriate, it works very nicely. Joe

                    Comment


                    • #11
                      New Year's Resolutions for RPG IV Programmers

                      ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                      I definitely will try that, Joe. I had just been thinking when I wrote earlier of how there were no class variables, just global and local, and I'll be doggoned if that isn't a useful in between. Thanks for the tip. rd

                      Comment


                      • #12
                        New Year's Resolutions for RPG IV Programmers

                        ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                        Joe, That's just sick! Its one of those things that I know I'm going to use but feel like I shouldn't. But who cares, I'm going for it. LOL!

                        Comment


                        • #13
                          New Year's Resolutions for RPG IV Programmers

                          ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                          Yeah, it's sick, Bob . Like many of these sorts of things, it came about as a way to address a specific problem. In my case, I needed some global subroutines. As you know, you can't execute a subroutine in the mainline from a subprocedure. This effectively means that two procedures cannot share the same subroutine. Sure, I can go through the work of turning the subroutines into procedures, but that's not exactly the easiest thing in the world. However, if you put all your global subroutines in a "subroutine procedure", and then pass a function code to select which subroutine to execute, you can then call that procedure from any other procedure. And now you have global subroutines! Not only that, but as I pointed out to Ralph, you can have shared "hidden" fields. If you make them static, they can even be persistent between calls. Joe

                          Comment


                          • #14
                            New Year's Resolutions for RPG IV Programmers

                            ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                            It's just one of those little cool things I see in RPG, Ralph. The RPG compiler folks continue to create a great product. There are some folks who would like to turn RPG into another C clone, but frankly I'm pretty happy with what they've done to date. It's a powerful procedural language with some pretty nice features for code encapsulation. Let's not get carried away and try to turn it into Object RPG. Joe

                            Comment


                            • #15
                              New Year's Resolutions for RPG IV Programmers

                              ** This thread discusses the article: New Year's Resolutions for RPG IV Programmers **
                              IMHO, no matter how far you go with new techniques, one cannot entirely discount the old ones. Subroutines are a thing of beauty today as when they were first used---what was it?---1950?! I can't say the same for GOTO however... uh oh, I think I just posted something I shouldn't have.

                              Comment

                              Working...
                              X