mIRC Home    About    Download    Register    News    Help

Print Thread
#147684 22/04/06 03:26 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
I'd like to see $-N like you can do with $gettok:

$-1 returns the last token like $gettok($1-,-1,32)
$-2--1 returns the second to last and last tokens like $gettok($1-,-2--1,32)
$-3- returns the third to last token and onwards like $gettok($1-,-3-,32)

Then a suggestion for both $gettok and parameters; maybe allow positive to negative ranges, like this $2--1 and $gettok($1-,2--1,32)

#147685 24/04/06 09:24 AM
Joined: Sep 2005
Posts: 116
I
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
if u can already do it by gettok then why do u want it as a new paramter

aswel u can maybe do
Code:
alias -1 { $gettok($1-,-1,32) }
alias -2--1 { $gettok($1-,-2--1,32) }
alias -3- { $gettok($1-,-3-,32) }

#147686 24/04/06 02:55 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Then I would have to pass $1- as a parameter to $-1, which defeats the whole object of it.

I want it because it's a lot shorter than $gettok and it would offer more equality among the language.

#147687 25/04/06 12:37 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Your assumption that a SPACE $chr(32) does not exist in any of the $n values, can not be supported, thus your script examples fail.

ie: //echo -a $-3-(par 1,par 2,par 3,par 4,par 5)
4 par 5

Correct answer should have been par 3 par 4 par 5

#147688 25/04/06 07:58 AM
Joined: Jan 2006
Posts: 468
Fjord artisan
Offline
Fjord artisan
Joined: Jan 2006
Posts: 468
Exactly! This will be a nice addition to the mIRC built in identifiers, however the code shall be shorter and it’ll be handy.
I sign this suggestion too.

#147689 25/04/06 03:56 PM
Joined: Nov 2004
Posts: 842
Hoopy frood
Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
def. in favor of this.


What do you do at the end of the world? Are you busy? Will you save us?
#147690 27/04/06 07:27 AM
Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
Great shortcut , add me to the list of supporters.


$maybe
#147691 27/04/06 04:30 PM
Joined: Sep 2005
Posts: 116
I
Vogon poet
Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
oke me 2 then :tongue:


Link Copied to Clipboard