Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command line length 8,192
Message
From
14/07/2014 16:57:40
 
 
To
14/07/2014 15:25:08
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01603641
Message ID:
01603674
Views:
76
>>>>>>>Hey all
>>>>>>>
>>>>>>>Is there a caveat missing from the help? I just built a set of command strings like this.
>>>>>>>
>>>>>>>
CLEAR
>>>>>>>CREATE CURSOR csrTest (cField1 c(10))
>>>>>>>lcCmd = ""
>>>>>>>DO WHILE LENC(m.lcCmd) < 4740
>>>>>>>	lcCmd = m.lcCmd + "csrTest.cField1 with csrTest.cField1,"
>>>>>>>ENDDO
>>>>>>>?LENC(m.lcCmd)
>>>>>>>lcCmd = LEFTC(m.lcCmd,LENC(m.lcCmd)-1)
>>>>>>>replace &lcCmd. IN csrTest
>>>>>>>
>>>>>>>The number 4740 is differing based on the actual alias and field names. The help says 8192 is the command line length. Obviously that's not completely accurate. What is the maximum length? How can one determine the maximum length before executing?
>>>>>>>
>>>>>>>Thanks
>>>>>>
>>>>>>Something else is at work here, not the length of the command, the error for a command that exceeds the max is "line too long" and not "syntax error"
>>>>>>
>>>>>>
>>>>>>lnLength		= 8190
>>>>>>EXECSCRIPT(REPLICATE('*', lnLength))
>>>>>>
>>>>>>lnLength		= 8191
>>>>>>EXECSCRIPT(REPLICATE('*', lnLength))
>>>>>>
>>>>>
>>>>>I agree it seems to be something other than command line length, except that even when there is no syntax error in the concatenated string, it generates a syntax error after exceeding a certain length.
>>>>
>>>>Have you tried to save the command as a file, and use execscript() to run it? How many times does the loop run before it errors?
>>>
>>>execscript fails at the same length just using the memvar. I would not ever want to create a file to execute for something like this.
>>
>>The reason why I asked, was that you then would have a text file which you could open in for instance notepad, to analyze.
>>
>>What about my question for the number of loops?
>>
>>Update: A test showed that the error occurred on the 129th run, 128 loops runs fine. 128 is 7 bits, I don't think that's a coincidence.
>
>Very good investigation technique. :)
>
>Thanks!

You're welcome!
Previous
Reply
Map
View

Click here to load this message in the networking platform