WinBatch Limitations/Maximum Amounts
Assuming WinBatch 2004G or newer
The following limitations apply to WinBatch scripts and functions:
- Maximum script line length is 2048 characters.
- Variable length (name of variable) limited to 30 characters.
- All WinBatch variables MUST start with an alphabetic character. They may contain but not start with
numeric digits. If you name a variable something like, "852Path", you'll get an error message
that says something about, "Expression continues past expected end."
- Variable Size: Variable content length No defined limit.
Machine really bogs down after a while though. (Mine bogs at around 80MB.)
So there's no limit on the size of a string variable. Just limited by
available system memory. There is a hard maximum of 250MB of total string memory available except for 64-bit
WinBatch version 2018B and newer where the limit is 375MB.
- The total number of Variables is just under 2000.
If your script uses more than that, you would need to drop unused ones to free up variable spaces for newer ones.
To list the number of variables used:
list=IntControl(77,12,0,0,0)
AskItemList("My Variables",list,@tab,@sorted,@single)
- The max number of characters a string can contain is undefined. Long (10 MB+) strings can
impact script performance. The OS provides a fix amount of memory for each running process and WinBatch
has fixed maximum amount of that allotted memory it will use for its string table. The OS per process
allotted amount of memory does not general increase with an increase in the total amount of system memory.
The one very rare exception being the case of a system have very little memory and very limited disk space
for the system memory page file. In short, adding more memory will not give you more string space.
- The number of characters per line cannot exceed 2048.
INI strings are limited by the OS.
Windows 95/98/ME INI strings are limited to 255 characters per line.
NT/2000/XP/2003+ are limited to 65535 characters per line (in ANSI mode at least).
If you need to exceed this line length, use FileOpen to open a file and
FileWrite to write your data out.
NOTE: If you use %substitution% you will easily run into line length problems.
For example:
aaa="aaaa...a whole lot stuff here...aaa"
bbb="an even longer string"
Now if you glue them together like this:
ccc="%aaa%%bbb%"
you can run into substitution difficulties when the string hits 2048 characters.
Instead do:
ccc=strcat(aaa,bbb)
and avoid %substitution% completely.
- The number of controls in the Dialog Editor is restricted to 200 in versions 2009B and older, 300 in version 2009C through version 2017a. Version
2018B and newer permit 500 controls.
- The Dialog Editor can have a maximum of 9 choices per variable assigned
to a Radio Button.
- The ITEMBOX control in the Dialog Editor has a miximum allowable line length of 255 characters.
If it sees a item over 255, it gives up and displays what it has.
- The BoxButtonDraw function, which draws buttons in a WinBatch "box"
window, is limited to 16 buttons per box window, but you can have up to 8
separate box windows, so you could have up to 128 buttons spread out over all the box
windows. The limit is 16 buttons per box window. You may have up to 7 additional
child box windows embedded in the first one for a total of 8.
With a little bit of finagling you can get (I think) 128 buttons max.
Or you can use dialogs, and in a dialog you can get 200 buttons in versions 2009B and older, 300 buttons in versions 2009C and newer.
- The graphics stack in the Boxes functions is about 169 elements deep.
- The total amount of variable string space is limited to 250MB. String spaced increased to 375MB for 64-bit versions of WinBatch in version 2018B and newer.
-
WinBatch 2013C and older: The number of extenders is restricted to 10 DLLs. The total number of functions and constants of added extenders, collectively cannot exceed 500.
WinBatch 2014A and Newer: The number of extenders is restricted to 32 DLLs. The total number of functions and constants of added extenders, collectively cannot exceed 750.
The AddExtender function is smart. If it is already loaded, AddExtender just returns. It does not chew up any additional slots of any kind. If you have more than one "AddExtender" for the same extender in the same script, only the first one would be honored.
Each instance of a script can load up to its limit on extenders or up to itls limit on new functions/constants from the extenders. Whichever comes first.This limitation applies to a single instance of a script. Separate scripts running are all independent.
Currently there is no limit to the number of functions an extender may support, but if it exceeds WinBatches limit, then WinBatch will not support them.
- You can Call an unlimited number of WBT files from the main WBT file, making WinBatch infinitely expandable. Basically the number of Calls is unlimited, but you are not allowed to get more than
6 levels deep. In other words, there can
not be more than 6 CALLS that have not RETURNED outstanding at one time.
- The number of structured statements (if/endif, while/endwhile, goto, gosub, etc.)
are limited to a total of 100 levels deep, and using goto's or gosub's inside of loops
can use up the levels fairly quickly. See the following article:
Nesting of Structures Too Complex or Deep
- Label names are limited to 254 plus the ":" = 255 chars.
- Integer constants are built from the digits 0 through 9. They can range in
magnitude from negative to positive 2,147,483,648. Constants larger than these
permissible magnitudes will produce unpredictable results.
- Floating point numbers are limited to 10^300 (10 to the 300th).
- On a FileOpen function, you are limited to a maximum of 128 files open at one time.
- In the FileRead function, the default line length to read is 4096 bytes.
See IntControl 65 to change the maximum line length for file reads.
- INI files (all kinds) are handled by windows.
In Windows 95, 98, and MEINI files are limited to 64K in size.
This is a Windows limitation. In Windows NT/2000 does not have
this restriction and INI files can be any size.
- AskItemList and AskFileText were designed for a handful of choices.
The list should not exceed about 1200 characters in size. For larger lists,
you may need to "two stage" it, where in state 1 the user selects from a
"A-B", "B-C", etc., "Y-Z" sort of list.
-
Message boxes in Windows seem to be limited to 32000 characters:
It you attempt to display more that, in a Message box it can cause WinBatch to crash.
- Maximum for Binary Allocate.
RamSize+PagingFileSize-1Mb
But may not exceed about 750MB except for 64-bit WinBatch 2018B and newer were the limit is 2GB
BinaryBuffer sizes over about 250MB are not recommended.
- Maximum number of UDFs in a main plus called Winbatch scripts is 512.
- Maximum parameters passed to UDF is 16 parameters. Possible workaround:
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/UDF~-~UDS~Library+UDF~UDS~Parameter~Limit.txt
- Command Line Limit: There is currently no limit to number of commandline parameters that WinBatch accepts.
However there does seem to be a line length limit enforeced by Windows. On computers running Microsoft Windows XP or later,
the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft
Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters.
Reference: http://support.microsoft.com/default.aspx?scid=kb;en-us;830473
Article ID: W12996
Filename: Limitations - Maximum Amounts .txt
File Created: 2018:06:07:08:28:28
Last Updated: 2018:06:07:08:28:28