mIRC Home    About    Download    Register    News    Help

Print Thread
#225076 25/08/10 06:46 AM
Joined: Aug 2010
Posts: 8
X
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
X
Joined: Aug 2010
Posts: 8
$cb() appearing to null the usage of data past the size of 4150 bytes. At first I was going to say that the number of lines of text (lines being defined as \r\n delimited lines) was limited, but I searched a little further and found out that it was actually the bytesize of the content of the clipboard that caused an error. Highlight and copy the following test data..

Quote:

............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
............................................................................................................................................
..
..
..
..
..
.

This consists of 29 rows of 140 periods, 5 rows of 2 periods, and 1 row of 1 period, (feel free to count them, haha), which totals up to 35 lines consisting of 4071 bytes (\r\n included is 4139). To test this weakness, let us make use of mIRC's /clipboard -an command to add on periods as well as increase line count.

Code:
//clipboard -an . | echo -a $cb(0).len

As you execute the code above, you will notice the pattern of the size of the clipboard increasing by 3 (as expected) due to appending a period followed by \r\n; we see this pattern cut off after a size of 4150, something that does not occur when using v6.35. If you were to paste the contents of the clipboard into a word processor, you will see that we indeed did append those extra periods, however, mIRC totally disgarded them and rendered their usage/existance useless. This cutoff of 4150 seems to be consistent across different test strings.

Last edited by Khaled; 25/08/10 08:24 AM.

irc.swiftirc.net #mSL,#xmrfunny1x
xmrfunny1x #225077 25/08/10 07:23 AM
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
this is related to how mIRC handles all strings and lines of code internally. it appears the entire clipboard contents (or, at least, the part capable of being returned by $cb()) is being stored as a single line at a lower level, perhaps related to $cb's ability to return the entire clipboard contents up until the first crlf - potentially 4,150 bytes for a suitably long line. this limit is imposed all throughout mIRC and you can see it in effect in the following examples:

Code:
//echo -a $right($str(a, 4150) b, 1)


= a

Code:
//echo -a $len($str(a, 4150) b)


= 4150

the intermediary strings are truncated by mIRC, which resembles the problem you mentioned. and when an identifier attempts to return a value exceeding 4,150 bytes in size you get the familiar error:

Code:
//echo -a $len($str(a, 4151) b)


* Line too long: $str

whether or not it is feasible to redesign the clipboard handling routines to accommodate more total text is hard to say :P perhaps Khaled could weigh in on it

Last edited by Khaled; 25/08/10 08:24 AM.

"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
xmrfunny1x #225080 25/08/10 08:26 AM
Joined: Dec 2002
Posts: 5,483
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,483
Thanks, the line length limit was affecting the whole of the retrieved clipboard text as opposed to being applied on a per line basis, this has been fixed for the next version.


Link Copied to Clipboard