ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Question on OVERLOAD

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

  • Question on OVERLOAD

    A question of curiosity.
    I know I could test this, but I can save myself the effort if someone already knows.
    This is a scenario that I may be facing in the near future.

    Suppose there are two prototypes:

    Code:
    dcl-pr ProcA ...
      i_parm  pointer const options(*string);
    end-pr;
    
    dcl-pr ProcB ...
      i_parm  varchar(64000) const;
    end-pr;
    And I also have...
    Code:
    dcl-pr MyProc overload(ProcA:ProcB);
    If I ...
    Code:
    MyProc('Here is my parameter value');
    Which procedure gets called?

  • #2
    Neither. It won't compile. The compiler cannot differentiate between the two.

    Comment

    Working...
    X