Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The real maximum number of parameters
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
The real maximum number of parameters
Miscellaneous
Thread ID:
00903548
Message ID:
00903548
Views:
55
VFP 8 documentation states that the maximum nuimber of parameters that can be passed to a procedure is 26. I have always thought that the parameters restriction was a bit rough, and have hoped that it would one day increase.

I thought I might test this with VFP 8 and PROCEDURE and FUNCTION calls. I found that it was possible to pass 27 parameters to a FUNCTION, and a lot more to a PROCEDURE.
*-- Test for maximum number of parameters VFP 8
DO l_testparm WITH 1, ;
                   2, ;
                   3, ;
                   4, ;
                   5, ;
                   6, ;
                   7, ;
                   8, ;
                   9, ;
                   10, ;
                   11, ;
                   12, ;
                   13, ;
                   14, ;
                   15, ;
                   16, ;
                   17, ;
                   18, ;
                   19, ;
                   20, ;
                   21, ;
                   22, ;
                   23, ;
                   24, ;
                   25, ;
                   26, ;
                   27, ;
                   28, ;
                   29, ;
                   30, ;
                   31, ;
                   32, ;
                   33, ;
                   34, ;
                   35, ;
                   36, ;
                   37, ;
                   38, ;
                   39, ;
                   40

= l_testpar2(1, ;
             2, ;
             3, ;
             4, ;
             5, ;
             6, ;
             7, ;
             8, ;
             9, ;
             10, ;
             11, ;
             12, ;
             13, ;
             14, ;
             15, ;
             16, ;
             17, ;
             18, ;
             19, ;
             20, ;
             21, ;
             22, ;
             23, ;
             24, ;
             25, ;
             26, ;
             27)

PROCEDURE l_testparm
PARAMETERS lx_1, ;
           lx_2, ;
           lx_3, ;
           lx_4, ;
           lx_5, ;
           lx_6, ;
           lx_7, ;
           lx_8, ;
           lx_9, ;
           lx_10, ;
           lx_11, ;
           lx_12, ;
           lx_13, ;
           lx_14, ;
           lx_15, ;
           lx_16, ;
           lx_17, ;
           lx_18, ;
           lx_19, ;
           lx_20, ;
           lx_21, ;
           lx_22, ;
           lx_23, ;
           lx_24, ;
           lx_25, ;
           lx_26, ;
           lx_27, ;
           lx_28, ;
           lx_29, ;
           lx_30, ;
           lx_31, ;
           lx_32, ;
           lx_33, ;
           lx_34, ;
           lx_35, ;
           lx_36, ;
           lx_37, ;
           lx_38, ;
           lx_39, ;
           lx_40

SET STEP ON

RETURN


FUNCTION l_testpar2
PARAMETERS lx_1, ;
           lx_2, ;
           lx_3, ;
           lx_4, ;
           lx_5, ;
           lx_6, ;
           lx_7, ;
           lx_8, ;
           lx_9, ;
           lx_10, ;
           lx_11, ;
           lx_12, ;
           lx_13, ;
           lx_14, ;
           lx_15, ;
           lx_16, ;
           lx_17, ;
           lx_18, ;
           lx_19, ;
           lx_20, ;
           lx_21, ;
           lx_22, ;
           lx_23, ;
           lx_24, ;
           lx_25, ;
           lx_26, ;
           lx_27

SET STEP ON

RETURN
Can anyone comment on this? Is their no limit to parameters into a PROCEDURE because they are passed by reference?
Next
Reply
Map
View

Click here to load this message in the networking platform