Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Add Extra Parms To Method? Optional Parm? Overload?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Add Extra Parms To Method? Optional Parm? Overload?
Divers
Thread ID:
00687765
Message ID:
00687765
Vues:
47
c:\wintemp\aaaaaa.prg:
Function DoIt
LParameters cParm1 as Character && btw what is diff between Character/String?
  cRetVal = "A " + cParm1
Return cRetVal
EndFunc
In command window, type:
Set Procedure to c:\wintemp\aaaaaa.prg
? DoIt("E")       && You will see:  A E
? DoIt("E",B")    && You will see:  Program Error Must specify additional parameters
I want the second parameter to be optional. I can go the other way easily enough, but I want to kind of "overload" the function call when I need to. Is there a way to throw additional parameters at a function/method?

Thanks.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform