When reading this post I decided to create an identifer that would mimick the same behavior. Although it doesnt pass the results into a tokenized $1, $2 etc format, it does the same effect. If you want you can tokenize the results using a loop of sorts to achieve that. Here you go:
alias wreadini {
var %f = $iif($chr(32) isin $1,$+(",$1,"),$1), %l = 1, %r = 0, %p
if (($0 < 4) || (!$isfile(%f))) { echo $color(info) -q * Invalid parameters: $eval($wreadini,0) | return }
while ($ini(%f,$2,%l)) {
var %x = $ini(%f,$2,%l)
if ($eval($3,2) iswm %x) {
%p = $readini(%f,n,$2,%x)
inc %r
if (($4 != 0) && (%r = $4)) {
if ($5) {
if ($5 = 1) { return $+(%x,=,%p) }
elseif ($5 = 2) { return %x }
else { return %p }
}
else { return %p }
}
}
inc %l
}
if ($4 = 0) { return %r }
}
You would use the identifer in this way:
$wreadini(C:\my.ini,topic,search text,N,format)
N of course returns the Nth matching ini item. if N is 0 it returns total items found. Wildcard characters can be accepted in the search text. The format parameter can be used to return the results in a specific way such as:
0 = returns the value
1 = returns item=value
2 = returns item
3+ = returns value
Enjoy