mIRC Home    About    Download    Register    News    Help

Print Thread
additional problems with $fopen #53202 10/10/03 12:18 AM
Joined: Dec 2002
Posts: 31
N
Netchelandorious Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 31
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?

Re: additional problems with $fopen #53203 10/10/03 02:29 AM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
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> \*".


* cold edits his posts 24/7
Re: additional problems with $fopen #53204 10/10/03 02:41 AM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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.

Re: additional problems with $fopen #53205 10/10/03 03:08 AM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Yeah, but that is an workaround. Also, that's only really needed when you need *, ? and/or &.


* cold edits his posts 24/7
Re: additional problems with $fopen #53206 10/10/03 03:16 AM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
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.




Re: additional problems with $fopen #53207 10/10/03 03:29 AM
Joined: Feb 2003
Posts: 810
C
cold Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
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.


* cold edits his posts 24/7
Re: additional problems with $fopen #53208 11/10/03 01:12 AM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
/fseek <name> <position>
<position> - bytenumber-to-move-to