Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add Extra Parms To Method? Optional Parm? Overload?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Add Extra Parms To Method? Optional Parm? Overload?
Miscellaneous
Thread ID:
00687765
Message ID:
00687765
Views:
46
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.
Next
Reply
Map
View

Click here to load this message in the networking platform