Voici un exemple, qui montre une façon de faire :
Bon, le nombre de parenthèses est un peu péjoratif, mais le principe est déjà utilisable.var
param array[] anytype
endvar
proc p(a anytype) smallint
param.addlast(a)
return(1)
endproc
proc tst(a smallint)
msginfo("Nb de paramètres",a)
param.view()
param.empty()
endproc
proc tadd(a smallint) number
var
result number
nb smallint
endvar
result=0
for nb from 1 to a
result=result+param[nb]
endfor
param.empty()
return result
endproc
method pushButton(var eventInfo Event)
var
r number
endvar
tst(p(1)+p(2)+p(3))
tst(p("Azerty")+p(1000))
tst(p(123456.78 ))
r=tadd(p(3)+p(4))
msginfo("3+4", r)
r=tadd(p(10)+p(1)+p(3)+p(22)+p(200)+p(1000))
msginfo("10+1+3+22+200+1000", r)
r=tadd(p(12345.67))
msginfo("12345.67", r)
endMethod
Prochaine étape : retourner un nombre variable de valeurs.
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)