mIRC Homepage
Posted By: Netchelandorious additional problems with $fopen - 10/10/03 12:18 AM
The first thing I noticed... /fseek doesn't support navigation by bytes only lines, and $fopen().pos doesn't return the position by lines, only in bytes? no way to get these two to work together (or I should say at least no practical way).

Also, the EOF doesn't seem to be $true when doing an /fseek -w that doesn't come up with a match (yet the $fopen().pos is 0) shouldn't it be EOF if we search to the end of the file or is this just the way /fseek is supposed to work?

too lazy to make another post with suggestions in the "Feature Suggestions" forum, gonna drop them right here...

/fseek doesn't have a setting for standard searching, only wildcard (what if I want to find an asterisk*?)
/fseek -n navigates relative to the current position, but only forward... can it be made to allow negative numbers so it can back up?
Posted By: cold Re: additional problems with $fopen - 10/10/03 02:29 AM
Quote:
/fseek doesn't have a setting for standard searching, only wildcard (what if I want to find an asterisk*?)

For that, you'd use "/fseek -r <name> \*".
Posted By: codemastr Re: additional problems with $fopen - 10/10/03 02:41 AM
Using regexp to find an * character is (to quote Confucius) like using a cannon to kill a mosquito. Regexp is powerful, and not exactly slow, but it is MUCH slower than simply searching for a literal character. There should be a -p (plaintext) or something like that imho. Using regexp is incredible overkill.
Posted By: cold Re: additional problems with $fopen - 10/10/03 03:08 AM
Yeah, but that is an workaround. Also, that's only really needed when you need *, ? and/or &.
Posted By: codemastr Re: additional problems with $fopen - 10/10/03 03:16 AM
Well yeah it's a workaround, but I'm saying I think it still should be changed. And also, it really is needed other times. Why should I bother having the increased processing to check for an *, &, or ? when I know I want to just search for the word "test"? Why not simply see if test is there. When using wildcards mIRC must do:

t:
is it a "*"?
is it a "?"?
is it a "&"?
no, it's a letter, check for t
e:
is it a "*"?
is it a "?"?
is it a "&"?
no, it's a letter, check for e
s:
is it a "*"?
is it a "?"?
is it a "&"?
no, it's a letter, check for s
t:
is it a "*"?
is it a "?"?
is it a "&"?
no, it's a letter, check for t

Why bother having all that extra checking when I already know that the answer to those questions will never be yes? Meaning, think of it this way, iswm can be used to do just about everything isin can, the reason isin is there is because there is no reason to check for wildcards if you don't care about wildcards.



Posted By: cold Re: additional problems with $fopen - 10/10/03 03:29 AM
I said the workaround was really needed for those chars.. not the suggestion. And I didn't say I disagree with it. I just offered something to use while it's not there. Unless, of course, you're going to use that workaround billions of times that its regex search could incredibly invalidate the utility you're scripting.
Posted By: Iori Re: additional problems with $fopen - 11/10/03 01:12 AM
/fseek <name> <position>
<position> - bytenumber-to-move-to
© mIRC Discussion Forums