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
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.
/play is also much better for echoing all the lines of a text file to a window.
i think he meant, in addition to your suggestions, much better than a while loop...
btk
Yeah, sorry. I said "also," but I should have made sure that I was replying to the right person.
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)
It would definitely be nice to have commands and regular variables expanded to accept longer lines of text.