ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Goto Tag in Free Form

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

  • #31
    Re: Goto Tag in Free Form

    Mike your fine....Its monday... your skills as a programmer are not in question here, just
    the decision to post "this post" on a Monday Im not sure of other places ....but its Monday
    and -12 here.....I was hoping the Barista at starbucks would look funny at me so I could throw Down!


    Take care
    Jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #32
      Re: Goto Tag in Free Form

      lol Jamie

      Sorry all...had at least one rant in me today, and no one here was a willing target
      You don't stop playing games because you get old, You get old because you stop playing games!

      Comment


      • #33
        Re: Goto Tag in Free Form

        It must be warmer in the UK....

        ***Goes back to grumbling and mumbling to self***

        You could freeze the T**S off the devil here.
        Your future President
        Bryce

        ---------------------------------------------
        http://www.bravobryce.com

        Comment


        • #34
          Re: Goto Tag in Free Form

          Oh yeah a bit warmer. And it hasn't rained for a week !!!!
          You don't stop playing games because you get old, You get old because you stop playing games!

          Comment


          • #35
            Re: Goto Tag in Free Form

            (As he pulls the target over his chest)

            We're talking 77 and sunshine here today. Actually wore a short sleeve shirt and sunglasses today.

            Golf Anyone??

            Comment


            • #36
              Re: Goto Tag in Free Form

              (Aims at target, pulls trigger)

              We're talkin' 16 friggin' degrees here! @#%@#%@#%@#% you AZ people!

              MdnghtPgmr
              "Tis better to be thought a fool then to open one's mouth and remove all doubt." - Benjamin Franklin

              Comment


              • #37
                Re: Goto Tag in Free Form

                My wife left for California today. its supposed to be 80 there so if things work out she could have 100 degree difference between when she left and when she lands.
                All my answers were extracted from the "Big Dummy's Guide to the As400"
                and I take no responsibility for any of them.

                www.code400.com

                Comment


                • #38
                  Re: Goto Tag in Free Form

                  21F here. I visit my parents in Tampa Feb 23-Mar1. Usu it's unseasonably warm in the DC area when I'm there. Not fair -- I want to gloat to my co-workers how I was in this nice warm weather while they were freezing.
                  http://www.linkedin.com/in/chippermiller

                  Comment


                  • #39
                    Re: Goto Tag in Free Form

                    In regards to B.Hauser note about subroutines;

                    I use subroutines over sub procedures for the following reasons;

                    1) It is easier to follow along when the sub routines are in the same place (source) as the program. The code does not look like spaghetti either. More like event driven code as in VB.

                    2) Its brutally hard to get the older school programmers to think like that. If we would have a common place to put the sub procedures, then this might work. Most of the other programmers just do things how they want and since we don't have change management ( or a manager) , it's not gonna happen.

                    #2 is similar for the other places I have been.


                    kitvb1;
                    I totally agree with your "eyes of the beholder". My code makes most sense to me and I try to keep it open and plain so others won't curse me too often.

                    I'm just making a note, no real meaning here. Enjoy your day and it was -1 F this morning.
                    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

                    Comment


                    • #40
                      Re: Goto Tag in Free Form

                      No one here where I work programs using subprocedures and service programs. We use subroutines because just like DMW said it acts as event driven source. Behind the scenes it might be goto statements, but on the scenes its not. It looks just like, ohh i don't know, functions in C and C++? So as long as you keep things fairly simple by focusing your sub routines on a specific task I would have to think that sub procedures and service programs might be over kill some of the time.....Now if you are writing a complex ERP or something along those lines then yeah, but for every day stuff that is probably just supplemental to the system you are using I would guess that sub procedures and service programs shouldn't be a rule of thumb...

                      But then again I'm a week away from being 1 year old in this industry...so it might just be the excitement talking

                      By the way, the US map on weather.com shows th highest temp in the country as 74 at the southern tip of FL. This should shut the polar bear lovers up for atleast one day.
                      Your future President
                      Bryce

                      ---------------------------------------------
                      http://www.bravobryce.com

                      Comment


                      • #41
                        Re: Goto Tag in Free Form

                        since LEAVE and LEAVESR should be avoided...should we not code a RETURN in subprocs either??
                        I'm not anti-social, I just don't like people -Tommy Holden

                        Comment


                        • #42
                          Re: Goto Tag in Free Form

                          Originally posted by DeadManWalks View Post
                          kitvb1;
                          I totally agree with your "eyes of the beholder". My code makes most sense to me and I try to keep it open and plain so others won't curse me too often.
                          Just to share my approach to things -- I use LeaveSR when I do a "process of elimination" strategy, among other things. Example:

                          Code:
                          /free
                             Exsr EvalRcd;
                             If ProcRcdFlag = @YES;
                                Exsr ProcRcd;
                             EndIf;
                          //*********************
                          BegSR EvalRcd;
                          
                          ProcRcdFlag = @NO;
                          
                          // Do some test.
                          If (this test fails);
                             LeaveSR;
                          EndIf;
                          
                          // Test #2
                          If (this test also fails)
                             LeaveSR;
                          EndIf;
                          
                          // At the bottom of the subr (i.e. all tests were successful).
                          ProcRcdFlag = @YES;
                          
                          EndSR;
                          Again, personal preference. The one thing I try to do is focus on maintainability, both for myself and for others. Almost every programmer knows what it's like to spend 80% of your time with trying to figure out the programming style of the person who wrote the pgm.
                          http://www.linkedin.com/in/chippermiller

                          Comment


                          • #43
                            Re: Goto Tag in Free Form

                            Ok, you hit the magic number of posts (42 per Douglas Adams) the get the answer to everything, so now I feel compelled to put in my comments.
                            I think a goto can be used reasonably, and it doesn't HAVE to make spaghetti code. A GOTO EXIT where EXIT is the last line is no problem for me to follow. Same with a GOTO READNEXT in a read loop where the READNEXT tag is a couple of lines above.
                            I also don't have problems with EXSR. I know exactly where the code goes, and where it returns to. A LEAVESR is also explict - find the ENDSR. How hard is that?
                            The LEAVE I don't like so much. There is no clear "next line" if its embedded inside a whole bunch of DO and IF loops.
                            Actually, the only opcode I really hate is the CABxx. I know, its not really that different that a conditioned EXSR, but I just think it confuses the code (or maybe me).
                            As for sub-procedures, I think they can be great. But much of the code I see is from ERP systems where 85% is RPG3, and 15% is RPG-IV. Very little was written with activation groups or ILE concepts in mind, and introducing act groups in this environment can be an awful lot of work. So, I'm am stuck with DFTACTGRP where a lot of the "cool stuff", sub-procs, serv pgms , etc don't work.
                            Well, this is my opinion, so take it fwiw. I have been programming RPG for almost 40 years, and I can still read my code and follow it. Can't find my teeth, maybe, but I can follow the code.

                            Comment

                            Working...
                            X