Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Maximum length for a variable

Jan
45
0
My program to reformat text files reads the entire fire into a variable. Program works fine, but when it hit a file that was 8,773 bytes, TCC gave up the ghost. (Windows reported it; TCC was already dead.)
I have a work around, but am curious what is the maximum size for a variable? Can it be increased to, say 11 KB?
 
Thanks. I dug into it and it was @Xreplace that failed. When I changed all my Xreplace to Rereplace, everything worked. :-)
I'll post a note to the Plugins forum.
 
TCC has no limit (other than available memory) for variables or input lines (at least for v17 or later). However, many Windows APIs have maximum size limits for their arguments. Without an example of what you're doing, I can't guess what limit you're running up against.
What limit (apparently ~32K) am I running into when I do this (and TCC disappears)? It would seem there's a limit on what a variable function can return.
Code:
v:\> unset zz

v:\> do i=1 to 9000 ( set zz=%[zz]0 )

v:\> echo %@rereplace[0,1111,%zz]
 
Vince, your test was not as fatal as mine - with yours, TCC restarted. With mine, it never came back. ;-)
 
Vince, your test was not as fatal as mine - with yours, TCC restarted. With mine, it never came back. ;-)
It didn't restart. It just disappeared ... process ended ... no messages from windows ... no exception log.
 
What limit (apparently ~32K) am I running into when I do this (and TCC disappears)? It would seem there's a limit on what a variable function can return.

What you're running into is the Windows 32K limit on filenames. And @REREPLACE is intended for filename substitution & calls Windows APIs (where the crash is occurring).

@REREPLACE is the wrong solution for this problem. TPIPE is intended for processing files; @REREPLACE is intended for processing filenames.
 
What is the size of the pszArguments buffer for a plugin variable or variable function? The "Plugins" help page says 2K but I'm pretty sure it's more than that these days.
 

Similar threads

Back
Top