|
|
Joined: Jul 2006
Posts: 242
Fjord artisan
|
OP
Fjord artisan
Joined: Jul 2006
Posts: 242 |
Hello I have a file with 306706 lines in it. when i use a while to loop through all the lines and echo them into a window mIRC will crash after say 400 lines. Any ideas on why this is happening or any workarounds would be appreciated. Thanks
Newbie
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
Well I don't know why it would crash after 400 lines but you'll never get 306706 lines into a window anyway, there's a limit on the number of lines a window can hold in it's buffer (display at once).
As a note, if you're putting the entire file into the window you can use loadbuf or filter and it'll be thousands of times faster than looping with $read(), however that still won't overcome the window buffer limit I mentioned. There's no way to get around that as far as I'm aware.
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
/play is also much better for echoing all the lines of a text file to a window.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
i think he meant, in addition to your suggestions, much better than a while loop... btk
Last edited by billythekid; 08/12/06 10:52 PM.
billythekid
|
|
|
|
Joined: Dec 2002
Posts: 2,962
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,962 |
Spelling mistakes, grammatical errors, and stupid comments are intentional.
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
Yeah, sorry. I said "also," but I should have made sure that I was replying to the right person.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
Joined: Jun 2004
Posts: 19
Pikka bird
|
Pikka bird
Joined: Jun 2004
Posts: 19 |
I have the same issue when I'm working with downloaded HTTP data. Long lines of text are hard to break up using a while loop, especially if you're analyzing the file for html tags b/c if you break them up at the wrong point some tags may be still left in there.
P.S: If you think that's hard, try working with POSTdata files - in order to tell where each file in that list started I actually had to have it read a set amount, then read that minus 25 in position, then minus 50, then minus 75 before going on to read the next section of data lol. Now that was some crazy stuff! (Analyzing lengths of binary for certain values is not quite easy)
|
|
|
|
Joined: Oct 2004
Posts: 8,330
Hoopy frood
|
Hoopy frood
Joined: Oct 2004
Posts: 8,330 |
It would definitely be nice to have commands and regular variables expanded to accept longer lines of text.
Invision Support #Invision on irc.irchighway.net
|
|
|
|
|
|