ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to use external indicators u1 TO U8 in RPG400

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

  • How to use external indicators u1 TO U8 in RPG400

    hi developers
    i m beginner in RPG400 and I want to use External Indicators U1 to U8 in Two RPG programs
    CAN ANY ONE POST A CODE EXAMPLE CAZ I M NOT GETTING HOW TO START WITH IT. (I dont need any cl program involve in it.)
    THANKS IN ADVANCE

  • #2
    Re: How to use external indicators u1 TO U8 in RPG400

    If your new to programming then I suggest you DONT use old coding techniques.
    Can you use parameters?
    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


    • #3
      Re: How to use external indicators u1 TO U8 in RPG400

      Hi sunslashair:

      User switches changed in an RPG program will not be set until the program ends.

      AS JAMIE SAID
      DONT use old coding techniques.
      AND I REPEAT
      DON'T USE OLD CODING TECHNIQUES

      GLS
      The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

      Comment


      • #4
        Re: How to use external indicators u1 TO U8 in RPG400

        Thanks 4 ur suggestions
        You can tell me what is best use of these indicators
        I'll try to make the program,
        But do send me some code snippets
        I need them.
        Thanks in advance

        Comment


        • #5
          Re: How to use external indicators u1 TO U8 in RPG400

          Just wont take no for an answer, eh?

          In the CL that calls the program use the CHGJOB command to set the indicators U1 - U8 in the following manner

          Code:
          CHGJOB     SWS('00000000')
          The above sets all indicators to *OFF. Change any indicator you would like to *ON by changing the '0' to a '1' in the above statement.

          To turn on U1, U5 and U8 use:
          Code:
          CHGJOB     SWS('10001001')
          Read them in the called program as you would any other externally defined indicator.

          In other words:

          C IF *INU1 = *ON
          C* Do Something
          C ENDIF

          Best of luck to you in the future.
          Goodbye

          Comment


          • #6
            Re: How to use external indicators u1 TO U8 in RPG400

            Hi sunslash why are you bothering about those old techniques, Don't use them.
            Well is that sounds like iam very much good at using external indicators? absolutely no. I got an idea of how to use them after reading this post. Thanks to KenM and you
            Regards
            Sai
            To every equation there is a solution....
            Regards
            Sai.

            Comment


            • #7
              Re: How to use external indicators u1 TO U8 in RPG400

              Here is another way they have been used. If U2 is off when the program starts, the DISPLAY file is not opened, if it is on, DISPLAY is opened

              Code:
                   FFILE1     IPEA E             Disk
                   FDISPLAY   O    E             Workstn ExtInd(*INU2)
                   FFILE2     O    E             Disk

              Comment


              • #8
                Re: How to use external indicators u1 TO U8 in RPG400

                What you need to be asking yourself is...
                What am I trying to achieve by using program switches?
                Is there a better way to do it?

                Don't fall into the trap of doing it this way, 'because thats the way its always been done here'

                You don't stop playing games because you get old, You get old because you stop playing games!

                Comment


                • #9
                  Re: How to use external indicators u1 TO U8 in RPG400

                  Actually, you posted this in RPG400 section. Are you using RPG-IV (ILE) or the prior version of RPG ?

                  Comment

                  Working...
                  X