mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2008
Posts: 2
Z
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.

Joined: Oct 2004
Posts: 8,330
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
Joined: Jan 2003
Posts: 2,523
Q
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
Joined: Apr 2008
Posts: 2
Z
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.

Joined: Oct 2003
Posts: 3,918
A
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"
Joined: Dec 2002
Posts: 2,962
S
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.
Joined: Jan 2003
Posts: 2,523
Q
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
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
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 ?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2003
Posts: 2,523
Q
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
Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
Yes, in fact my real question was comparing "&" and "==", but you've answered both,
Thanks !


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks this has been fixed for the next version.


Link Copied to Clipboard