From WikiChip
Editing mirc/identifiers/$maxlenl
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
== Line Length Limit == | == 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 | + | 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: | Versions History of $maxlenl and Line Length Limit: | ||
− | + | * 4096+54=4150 TBD Version v6.xx through v7.52 (before $maxlenl identifier existed) | |
− | * 4096+54=4150 Version v6. | + | * 8192+100=8292 v7.53 through v7.61 |
− | * 8192+100=8292 v7.53 through v7.61 | ||
* 10240+100=10340 v7.62 through current | * 10240+100=10340 v7.62 through current | ||
− | |||
− | |||
== Synopsis == | == Synopsis == | ||
<pre>$maxlenl</pre> | <pre>$maxlenl</pre> | ||
+ | |||
== Parameters == | == Parameters == | ||
None | None | ||
Line 28: | Line 26: | ||
//var %a $str($chr(10004),$maxlenl) | var -s %b $len($utfencode(%a)) | var %c $left($utfencode(%a),$maxlenl) | var %d $utfencode(%a)</source> | //var %a $str($chr(10004),$maxlenl) | var -s %b $len($utfencode(%a)) | var %c $left($utfencode(%a),$maxlenl) | var %d $utfencode(%a)</source> | ||
− | 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 | + | 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. |
− | |||
− | |||
− | |||
− | |||
− | |||
<source lang="mIRC"> | <source lang="mIRC"> | ||
− | //var % | + | //var %a $str($chr(10004),$maxlenl) | bset -tc &v 1 %a | echo -a $bvar(&v,0) -> $sha1(&v,1) same as $sha1(%a)</source> |
− | |||
− | |||
− | |||
− | |||
== Compatibility == | == Compatibility == |