ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Example of a Tag and Goto

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

  • #16
    Re: Example of a Tag and Goto

    Goto 's are great problem solvers.

    I've told someone who was a problem where to Goto and how to get there and they're gone!

    Comment


    • #17
      Re: Example of a Tag and Goto

      Originally posted by jamief View Post
      I cant wait till vacation time again...This year I just want to <GOTO> someplace
      and vegetate.
      vegatate ? Isn't that a <DoWhile>. Now, if you were to "imbibe", that could be a <DoUntil>.

      Hmmmm.. both sound better than the GOTO

      psuedo code:

      GOTO SouthSeaIsland;
      DOW There;
      DOU FeelingNoPain;
      EXSR ImbibeFavoriteBeverage;
      ENDDO; //FeelingNoPaid
      %sleep(it_off);
      ENDDO; //There
      GOTO Home;

      That's it ! GOTO needs to be in free-form !

      Comment


      • #18
        Re: Example of a Tag and Goto

        BegSr Holiday;
        DOW InSouthSeaIsland;
        DOU FeelingNoPain;
        EXSR ImbibeFavoriteBeverage;
        ENDDO; //FeelingNoPaid
        %sleep(it_off);
        ENDDO; //InSouthSeaIsland
        EndSr;

        Mind you it seems the correct way to end a Holiday is to "Return;"

        And it should be SouthPacificIsland for a good holiday, I would normally recommend Fiji if they are not currently having a coup ...

        GC
        Greg Craill: "Life's hard - Get a helmet !!"

        Comment


        • #19
          Re: Example of a Tag and Goto

          I have to enter they Fray.

          I will admit I have used goto in a past life, but I tried to make it sure it only went done in the code and never up.

          CL was the exception of course.

          I tell you what is scary. Working on a 36 program where ALL of the indicators were used.
          Never trust a dog to watch your food.

          Comment


          • #20
            Re: Example of a Tag and Goto

            Actually i can think about example you cannot avoid TAG

            c/EXEC SQL
            c+ WHENEVER sqlerror GO TO SqlErrHdl
            c/END-EXEC

            Do one know if is any way to avoid TAG SqlErrHdl in this code?

            Comment


            • #21
              Re: Example of a Tag and Goto

              Yeah, monitor for an SQLCOD < 0 instead of using the whenever SQLERROR statement. They are essentially doing the same thing.
              Predictions are usually difficult, especially about the future. ~Yogi Berra

              Vertical Software Systems
              VSS.biz

              Comment

              Working...
              X