Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP9 test EXE doesn't respect parameters :-(
Message
From
23/12/2013 04:12:26
 
 
To
23/12/2013 02:46:47
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01590839
Message ID:
01590855
Views:
74
>Hi Al:
>
>Documentation doesn't mention specific restrictions of length of parameters, but I'm sure they are far below of the limits, counting that 1 var can have 16 MB of data and 1 command line can have up tu 8 KB, the line I'm executing with the EXE is far below the more restricted limit of 8192 bytes, and the longest parameter is below 254 chars.
>
>I just see that the problem have to do with some of the special characteres used ( "#", "/", ":", etc ), but I can't make this parameters shorter or substitute those simbols, because they are returned by a SCM tool.

Looking into it further, it looks like some kind of limitation on the total length of all parameters passed into the VFP EXE. I modified your test program:
PARAMETERS p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16,p17,p18,p19,p20,p21,p22,p23,p24,p25
MESSAGEBOX( "PCOUNT=" + TRANSFORM(PCOUNT()) )

lnPCount = PCOUNT( )

lnTotLength = 0

FOR lnIx = 1 TO lnPCount STEP 1	
	lcParam = "p" + LTRIM( STR( lnIx ) )
	
	lnTotLength = lnTotLength + LEN( EVALUATE( lcParam ) )
	
	? lcParam + ": [" + EVALUATE( lcParam ) + "] Cumulative Parameters Length: " + LTRIM( STR( lnTotLength ) )

ENDFOR

=INKEY( 0 )

RETURN
I did some testing with various parameters with no quotes:

tst.exe p1 - maximum length 247 without error

tst.exe p1 p2 p3, each parameter 100 chars long - does not error but shows 2 parameters

tst.exe p1 p2 p3, p1 and p2 = 100 characters, p3 = something less: if p3 is up to ~35 characters, it shows all parameters as expected. A few more than that, it starts to error. Still more, it doesn't error but it ignores the 3rd parameter.

So the parsing of parameters gets very weird when the total length of all parameters is somewhat less than 248. It would take some effort to exactly define how it actually "works" but it looks quite buggy. The 247 limit may include spaces between parameters, the space before the first parameter and/or quotes surrounding any parameter(s).

Bottom line, it looks like the total length of all parameters you're trying to pass to the VFP EXE is more than it is able to accept.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform