mIRC Homepage
Posted By: Horstl /clipboard command not reliable? - 09/05/11 11:59 PM
With the following code, mIRC apparently misses one or more of the /clipboard commands
Code:
alias cbbug {
  clipboard
  var %string = A B C D E F G H I J K L M N O P Q R S T, %n = 1
  while ($gettok(%string,%n,32)) {
    clipboard -a $v1
    inc %n
  }
  var %copy = $cb
  echo -a clipboard: $len(%copy) $qt($cb(0).len) of $numtok(%string,32) chars:
  echo -a clipboard: $cb
  clipboard
}

; not required - just for convenience
alias cbtest {
  .timer -m 10 50 cbbug
}
Quote:
clipboard: 0 "19" of 20 chars:
clipboard: ABCDEGHIJKLMNOPQRST
clipboard: 18 "18" of 20 chars:
clipboard: ABCDFGHIJKLMNOQRST
clipboard: 18 "18" of 20 chars:
clipboard: ABCDEGHIJKLMNOPRST
clipboard: 37 "37" of 20 chars:
clipboard: ABCDEGHIJKLMNOPRSTABCDEFGHIJKMNOPQRST
clipboard: 18 "18" of 20 chars:
clipboard: ABCDFGHIJKLNOPQRST
clipboard: 19 "19" of 20 chars:
clipboard: ABCDFGHIJKLMNOPQRST
clipboard: 19 "19" of 20 chars:
clipboard: ABCDFGHIJKLMNOPQRST
clipboard: 18 "18" of 20 chars:
clipboard: ABCDFGHIJKLMNOQRST
clipboard: 18 "18" of 20 chars:
clipboard: ABCDFGHIJKLNOPQRST
clipboard: 20 "20" of 20 chars:
clipboard: ABCDEFGHIJKLMNOPQRST
clipboard: 15 "15" of 20 chars:
clipboard: ABCDEGHINOPQRST
clipboard: 18 "0" of 20 chars:
clipboard: ABCDEGHIJKLMOPQRST
clipboard: 0 "0" of 20 chars:
clipboard: ABCDEFGHIJKLMNOPQRST
[...]


Edit:
v7.19, XP mce; and it's not related to the -a switch:

Code:
alias cbbug2 {
  var %string = A B C D E F G H I J K L M N O P Q R S T, %n = 1, %copy
  while ($gettok(%string,%n,32)) {
    clipboard $v1
    var %copy = %copy $+ $cb
    inc %n
  }
  echo -a clipboard: $len(%copy) of $numtok(%string,32) chars: %copy
}
Quote:
clipboard: 20 of 20 chars: ABCDEFFHIJKLMMOPQRST
clipboard: 18 of 20 chars: ABCEFFHIJKLMNOPRST
clipboard: 14 of 20 chars: ACDDFHIMNPQRST
clipboard: 19 of 20 chars: ABCDEFGHIJKKMNOPRST
clipboard: 15 of 20 chars: ABCDDFHILMPQQST
[...]
Posted By: Riamus2 Re: /clipboard command not reliable? - 10/05/11 12:10 AM
Tested both on 7.19 Windows 7 and always get 20/20 without error.
Posted By: Wims Re: /clipboard command not reliable? - 10/05/11 01:11 AM
Same here, win7 and mIRC 7.19, can't reproduce it.
Tried on a clean mIRC?
Posted By: Horstl Re: /clipboard command not reliable? - 10/05/11 01:39 AM
I did (restarted the sys as well). I'll start checking with older versions now.
Posted By: Riamus2 Re: /clipboard command not reliable? - 10/05/11 02:09 AM
Use -s to display what the variables are set to at the time they are set and see if that helps you find the problem.
Posted By: drum Re: /clipboard command not reliable? - 10/05/11 07:49 AM
Do you have any other software running that could be monitoring/modifying the clipboard?
Posted By: Horstl Re: /clipboard command not reliable? - 10/05/11 11:53 PM
Several blind alleys later, I finally managed to identify the cause of the problem: a java applet with the ability to monitor the clipboard (to catch-and-process a set of specific urls on occasion), burried in my system startup routine.
Even though the actual cb monitoring option of the app was disabled for the time being, it apparantly kept reading the cb and thus, somehow, interfered with the rapid, successive cb-access attempts of mIRC.

Thanks to all who looked into the issue; sorry for the bother!
© mIRC Discussion Forums