ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Number of Parametesrs in CL program

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

  • Number of Parametesrs in CL program

    Hi, I was wondering if there is an API/BIF or any other method that I can check the number of parameters passed in to a CL program ?
    Basically I'm looking for something that will give me the same effect as %PARMS in RPG.

    Thanks in advance.

  • #2
    Re: Number of Parametesrs in CL program

    AFAIK there is nothing comparable with %PARMS in CL. The only way I'm aware of to check passed or not passed parameters is to use MONMSG to check for MCH3601.

    Birgitta

    Comment


    • #3
      Re: Number of Parametesrs in CL program

      Not sure if it makes sense and works as it does in RPG but if you're running V6R1 you should give a try to the CL's new *NULL special value support. I'm in a painful doubt though and can't test.

      PHP Code:
      pgm parm(&Parm1 &Parm2 ...)
      ...
      dcl  &ptrParm  type(*ptr)
      chgvar  var(&ptrParmvalue(%addr(&Parm1))
      if 
      cond(&ptrParm = *NULL then(do)
       
      /* Parm1 not passed ? */
      enddo
      chgvar  
      var(&ptrParmvalue(%addr(&Parm2))
      if 
      cond(&ptrParm = *NULL then(do)
       
      /* Parm2 not passed ? */
      ... 
      Last edited by Mercury; November 3, 2009, 07:09 AM. Reason: typo
      Philippe

      Comment


      • #4
        Re: Number of Parametesrs in CL program

        Hello people in V6, would you please let me know whether my previous post here makes sense, I am curious ? Thanks a bunch.
        Philippe

        Comment


        • #5
          Re: Number of Parametesrs in CL program

          I could do a test and it rocks as expected. Thanks myself.
          Philippe

          Comment


          • #6
            Re: Number of Parametesrs in CL program

            Mercury.... I like you half as much as you like yourself...and thats still 10 times
            more than one of your x-girlfriends.... Have a great weekend

            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


            • #7
              Re: Number of Parametesrs in CL program

              Thanks Jamie, I like your sense of irish humor
              Philippe

              Comment


              • #8
                Re: Number of Parametesrs in CL program

                Originally posted by Mercury View Post
                I could do a test and it rocks as expected. Thanks myself.
                Thanks for helping Phillipe out and testing that - good work !!!



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

                Comment


                • #9
                  Re: Number of Parametesrs in CL program

                  Thanks for the support Greg
                  Philippe

                  Comment

                  Working...
                  X