ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Help in indicators

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

  • Help in indicators

    Hi,

    Please tell me the difference between HI,LO and EQ indicators. Like what r the functions,why we use these and when to use either of the three...Please specify an example if possible...it's urgent..

  • #2
    Re: Help in indicators

    Hi

    Please go through below link:

    Comment


    • #3
      Re: Help in indicators

      Hello Amitabh,

      Indicator are like switch in our rela life . you can use them with your requirements

      http://www.jaymoseley.com/hercules/rpgtutor/rpg008.htm

      study IBM manuels about SETLL,CHAIN,READE ....

      DO Google search.. trust me make Google search ur friend....


      Pramendra Pandeya
      Last edited by pramendra; August 24, 2009, 04:16 AM.
      Young people knows how to run fast but old people knows the way..

      Comment


      • #4
        Re: Help in indicators

        Originally posted by amitabh1_1 View Post
        Hi,

        Please tell me the difference between HI,LO and EQ indicators. Like what r the functions,why we use these and when to use either of the three...Please specify an example if possible...it's urgent..
        The short answer to this should be that we don't use them.
        Michael Catalani
        IS Director, eCommerce & Web Development
        Acceptance Insurance Corporation
        www.AcceptanceInsurance.com
        www.ProvatoSys.com

        Comment


        • #5
          Re: Help in indicators

          The HI LO EQ columns in RPG2-3 are used for various reasons.... on a CHAIN operation HI means 'not found' and LO means 'file error'... ona COMP statement they litereally mean that 'factor1' is HIgher, LOwer or EQual to Factor 2.

          Since RPG 4 (ILE onwards) most people tend to code without using indicators so

          key chain file 99
          *in99 ifeq *OFF
          // do something
          else
          // show a message saying record not found
          endif

          becomes

          chain (key) filename;
          If %Found(filename);
          // do something
          else;
          // show a message saying record not found
          endif;

          get your eyeball into some IBM manuals and look up all the various opcodes and see what each indicator can do... indicators on file access are easy to mess up by putting it in the wrong column.

          Cheers and Good Luck.
          predictably positive, permanently punctilious, purposely proactive, potentially priceless, primarily professional : projex

          Comment


          • #6
            Re: Help in indicators

            Originally posted by Finkpad View Post

            ...

            indicators on file access are easy to mess up by putting it in the wrong column.

            ...
            I'd like to add that, not only are they easy to "mess up" but they also lend to poor code legibility. The sheer volume of indicators possible in a single program can lead to quite a bit of the "now, where did I use *INXX and what did I use it for?"

            At the very least, I'd recommend looking into named indicators to help increase legibility. However, with the large number of built-in functions now-a-days, it's very rarely necessary to use these either (I find myself mostly using them for function keys or other DSPF changes).

            Comment


            • #7
              Re: Help in indicators

              Thanks for your help

              Comment


              • #8
                Re: Help in indicators

                Originally posted by Finkpad View Post
                The HI LO EQ columns in RPG2-3 are used for various reasons.... on a CHAIN operation HI means 'not found' and LO means 'file error'... ona COMP statement they litereally mean that 'factor1' is HIgher, LOwer or EQual to Factor 2.

                Since RPG 4 (ILE onwards) most people tend to code without using indicators so

                key chain file 99
                *in99 ifeq *OFF
                // do something
                else
                // show a message saying record not found
                endif

                becomes

                chain (key) filename;
                If %Found(filename);
                // do something
                else;
                // show a message saying record not found
                endif;

                get your eyeball into some IBM manuals and look up all the various opcodes and see what each indicator can do... indicators on file access are easy to mess up by putting it in the wrong column.

                Cheers and Good Luck.
                Your answer is the best...I understood the meaning...thanks bro

                Comment

                Working...
                X