mIRC Home    About    Download    Register    News    Help

Print Thread
#88499 28/06/04 06:42 PM
Joined: Dec 2002
Posts: 1,922
O
Online Offline OP
Hoopy frood
OP Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
  1. Make $regsub() return the output text, instead the the number of substitutions, if no %var parameter is specified. For example,

    echo -a $regsub([name,] text, /re/, subtext)
    var %result = $regsub([name,] text, /re/, subtext)
    alias blah { return $regsub([name,] text, /re/, subtext) }
  2. Make the Channels List window display 'non-text channels' by default.

#88500 28/06/04 08:34 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I would LOVE to see the first feature added.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#88501 28/06/04 08:52 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
1 is really wanted.
IMHO, $regsub(), even though it does return something, has obviously a main purpose and, for that purpose, it currently just acts as a regular /command, instead of an identifier. Meaning, it returns a number, but what generally matters is the specified %var it modifies/creates.
Think about having to use .echo -q $tokenize(%text,32) to tokenize %text, when the identifier returns the number of tokens created (and you don't care about this number). It's a similar thing.
This behaviour doesn't seem consistent to me and what's suggested here would make much more sense...

Last edited by cold; 28/06/04 08:57 PM.

* cold edits his posts 24/7
#88502 30/06/04 11:30 AM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
I do like to see that feature, but there are uses for the number of substitutions, i have some while ($regsub(blah)) loops, so please keep this feature also.

A problem might be that there will be 2 optional arguments, the %var at the end and the $regml identifier at the start. This can be difficult to parse if there are 3 arguments given. Maybe the no-%var regsub should get another name or make the last parameter 0 or $null if no %var is present?

#88503 30/06/04 11:08 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
Yeah, that's why I said "generally". Implementing new .properties would solve these issues.


* cold edits his posts 24/7
#88504 13/01/06 02:19 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I would absolutely love to see your first suggestion regarding $regsub added.

I have used $regsub a lot, in cases where knowing how many substitutions there were (what $regsub returns), and in cases where I only cared about the substituted result, and to be honest, 90% of the cases is the latter case, for me and most people.

$regsub dynamically re-evaluating the substitution part would also be a nice new feature, something that's been suggested a couple of times before I think.


Gone.

Link Copied to Clipboard