Undetermined number of parameters

  • Thread starter Sebastien DErrico
  • Start date
Status
Not open for further replies.
S

Sebastien DErrico

Guest
Somehow, System.String:Format exists but does not seem to works.

DEFINE VARIABLE strValue AS CHARACTER NO-UNDO.
strValue = "Sebastien".
MESSAGE System.String:Format("Hello {0}", strValue) VIEW-AS ALERT-BOX.


The result was "Hello C:\temp\run.p" instead of "Hello Sebastien".

So I decided to create an equivalent function.

How is it possible to declare a method with undetermined number of parameters?

Example:

METHOD PUBLIC INTEGER Calculate(
INPUT iMultiply AS INTEGER
,INPUT iInt1 AS INTEGER
,INPUT iInt2 AS INTEGER
...
,INPUT iIntX AS INTEGER):

RETURN iMultiply * (iInt1 + iInt2, ..., iIntX).

END METHOD.


Thank you! Sebastien

Continue reading...
 
Status
Not open for further replies.
Top