mIRC Home    About    Download    Register    News    Help

Print Thread
Select all lines in a Custom window.... #133992 27/10/05 12:35 PM
Joined: Nov 2004
Posts: 148
D
Dr_Brom_sung_ Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Nov 2004
Posts: 148
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

Re: Select all lines in a Custom window.... #133993 28/10/05 12:41 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 } }

Re: Select all lines in a Custom window.... #133994 28/10/05 01:01 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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.


Gone.
Re: Select all lines in a Custom window.... #133995 28/10/05 07:35 AM
Joined: Nov 2004
Posts: 148
D
Dr_Brom_sung_ Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Nov 2004
Posts: 148
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).

Re: Select all lines in a Custom window.... #133996 28/10/05 08:09 AM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
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-) }
}


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Select all lines in a Custom window.... #133997 28/10/05 09:22 AM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
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 

Re: Select all lines in a Custom window.... #133998 28/10/05 10:27 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
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:


Gone.
Re: Select all lines in a Custom window.... #133999 28/10/05 05:35 PM
Joined: Nov 2004
Posts: 148
D
Dr_Brom_sung_ Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Nov 2004
Posts: 148
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....

Re: Select all lines in a Custom window.... #134000 28/10/05 10:19 PM
Joined: Apr 2003
Posts: 701
K
Kelder Offline
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
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