From WikiChip
Difference between revisions of "mirc/identifiers/$sorttok"
< mirc‎ | identifiers

m
m
Line 1: Line 1:
 
{{mirc title|$sorttok identifier}}'''$sorttok''' sorts the token in text.
 
{{mirc title|$sorttok identifier}}'''$sorttok''' sorts the token in text.
 
  
 
== Synopsis ==
 
== Synopsis ==
<pre>$sorttokcs(<list>,C[,nrca])</pre>
+
<pre>$sorttok(<list>,C[,nrca])</pre>
  
== Paramters ==
+
== Parameters ==
  
 
* '''<list>''' - The list of tokens (can be empty)
 
* '''<list>''' - The list of tokens (can be empty)
 
* '''<C>''' - The ascii number (or code point) of the character seperating the tokens
 
* '''<C>''' - The ascii number (or code point) of the character seperating the tokens
* '''ncra''' - default is alphabetical sort, n = numeric sort; c = channel prefix sort; r = reverse; a = alphanumeric sort
+
* '''ncra''' - default is alphabetical sort (ASCII order) if 3rd parameter not used, n = numeric sort; c = channel prefix sort; r = reverse; a = ASCII sort
 +
 
 +
Note: 'a' sort is case-insensitive. For case-insensitive use $sorttokcs
  
 
== Properties ==
 
== Properties ==
Line 15: Line 16:
  
 
== Example ==
 
== Example ==
<source lang="mIRC">//echo -a $sorttok(C a c b A B,32,a)</source>
+
<source lang="mIRC">//echo -a $sorttok(C a c b A B,32,a)
 +
 
 +
//echo -a Sorted in ASCII order: $sorttok( $chr(10004) $chr(9650) $chr(9660) , 32)
 +
</source>
 +
 
 +
<source lang="mIRC">
 +
alias NumericMax {
 +
  return $gettok($sorttok($1- , 32 , rn),1,32)
 +
}
 +
</source>
  
 
== Compatibility ==
 
== Compatibility ==

Revision as of 20:57, 8 January 2018

$sorttok sorts the token in text.

Synopsis

$sorttok(<list>,C[,nrca])

Parameters

  • <list> - The list of tokens (can be empty)
  • <C> - The ascii number (or code point) of the character seperating the tokens
  • ncra - default is alphabetical sort (ASCII order) if 3rd parameter not used, n = numeric sort; c = channel prefix sort; r = reverse; a = ASCII sort

Note: 'a' sort is case-insensitive. For case-insensitive use $sorttokcs

Properties

None

Example

//echo -a $sorttok(C a c b A B,32,a)
 
//echo -a Sorted in ASCII order: $sorttok( $chr(10004) $chr(9650) $chr(9660) , 32)
alias NumericMax {
  return $gettok($sorttok($1- , 32 , rn),1,32)
}

Compatibility

Added: mIRC v4.7
Added on: 09 Dec 1996
Note: Unless otherwise stated, this was the date of original functionality.
Further enhancements may have been made in later versions.


See also

[Expand]
v · d · e mIRC identifier list