mIRC Homepage
Is there any other way (for example smarter and faster) other than using the following alias:
/selectall @window

alias selectall {
var %a = 1
while (%a <= $line($1,0)) {
sline -a $1 %a
inc %a
}
}

Sline doesn't support multiple line selection (for example /sline @window 1-5), which is pitty. frown
Posted By: DaveC Re: Select all lines in a Custom window.... - 28/10/05 12:41 AM
Quote:
(for example smarter and faster)


lol, love the scope limiting, so you didnt get slower and dopeyer methods!


I think this well be a fraction faster. But i doubt by much over all.

alias selectall { var %i = $line($1,0) | while (%i) { sline -a $1 %i | dec %i } }
This will work slightly faster:

alias selectall set -u %win $$1 | filter -wkn $1 _selectall
alias _selectall sline -a %win $1

Requires 6.16

Note that the longer the line of data in each line is, the slower it will become, so on long lines it actually performs identical to the while loop. On shorter lines it goes faster, though the difference is small.
So you are using filter-->alias

Still when using those methods I see it scrolling the window while selecting all the lines.
I think that it will be a nice addition to have /sline for multiple lines.
This way something like ctrl+A can be implanted easy.


And DaveC. Smarter and Faster will be like using COM and somehow using the windows ability to do CTRL+A (which doesn't work in mIRC), or one of those ways of screwing with mIRC by using DLLs (which I couldn't find any DLL which allows you to catch ctrl+a, or other key combination, but only to simulate/fake them, or any DLL which let you do a select all lines).
Posted By: qwerty Re: Select all lines in a Custom window.... - 28/10/05 08:09 AM
Try
Code:
alias selectall window -a $$1 | sendkeys {HOME}+{END}
alias sendkeys {
  var %a = sendkeys $+ $ticks 
  .comopen %a WScript.Shell 
  if !$comerr { .comclose %a $com(%a,SendKeys,3,bstr,$1-) }
}
Posted By: Kelder Re: Select all lines in a Custom window.... - 28/10/05 09:22 AM
You can obtain a big speed improvement by first hiding the window before scrolling through it. This way all the displaying code in mIRC is skipped. Drawback is that you can see it disapear shortly and that might frighten people smile

I'd go for qwerty's code, no long wait, no disappearing windows smile

Code:
alias selectall {
  window -h $$1
  set -u %win $$1 
  filter -wkn $1 _selectall
  window -r $1
}
alias _selectall sline -a %win $1 
I would also specify the w flag when restoring the window, so that it appears again in the switchbar.

Indeed, the sendkeys method is the fastest, and rightfully.


PS: I enrolled myself for Lessen van de 21e eeuw! :tongue:
Quote:
Try
Code:
alias selectall window -a $$1 | sendkeys {HOME}+{END}
alias sendkeys {
  var %a = sendkeys $+ $ticks 
  .comopen %a WScript.Shell 
  if !$comerr { .comclose %a $com(%a,SendKeys,3,bstr,$1-) }
}





NICEEEEEEEE......!!!!!!! laugh laugh laugh laugh

Thats what I was talking about!!!!!!
Marking the first raw, and, pressing shift and then marking the last raw.

Im familiar with the sendkey code, but I never though it will become usefull.... Untill now. Finaly I found a use for it laugh


Thanks....
Posted By: Kelder Re: Select all lines in a Custom window.... - 28/10/05 10:19 PM
Actually the -r does exactly what I wanted it to do. However, I intended to use /window -n to minimize the window instead of hiding it... crazy grin


ps: those seminars are sometimes even really interesting too! grin
© mIRC Discussion Forums