|
Joined: Dec 2002
Posts: 79
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 79 |
this is what i got to break up a 4 letter word and return the $asc value but is there an easier way to do this and make it unlimited letters? alias ccode { var %a = $left($gettok($1,1,32), -3) echo -a $asc(%a) var %b = $mid($1,2,1) echo -a $asc(%b) var %c = $mid($1,3,1) echo -a $asc(%c) var %d = $right($gettok($1,1,32), -3) echo -a $asc(%d) }
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Do you mean something like this?
alias ccode {
var %x = 1, %y = $len($left($gettok($1,1,32), -3))
while (%x <= %y) {
echo -a $asc($mid($1,%x,1))
inc %x
}
}
-Andy
|
|
|
|
Joined: Dec 2002
Posts: 79
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 79 |
no like if i type /ccode bot it would say b == $chr(98) o == $chr(111) t == $chr(116)
how you Like Canada Slade ? learned to say Eh yet?
Last edited by Fantas; 25/11/05 07:25 AM.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
alias ccode {
var %x = 1
while (%x <= $len($1)) {
var %char = $mid($1,%x,1)
echo -a %char == $+($,chr,$chr(40),$asc(%char),$chr(41))
inc %x
}
}
B == $chr(66) o == $chr(111) t == $chr(116) Canada's cool, the folk are friendly which is good. I can't think of one thing that I say Canadian it's still british. Although I should because I went to a restaurant and orded a plate of chips, ya you guessed it I got a bag of doritos so... There was some sort of miscommunication or something..  -Andy
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
alias ccode {
var %a = 1
while %a <= $len($1-) {
var %b = $asc($mid($1-,%a,1))
echo -a $mid($1-,%,1) == $!chr( $+ %b $+)
inc %a
}
}
|
|
|
|
Joined: Dec 2002
Posts: 79
Babel fish
|
OP
Babel fish
Joined: Dec 2002
Posts: 79 |
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
lol...glad you're enjoying Canada, Slade. Next time, ask for fries...which is what you probably meant for your order in the restaurant.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Well they say fries in the UK too but it's mainly said in McDonalds, Burger King. I've learned to let the girlfriend order my food she's learned to take money from my wallet to pay..
-Andy
|
|
|
|
Joined: Feb 2004
Posts: 2,019
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 2,019 |
/ccode this is a test alias ccode {
bset -t &bin 1 $$1-
tokenize 32 $bvar(&bin,1-)
scon -r echo -a $!chr( $* ) = $*
}
Gone.
|
|
|
|
|