mIRC Home    About    Download    Register    News    Help

Topic Options
#198286 - 25/04/08 05:49 AM Scrolling through a large file in a @window
Zorkman777 Offline
Bowl of petunias

Registered: 25/04/08
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.

Top
#198297 - 25/04/08 04:41 PM Re: Scrolling through a large file in a @window [Re: Zorkman777]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
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

Top
#198298 - 25/04/08 04:48 PM Re: Scrolling through a large file in a @window [Re: Riamus2]
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
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

Top
#198300 - 25/04/08 05:02 PM Re: Scrolling through a large file in a @window [Re: Zorkman777]
Zorkman777 Offline
Bowl of petunias

Registered: 25/04/08
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.

Top
#198305 - 25/04/08 07:00 PM Re: Scrolling through a large file in a @window [Re: Zorkman777]
argv0 Offline
Planetary brain

Registered: 13/10/03
Posts: 3918
Loc: Montreal, QC, Canada
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"

Top
#198307 - 25/04/08 07:41 PM Re: Scrolling through a large file in a @window [Re: Zorkman777]
starbucks_mafia Offline
Hoopy frood

Registered: 09/12/02
Posts: 2962
Loc: Norwich, UK
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.

Top
#198311 - 25/04/08 08:21 PM Re: Scrolling through a large file in a @window [Re: Zorkman777]
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
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)


Edited by qwerty (26/04/08 05:02 PM)
_________________________
/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Top
#198317 - 25/04/08 09:20 PM Re: Scrolling through a large file in a @window [Re: qwerty]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3475
Loc: France
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

Top
#198318 - 25/04/08 09:29 PM Re: Scrolling through a large file in a @window [Re: Wims]
qwerty Offline
Hoopy frood

Registered: 07/01/03
Posts: 2523
$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

Top
#198319 - 25/04/08 10:01 PM Re: Scrolling through a large file in a @window [Re: qwerty]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3475
Loc: France
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

Top
#198642 - 02/05/08 03:24 PM Re: Scrolling through a large file in a @window [Re: Zorkman777]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4379
Loc: London, UK
Thanks this has been fixed for the next version.

Top