Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command line length 8,192
Message
From
15/07/2014 11:15:14
Mike Yearwood
Toronto, Ontario, Canada
 
 
To
15/07/2014 09:23:13
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
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:
01603699
Views:
89
>>>>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.
>
>You don't need to want to. VFP does that for you. Check your temp folder after each execscript().

That's exactly my point. :) I'm executing a single command, not a block of code. There's no need for a file to be created on disk for a single line of code.

>
>BTW, wasn't it "the length of compiled command" that's limited to 8k? And it seems it reserves some space in it for local numerics, names, repackaging parameters etc, so YMMV. The size of compiled command may not be proportional to the size of its source.

I was able to get this particular replace command length to 8165 bytes and execute it at iteration 115.
ACTIVATE screen
CLEAR
CREATE CURSOR csrTemp (cThisIsAReallyCrazyLongFieldName c(10))
lcCmd = ""
FOR X = 1 TO 1000
	STORE lcCmd + "cThisIsAReallyCrazyLongFieldName with cThisIsAReallyCrazyLongFieldName," TO lcCmd
	?m.x,LEN(m.lcCmd)
	lcCmd2 = LEFT(m.lcCmd,LEN(m.lcCmd)-1)
	REPLACE &lcCmd2. IN csrTemp
ENDFOR
Previous
Reply
Map
View

Click here to load this message in the networking platform