Glad you turned down your Rumble in the Jumble talk!
Next is some benchmark code that mimics what my script does when a change has to occur.
It is not a setup to win an arguement.
It is really a mimication of the method I use.
I had a /filter problem in the past that proves I store my data this way:
https://forums.mirc.com/ubbthreads.php?ub...true#Post177646A line holds for ex. Network Channel OFF ON OFF and the most common access method is to change a token (here for ex. ON to OFF)
I use /filter (with some exceptions because it still lacks certain things) for mass operations, i.e. affecting more lines, like sorting or, in case a queue, to filter out all entries for a given network.
alias yay { echo -ag File: $yayF @window: $yay@ }
alias yayF {
var %i = 1 | while (%i < 1001) { write yay.txt a r g %i v 0 | inc %i }
var %t = $ticks, %i = 1
while (%i < 1001) {
var %rec = $read(yay.txt,nw,& & & 500 & &)
write -l 500 yay.txt $puttok(%rec,500,4,32)
inc %i
}
.remove yay.txt
return $calc($ticks - %t)
}
alias yay@ {
var %i = 1 | window -h @yay | while (%i < 1001) { aline @yay a r g %i v 0 | inc %i }
var %t = $ticks, %i = 1
while (%i < 1001) {
var %rec = $fline(@yay,& & & 500 & &,1).text
rline @yay 500 $puttok(%rec,500,4,32)
inc %i
}
window -c @yay
return $calc($ticks - %t)
}
If I type /yay then I see:
File: 3370 @window: 877
As you can see, the @window is almost 4 times faster.
Another example for my usage, I use it in case /filter can't be used due to wildcard symbol problems, if you want to search for a line that contains *!bla@yay.yo in a certain token position, false positives are possible due to /filter's seeing it as a wildcard symbol, same for cases of channel/user modes where the case of the character(s) matter.
; +++ MAIN FUNCTION BASE / ADVANCED FILTER @WINDOW OR FILE (IDENTIFIER CALL ONLY)
; Input: $1 = name of input window or filename $2 = ascii token separator used in input window
; $3 = <LlWw><position1>,<LlWw><position2>,etc $4 = token matchstring
; L (literal case sensitive) l (literal case insensitive) W (wildcard case sensitive) w (wildcard case insensitive)
; Output: $result = $null or name of results temp window with line format <original line position> <record>
alias SC_filter {
var %a = $2, %list = $3, %wm = $4
if (!$window($1)) { var %w = $SC_rw, %src = file | filter -fwc $+(",$1,") %w * } | else { var %w = $1, %src = win }
var %total1 = $line(%w,0), %total2 = $numtok(%list,44), %i1 = 1, %wr = $SC_rw
while (%i1 <= %total1) {
var %rec = $line(%w,%i1), %i2 = 1
while (%i2 <= %total2) {
var %tok = $gettok(%list,%i2,44), %pos = $mid(%tok,2), %s1 = $gettok(%wm,%pos,%a), %s2 = $gettok(%rec,%pos,%a)
goto $+(M,$asc($left(%tok,1)))
:M76 | if (%s1 !== %s2) { goto nexti1 } | inc %i2 | continue
:M108 | if (%s1 != %s2) { goto nexti1 } | inc %i2 | continue
:M87 | if (%s1 !iswmcs %s2) { goto nexti1 } | inc %i2 | continue
:M119 | if (%s1 !iswm %s2) { goto nexti1 } | inc %i2 | continue
}
aline -p %wr %i1 %rec
:nexti1 | inc %i1
}
if ($line(%wr,0)) { return %wr }
window -c %wr | return $null
}
Notice how I also use temp hidden custom windows with random generated names, as buffer.
mIRC lacks a storage method that is similar to custom windows, and that is in fact all I had and have to say in this thread.
I use custom windows because they suit the most.
The actual 'being a window' is an unwanted side-effect but it's exactly that makes it run into trouble.