$ASNTOK

By SyntaxIRC on Mar 07, 2008

Usage: $asntok(TOKEN,N,?)

Will sort and insert needed numbers. For example, $asntok(4.1,46) would return 1.2.3.4 (if you used $asntok(4.1,46,nr) - it would return it in reverse)

alias asntok {
  var %x = 1, %tok = $1
  while %x <= $gettok($sorttok($1,$2,nr),1,$2) {
    var %tok = $iif($istok($1,%x,$2),%tok,$instok(%tok,%x,0,$2))
    inc %x
  }
  return $sorttok(%tok,$2,$iif($3,nr,n))
}

Comments

Sign in to comment.
Warder   -  Mar 07, 2008

A very nice idea :D

I\'d provide some error checking so that users will see what goes wrong if they specify an invalid syntax.

 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.