$maxlenl return the maximum number of characters that can safely be used in a statement in a script.
The current value is 10240
Line Length Limit
The value of this identifier return a bit less that the real limit. The real limit is often referred to as the line length limit, it was previously 4150 (where $maxlenl would most likely have returned a safe value of 4096), it is currently 8292, 100 more than the safe limit, this is to account for the length of the command, switches etc, but note that if you come up with a total length of 100+ for your command + switches (think about /write -w"longstringhere"), you obviously won't have 8192 character left, but less.
Versions History of $maxlenl and Line Length Limit:
- 4096+54=4150 TBD Version v6.xx through v7.52 (before $maxlenl identifier existed)
- 8192+100=8292 v7.53 through v7.61
- 10240+100=10340 v7.62 through current
Note that many identifiers chop strings at $maxlenl+100 instead of chopping at $maxlenl, which makes it difficult to use the output in a script. This next command shows that the output from $utfencode is chopped at $maxlenl+100, which does not leave any remaining room for anything else on the command line. The method for creating %c is one way to prevent the error which happens when trying to create %d:
//var %a $str($chr(10004),$maxlenl) | var -s %b $len($utfencode(%a)) | var %c $left($utfencode(%a),$maxlenl) | var %d $utfencode(%a)
As the value of this identifier changes and/or the +100 extra length changes, this can change the result of scripts. The next command shows that /bset silently chops this command from writing more than $maxlenl+100 bytes into the &binvar even though the string is a UTF8 string much longer than 20k bytes in length. $sha1 also chops the input at $maxlenl+100, which is why hashing the %a variable returns the same result as hashing a variable of length 10240+100=10340 bytes in length, even though this chop is in the middle of the multi-byte UTF8 encoding of a character.
//var %a $str($chr(10004),$maxlenl) | bset -tc &v 1 %a | echo -a $bvar(&v,0) -> $sha1(&v,1) same as $sha1(%a)
Added: mIRC v7.53
Added on: 29 Nov 2018
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.