comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Ord Function HELP Please HELP HELP HELP
Date: 1998/12/14
Date: 1998-12-14T00:00:00+00:00	[thread overview]
Message-ID: <753bi6$2s8$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 3679891d.19665290@news.smartlink.net

In article <3679891d.19665290@news.smartlink.net>,
  John_Lin@paramount.com (Johnny) wrote:

> I'm a new ada coder, and I have run into a small problem, I can't find
> a function that will return the ASCII converted number for any key
> pressed on the keyboard,   example:  user hits the backspace key, I
> would like to be able to catch the key however, without a function to
> convert the ASCII representation to #8, we would have no idea that he
> pressed the backspace.  In VB it's the "CHR" function in Pascal it's
> the "Ord" function, ADA95 does not list this function anywhere that I
> can find, I am hoping it is built into the compiler, however, I think

  Character'pos('8') will return the integer value 56.

  Integer'image("8") will return the integer value 8. Integer'image("88") will
return the integer value 88, Integer'image("888") will..., well, you get the
idea.

I suspect the second is what you are asking for. It would be a good idea to
look through annex K of the Ada LRM ( http://www.adahome.com/rm95/rm9x-K.html
). There are all sorts of goodies in there for you!

--
T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1998-12-14  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-14  0:00 Ord Function HELP Please HELP HELP HELP Johnny
1998-12-14  0:00 ` Tom Moran
1998-12-14  0:00   ` Johnny
1998-12-14  0:00     ` dennison [this message]
1998-12-14  0:00       ` dennison
1998-12-14  0:00     ` Matthew Heaney
1998-12-14  0:00       ` Johnny
1998-12-14  0:00 ` Matthew Heaney
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox