Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

TechTip: CALLing in Free-Format RPG IV

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

  • TechTip: CALLing in Free-Format RPG IV

    ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
    ** This thread discusses the Content article: TechTip: CALLing in Free-Format RPG IV0

  • #2
    TechTip: CALLing in Free-Format RPG IV

    ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
    It's true that for the most part, you don't need to name the parameters on the prototype. For the most part. There is one situation where you would need to. Consider this prototype:
     D MyProc pr extproc('SomeProc') D like(MyField) 
    Is that like(MyField) describing the return value of MyProc, or is it describing the first parameter? As it is coded, it's defining the return value. If it is meant to describe the first parameter, then you would need a documentary parameter name. It just proves all the more what Jim said - Always use parameter names anyway.

    Comment


    • #3
      TechTip: CALLing in Free-Format RPG IV

      ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
      You can actually leave the CALLP out completetly and simply reference the prototype name to call it. This is similar to the way that you don't have to specify EVAL when performing any variable manipulation. In the example in the article this would look like the code below:
      Code

      Comment


      • #4
        TechTip: CALLing in Free-Format RPG IV

        ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
        When I tried this, I found that I needed to compile the called program with DFTACTGRP(*NO). Otherwise, the error message "Keyword EXTPGM must be specified when DFTACTGRP(*YES) is specified on the CRTBNDRPG command." I added an H-spec for this.
        Code

        Comment


        • #5
          TechTip: CALLing in Free-Format RPG IV

          ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
          You can go back to using the default activation group by coding Extpgm keyword in the prototype (in the called program) as follows:
          Code

          Comment


          • #6
            TechTip: CALLing in Free-Format RPG IV

            ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
            I am trying to do a call to a CL, but the /Free callp doesn't work I get an error message of: *RNF0604 20 a 02970 The token is not valid; token is ignored. I also get the message: *RNF5410 30 029700 The prototype for the call is not defined. (See code below.) I have been trying for YEARS to do calls in /Free, but I have yet to get it to work. QCMDEXC does, but regular calls to other programs do not.

            Comment


            • #7
              TechTip: CALLing in Free-Format RPG IV

              ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
              Apparently you can't do a spell check, on the web site, and keep your source with it! Here's the source below.
              Code

              Comment


              • #8
                TechTip: CALLing in Free-Format RPG IV

                ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
                Source does not carry over if you use SPell Check button. See source below.
                Code

                Comment


                • #9
                  TechTip: CALLing in Free-Format RPG IV

                  ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
                  Your prototype lists 3 parms but your CALLP has 4 parms. This won't compile. And you don't need the 'CALLP' in free form, unless you want to trap an error as in CALLP(e). Chris

                  Comment


                  • #10
                    TechTip: CALLing in Free-Format RPG IV

                    ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
                    Thanks for the insight! You pointed to the solution. It is working.

                    Comment


                    • #11
                      TechTip: CALLing in Free-Format RPG IV

                      ** This thread discusses the article: TechTip: CALLing in Free-Format RPG IV **
                      richfull wrote: > I am trying to do a call to a CL, but the /Free callp doesn't work I > get an error message of: *RNF0604 20 a 02970 The token is not valid; > token is ignored. I also get the message: *RNF5410 30 029700 The > prototype for the call is not defined. (See code below.) > > I have been trying for YEARS to do calls in /Free, but I have yet to > get it to work. QCMDEXC does, but regular calls to other programs do > not. Chris already mentioned the extra fourth parameter. If you had wanted to pass that parameter, you would have had to fix the parameter name. The message RNF5410 was being issued because of the '&' in the 4th parameter. Callp Get_Msg (#ErrMsg : $MsgFil : $MsgLib : &MsDta); Right under the Callp line in your listing, there should be a line that starts with =====> and has an 'a' right under the & of MsDta. The compiler is trying to point out exactly where it found the error.

                      Comment

                      Working...
                      X