See comments below /*
** $char
* snippet made by opticlens
** Basically being $chr and $asc for multiple input, with more options.
* $char(<asc|chr>,<string seperated by commas>)[.se]
* <asc> will return an $asc version of the string
* <chr> will return the $chr version of the string
* <string> must be seperated by commas if you want multiple results
* [.s] prop: returns the output in a $+(<string>) format
* [.e] prop will format each output in a $chr(<token>) or
$asc(<token>) format [returns in $asc format for chr and $chr format for asc (see below)]
* [.se] props will format each output in a $+($chr/asc(<token>) format. [.se doesn't have to be exact due to iswm (e.g it could be .es)]
alias char {
var %ž = !echo -ac info * $!char
if (!$isid) %ž ERROR_SYNTAX: Must be an identifier
elseif ($2-) {
if ($1 == chr) || ($1 == asc) {
var %x = 2, %•
while (%x <= $0) {
var %o = $($ $+ %x,2)
inc %x
}
return $iif(*s* iswm $prop,$+($!+,$chr(40),%•,$chr(41)),%•)
}
else %ž ERROR_SYNTAX: Properties must be either $+(,chr,) or $+(,asc,)
}
elseif ($1) && (!$2-) %ž NO_PARAMS: There is no input to modify.
else %ž NO_PARAMS
halt
}