mIRC Home    About    Download    Register    News    Help

Print Thread
#164153 08/11/06 09:01 AM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
It would be nice to be able to replace, delete, or insert individual tokens. This method would have a bonus of being able to push spaces in to a single $[#] token (without having to do any additional extra scripting).

/tokenize -r1 This entire string replaces the string in $1
/tokenize -i2 This entire string is inserted in at $2
/tokenize -d3


NaquadaBomb
www.mirc-dll.com
#164154 08/11/06 10:59 AM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
I don't know how could this be useful (also it's easy to be workedaround) but if you post complex examples so we could see how useful it could be.

Last edited by b1ink; 08/11/06 10:59 AM.

Kind Regards, blink
#164155 08/11/06 09:03 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
It's just as useful as the existing /tokenize. No need for a complex example. smirk

Code:
; $code(filenameX-nopath.txt, filenameY-nopath.txt)
; The existing /tokenize is not very useful in identifers in this situation
;
alias code {
  tokenize -r1 $specialfolder $+ $1
  tokenize -r2 $specialfolder $+ $2
  echo -a Full path to file X: $1
  echo -a Full path to file Y: $2
}

BTW, along the same line of thought, another tokenize ability I'd like to see is the use of quotes...
/tokenize -q 32 "Hello This is a test" blah blah
Here $1 is equal to "Hello This is a test"


NaquadaBomb
www.mirc-dll.com
#164156 09/11/06 02:46 AM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
I really love to see this feature..


Kind Regards, blink
#164157 09/11/06 01:23 PM
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
So you're really just suggesting a shorthand version of /tokenize 32 $reptok/$instok/$deltok(...)

Since it can already be done I don't see much point, but saying that I'm all for multiple ways to do something.

#164158 10/11/06 06:09 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Its not as easy as that, assume this

$somefunction(<file>,<string>,<switches>,<otherparametter1>,<otherparametter2>,<otherparametter3>,<otherparametter4>,...)

and in alias somefunction under certian switches u want to add a path to $1 that path has spaces in it, and/or under other switches your going to replace words/phrases in the <string>

lets say $somefunction(my file.txt,my string is here for you,CMY)
C= add base folder and #chan folder to <file> so $+(%basefolder,\,$chan,\,$1)
M= replace my or me with $me in <string>
Y= replace you with $nick in <string>

Even assuming you can do them one at a time i would find it hard to handle them in the /tokenize command, it is possable maybe but not easy.
ex...
if (C isin $3) { /tokenize ??????? }
if (M isin $3) { /tokenize ??????? }
if (Y isin $3) { /tokenize ??????? }

With his suggestions they would be simple, i dont beleive $tok's well work well enough, remember %basefolder might hold "c:\program files\data dump", and no using short filenames i used a folder only as a example, it might be something u cant shoftfilename.


Link Copied to Clipboard