mIRC Home    About    Download    Register    News    Help

Print Thread
Scrolling through a large file in a @window #198286 25/04/08 04:49 AM
Joined: Apr 2008
Posts: 2
Z
Zorkman777 Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Apr 2008
Posts: 2
mIRC Version: 6.31

I have a few month old log file that I want to view in a custom mirc @window.

The log file is:
12,509 KB
196,269 lines

I try to scroll with the (tiny) scrollbar from top to bottom, and when I get almost 1/3rd of the way through, the scrollbar goes back to the top, and I can't get past that point down the scroll bar. I don't get this issue with any files except really huge files. This doesn't happen when I view the same file with notepad.

I used:

/window @test
/loadbuf @test logs/really.long.file.log

To reproduce:

Try loading any really large log file into a custom window, for example your status log file.

Thanks.

Re: Scrolling through a large file in a @window [Re: Zorkman777] #198297 25/04/08 03:41 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I have logs that are 32k+ in size and they load fine. Is every large file affected, or only certain ones? It's possible some character or combination of characters if causing a problem.


Invision Support
#Invision on irc.irchighway.net
Re: Scrolling through a large file in a @window [Re: Riamus2] #198298 25/04/08 03:48 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
It's not the file size that matters, it's the number of lines. mirc's scrollbars cannot handle more than 65,536 lines (implying a 16-bit limit somewhere); after that limit the scrollbar wraps (jumps to the beginning).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Scrolling through a large file in a @window [Re: Zorkman777] #198300 25/04/08 04:02 PM
Joined: Apr 2008
Posts: 2
Z
Zorkman777 Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
Z
Joined: Apr 2008
Posts: 2
Thanks qwerty, but what is there that can be done about this? I want to be able to scroll through the entire file, it makes me feel trapped that I can't go any further than 65,536 lines, like I'm in a small box, sitting on the flaps that are the only way out, and I can't get out.

Re: Scrolling through a large file in a @window [Re: Zorkman777] #198305 25/04/08 06:00 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Do you really feel like you're trapped in a small box when you can't look at more then 65 thousand lines at a time?


...Scary.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Scrolling through a large file in a @window [Re: Zorkman777] #198307 25/04/08 06:41 PM
Joined: Dec 2002
Posts: 2,962
S
starbucks_mafia Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Well hopefully the bug will be fixed so the next version will work correctly with large numbers of lines. In the meantime there are a number of alternative methods of moving between lines that aren't affected by this bug:

  • Ctrl+Home and Ctrl+End will move backwards and forwards 65,000 lines at a time. Technically that's a bug too - they should always go to the first and last lines respectively - but for now they're a useful way of moving large "distances" in a window quickly.

  • Use the /sline command. /sline @window 100000 will go to the 100,000 line in the window (as the bottom line). You can use a simple alias to assign this action to an F-Key, eg.
    Code:
    alias f12 {
      if ($window($active).type == custom) {
        sline $active $$input(Enter line number to jump to:, e, Jump To Line)
      }
    }


    Put that in the Remotes tab of the Script Editor (Alt+R) and you can use F12 to input a line number to jump to. A lot more clunky than scrolling but it should see you through until the bug is fixed.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Re: Scrolling through a large file in a @window [Re: Zorkman777] #198311 25/04/08 07:21 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Here's another method that sort of works like real scrolling
Code:
menu @* {
  dclick: if ($mouse.key & 2) scroll
}
alias scroll {
  if (@* iswm $active) {
    if ($mouse.win == $v2 && $mouse.x isnum 0- $+ $window($active).dw && $mouse.y isnum 0- $+ $window($active).dh) {
      var %l = $line($active,0), %dh = $mid($v2,3), %my = $v1
      if (%my < 6) sline $active 1
      elseif ($calc(%dh - %my) < 6) sline $active %l
      else sline $active $calc(%my / %dh * %l)
    }
    if ($mouse.key & 1) .timerscroll 1 0 scroll
  }
}
Basically this allows you to scroll by 'grabbing' any point within the window's main text area. Due to lack of sufficient mouse events in non-picture windows, this must be activated by this method:
  • hold down Ctrl
  • doubleclick on the window but don't release the mouse
  • release Ctrl (if you want)
  • while still holding down the left mouse button, drag up/down
The biggest problem with this is that you may already have assigned a function to double click in your @window. If that's so, you'll have to come up with another starter event (eg an F-key), which I could try to accommodate. Alternatively, an always-on /timer could be used to check when Ctrl is held down.

Edit: fixed typo and improved behaviour towards the top/bottom
Edit 2: Ctrl is now necessary only to start the process: no need to hold it down afterwards (while scrolling)

Last edited by qwerty; 26/04/08 04:02 PM.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Scrolling through a large file in a @window [Re: qwerty] #198317 25/04/08 08:20 PM
Joined: Jul 2006
Posts: 3,702
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,702
Originally Posted By: qwerty
if ($mouse.key == 3) .timerscroll 1 0 scroll
What's the difference between using $mouse.key == 3 and $mouse.key & 2 ?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Scrolling through a large file in a @window [Re: Wims] #198318 25/04/08 08:29 PM
Joined: Jan 2003
Posts: 2,523
Q
qwerty Offline
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
$mouse.key & 2 only checks if Ctrl is held down, $mouse.key == 3 checks if Ctrl + left mouse button (and nothing else) are held down. I could've used == 2 or even == 3 in the first case, it doesn't really matter though, as in a doubleclick event the leftmost bit in $mouse.key is on (left button down).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Re: Scrolling through a large file in a @window [Re: qwerty] #198319 25/04/08 09:01 PM
Joined: Jul 2006
Posts: 3,702
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,702
Yes, in fact my real question was comparing "&" and "==", but you've answered both,
Thanks !


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Scrolling through a large file in a @window [Re: Zorkman777] #198642 02/05/08 02:24 PM
Joined: Dec 2002
Posts: 4,753
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,753
Thanks this has been fixed for the next version.