mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
I have a script which opens a window and add lines to it.

it is being created using:
window -als -t16,23,31,41,58,69,82 +bnstx


It is working fine, until the number of lines starting to grow.

Then, the window jumps to the position of the selected line. For example, I'm watching line 115, and the selected line is line 2, then it jumps to the second line.


This is very annoying, and I foudn out that the rline command is causing it. (some lines need to be replaced sometime).

I tried to do it otherwize by deleting the line, and then adding a line instead, and the same thing happened.


Do you know how this problem can be solved??
(I think it might be consider as a bug).

Last edited by saragani; 14/07/03 06:26 PM.
Joined: Dec 2002
Posts: 29
R
Ameglian cow
Offline
Ameglian cow
R
Joined: Dec 2002
Posts: 29
Do you use -s switch with rline command,beacouse -s selects newly added line to the window and deselects current selection,that switch may cause jumping to the new added line or replaced line.

Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
No, I'm not using the -s switch.

When using the rline (or when deleting a line) it just jumps to the selected line( the one which was selected before).

Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
Please help me.

I just created a window of my own:

/window -als @saragani

added lots of lines, and then selected the top line.

Went to the status window, and wrote: /timer 1 10 dline @saragani 100

Went back to the @saragani window, and after 10 seconds it jumped back to the top.

How the tell can I stop it from doing it.???

Joined: Dec 2002
Posts: 169
J
Vogon poet
Offline
Vogon poet
J
Joined: Dec 2002
Posts: 169
I think nobody is responding to your multiple posts about this issue because they can't help you. I know the problem but I was unable to find a way around it jumping back to the selected line. Even if I did /sline -r @window to unselect everything it still jumped back. I agree that it can be a bit annoying. Perhaps a good feature suggestion would be a switch for /aline, /cline, /dline, /iline, /rline, and /sline that makes mIRC not alter the scrollbar position of the @window.

Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
You have a sorted listwindow. If you are you use /rline in a sorted list, you can easily change the sort order.

In order to work around that, check to see if you have any currently selected lines. If you do, you want to save the actual text of each line selected in a tokenized variable or in a hash table. (In actual practice, you won't check, you'll just $addtok to a variable.
Code:
[color:#840017]

  var %slines, %i = 1
  while $line(@window, $sline(@window, %i).ln) != $null { 
    %slines = $addtok(%slines, $ifmatch, 255)
    inc %i
  }
[/color]
If there are no selected lines, it won't even enter the loop. Next, you do whatever code you need to do to rline or dline or whatever you want to do.
Code:
[color:#840017]

  rline @window 2 New text goes here
  ;  or
  dline @window 5
[/color]
Then you just reselect each of the lines by looping through the tokens into $fline.
Code:
[color:#840017]

  var %i = 1
  while $gettok(%slines, %i, 255) {
    sline -a @window $fline(@window, $ifmatch, 1)
    inc %i
  }
[/color]
At this point, your originally selected lines should be back reselected (if there were any). If your lines have very long text and you have a lot of lines selected, you might need to switch to using a temp hash table, storing the values of the selected lines in there, then reversing the process and destroying the hash table when you're done reselecting.

Is this what you had in mind or did I completely miss the point of your post?


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Feb 2003
Posts: 282
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Feb 2003
Posts: 282
LOL, I have no idea what you have just said grin

I need to take a good look in what you have wrote.



The window have lots of lines, and it is being ordered alphabeticly.


Lets assume I'm reading line 150, and the selected line is line number 1, then while I'm reading line 150, mIRC jumps to the selected line because another lines is being updated (And this is the problem. I don't want it to jump, cause it is interfiring with the reading).

rline or dline casues this problem.


Link Copied to Clipboard