I wrote a simple script that echos a log file into an @ window, so as to be able to see original mIRC colors in the file.
Problem is that for every instance of " | " in the files (space on both sides) mIRC interprets that as a separator for commands.
An example can be seen in topics, which commonly have stuff like: this is some news | here is some more news
on a line like that, mIRC's $read will pick up "this is some news" and then display something like "HERE unknown command" in the status window, since "here" is what came after the |. So basically it's trying to do /here is some more news.
The "n" switch for $read doesn't affect this, since it's only for variables and identifiers. I've tried multiple things, including tokenizing, $remove, blah blah.... everything stops at the " | " while doing whatever it's doing, and tries to execute what comes after.
Anyone know how to fix? Here's the alias I have so far. To test, try using it on a text file or something with a few lines, one being like "something | something2"
lview {
if ($1 == reset) {
unset %lv.logdir
echo -a 4* Choose a new log directory.
}
if (%lv.logdir == $null) {
%lv.logdir = $sdir($mircdir,Select your log directory)
echo -a 4* Log directory set to %lv.logdir
echo -a 4* Rerun to read logs.
halt
}
window -ae @LogView
clear @LogView
set -u0 %lv.file $sfile(%lv.logdir,Select log to view)
set -u0 %lv.curline 1
echo @LogView 4*
echo @LogView 4* Reading: %lv.file ( $+ $lines(%lv.file) lines)
echo @LogView 4*
while (%lv.curline <= $lines(%lv.file)) {
if ($read(%lv.file,%lv.curline) == $null) echo @LogView $chr(160)
else {
echo @LogView $read(%lv.file,n,%lv.curline)
}
inc %lv.curline
}
}
Thanks.