Optional parameters in procedure calls and definitions

Post your requests and ideas on the future development of mikroBasic PRO for PIC32.
Post Reply
Author
Message
Eriond
Posts: 2
Joined: 30 Jan 2014 10:14

Optional parameters in procedure calls and definitions

#1 Post by Eriond » 03 Feb 2014 12:20

To add further flexibility, it would be useful to have certain/all parameters as optional, similar to the way other Basic dialects do it.
In M$ VB.Net, you add the keyword "optional" in front of the parameter and a default assignment after, so that the parameter gets initialized even if the calling code choose not to use it.

Effectively this translates to the more modern programming style of "overloads", meaning you have multiple definitions for the same procedure call. The compiler then picks the appropriate definition based on how the call was made.

Personally I prefer "optional", but that probably has more to do with my age than what is more effective... :oops:


Regards,
Eriond

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Optional parameters in procedure calls and definitions

#2 Post by filip » 04 Feb 2014 10:25

Hi,

Thank you for your suggestion, could you give us a small piece of code that demonstrates this feature, in the way you see it ?

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for PIC32 Wish List”