$ORDTOK

By SyntaxIRC on Mar 08, 2008

Usage: $ordtok(TOKEN,C,?)

Will return entered numbers as ords (1.4.2 = 1st.2nd.4th) and as you can see, will sort them in reverse or put them in order (if you used $ordtok(4.1,46,nr) - it would return it in reverse)

Made by me.

alias ordtok {
  var %x = 1, %otok = $1
  while %x <= $numtok($1,$2) {
    var %otok = $reptok(%otok,$gettok($1,%x,$2),$ord($gettok($1,%x,$2)),$2)
    inc %x
  }
  return $sorttok(%otok,$2,$iif($3,nr,n))
}

Comments

Sign in to comment.
Scakk   -  Aug 25, 2008

The way it looks to is as follows.

His example: $ordtok(4.1,46,nr)

The number 4 and 1 will be given the proper $ord after them and in reverse order.

It will give: 4th 1st


The problem I see is that if one of the items in the group ends with a non-number it is just listed as it is. Perhaps have it either remove it or error out.

If you use: $ordtok(4.1,46)

It will give: 1st 4th

 Respond  
Zmodem   -  Aug 25, 2008

Edit: Never-mind, I say go with it...lol!

 Respond  
^Neptune   -  Aug 25, 2008

I have.. no idea how to use this or what it could be useful in

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.