Re: Euphoria ASCII function

new topic     » goto parent     » topic index » view thread      » older message » newer message

> Is there a Euphoria function that will return an atom with the ASCII
value of
> a
> character passed to it?
>
> Thanks in advance,
> Steve Elder

Try this: I was going to use it in the tutorial but I tossed it because I
found a better way to get
characters on the screen in graphics mode

-------------------------------------------------------

function ascii_table(atom character)
     atom ascii_value
     sequence ascii_table
     ascii_table = {}
     for ix = 33 to 255 do
          ascii_table = ascii_table & ix
     end for
     ascii_value = find(character,ascii_table)
     if ascii_value then
          ascii_value = ascii_value + 32
     end if
     return ascii_value
end function

print(1,ascii_table('l'))

------------------------------------------------------

David Gay
"A Beginner's Guide To Euphoria"
http://www.geocities.com/SiliconValley/Vista/4346

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu