Optional Parameters

KMoody

Member
Is it possible to use optional parameters in OpenEdge 10.2.b? For example:
Code:
METHOD PUBLIC VOID createAllLog(INPUT isConcat INITIAL TRUE):
  IF isConcat THEN DO:
  .....
  END.
END METHOD.
  .....
/*call the function within the class:*/createAllLog().
createAllLog(FALSE).

I know that 10.2.b has function overloading, but if the difference between the two function versions is slight, this could involve a lot of repetition.
 
Yes - note: these are my first OO-dabblings - enjoyable!

Created with 11.2.1 but also works with 10.2B07

Code:
CLASS myClass:
 
 
   METHOD PUBLIC VOID myMethod ():
 
      THIS-OBJECT:myMethod( "look mum, no parameter!" ).
 
   END METHOD.
 
   METHOD PUBLIC VOID myMethod ( i_c AS CHARACTER ):
 
      MESSAGE i_c VIEW-AS ALERT-BOX.
 
   END METHOD.
 
 
 
END CLASS.

And the user:

Code:
DEFINE VARIABLE chello AS myClass.
 
chello = NEW myClass().
 
chello:myMethod().
chello:myMethod("cool").
 
Back
Top