Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Max number of parameters
Message
From
28/06/2021 22:10:07
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01681616
Message ID:
01681621
Views:
67
>>>I can't find it in the VFP 9 help. What is the max number of parameter can be passed to a function?
>>
>>26, according to https://www.vfphelp.com/vfp9/_5wn12pc8v.htm
>>
>>That can be worked around with parameter object(s).
>
>I was getting an error and I sensed that the reason was the extra parameter I added. You confirmed it.
>Thank you.
>
>Yes, this is what I am working on now, changing the parameters with the parameter object.

Take an eagles eye view b4 coding. Parameter objects have their problems as well if needed on long stretches of stack and in vfp, as a very high level, but relatively slow interpreter language in particular. Been there in an app depending on parameter object for almost every 2nd method call - the cloning on each stack level still hurt after I created a discrete parameter stack to avoid always creating and destroying parameter objects.

Parameter objects work much better in statically typed languages like C, C# and Java, as "throwaway objects" are much cheaper there.

Not knowing the particular corner you painted yourself in needing that many parameters, not easy to point to other solutions, but think on creating a few objects with 4..9 properties each used in methods of said object. Pure gut SWAG: staying in functions but NEEDING parameter object is only in 1 of 12 times best way to design that part.

again - been there, was too late for total redesign, had to patch. Think hard before coding. Also think on composition over inheritance.

thomas
Previous
Reply
Map
View

Click here to load this message in the networking platform