skyyakal Posted January 19, 2004 Posted January 19, 2004 Is there a possibility to call a function without giving the number of arguments? for example DIM func(LaLaLaLa) As Integer and then call for example one time func(4, 7, 3, 8) and the second time func(1, 3)? Would appreciate the answer. Quote
Moderators Robby Posted January 19, 2004 Moderators Posted January 19, 2004 Yes, if you overload the fuction, meaning that you need to create the let's say three functions with the same name but different signature on each, eg. Private myFunc() as string 'TODO End Function Private myFunc(x as integer) as string 'TODO End Function Private myFunc(x as integer, y as integer) as string 'TODO End Function Private myFunc(x as integer, y as integer, s as string) as string 'TODO End Function Quote Visit...Bassic Software
*Experts* DiverDan Posted January 19, 2004 *Experts* Posted January 19, 2004 You can also set the function to it's maximum arguments and only utilize those necessary depending on its requirements at the time. In fact, one of the arguments could be the determinator to which calculations are used and by which variables. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.