Chr to Asc alias.

By Naemuti on Jun 05, 2006

Used as a custom identifier to turn a string of text into a line of $chr values.

EX: //echo -a $astring(Test) returns $chr(116) $+ $chr(101) $+ $chr(115) $+ $chr(116) $+ $chr() $+

Note: For some reason, $astring() tends to leave a blank $chr() $+ on the end of the returned text. It doesn't affect the output of the script, but if someone could tell me WHY this happens, I would very much appreciate it! :)

astring {
  var %y 0
  while (%y < $len($1-)) {
    var %x $right($1-,$calc($len($1-) - %y))
    var %z %z $ $+ chr( $+ $asc($left(%x,1)) $+ ) $ $+ +
    inc %y 1
  return %z


Sign in to comment.
Diabu   -  Jun 05, 2006

remove the = on the while command :) and then test it again .. and the blank $chr() doesn\'t appear anymore

sorry for my bad english.

xDaeMoN   -  Jun 05, 2006

Use $mid instead of calculating each time to get the character. Also use the correct syntax for /var which is /var %var = data.

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.