* Ord Function HELP Please HELP HELP HELP @ 1998-12-14 0:00 Johnny 1998-12-14 0:00 ` Tom Moran 1998-12-14 0:00 ` Matthew Heaney 0 siblings, 2 replies; 8+ messages in thread From: Johnny @ 1998-12-14 0:00 UTC (permalink / raw) Does anyone know the ADA function equivelent to Pascals "Ord" Function, the function that gives the ASCII number for it's related symbol? ANY hELP IS APPRECIATED THANK YOU ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ord Function HELP Please HELP HELP HELP 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 ` Matthew Heaney 1 sibling, 1 reply; 8+ messages in thread From: Tom Moran @ 1998-12-14 0:00 UTC (permalink / raw) Do you mean integer'image(5) which gives " 5"? or do you mean "fifth"? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ord Function HELP Please HELP HELP HELP 1998-12-14 0:00 ` Tom Moran @ 1998-12-14 0:00 ` Johnny 1998-12-14 0:00 ` dennison 1998-12-14 0:00 ` Matthew Heaney 0 siblings, 2 replies; 8+ messages in thread From: Johnny @ 1998-12-14 0:00 UTC (permalink / raw) On Mon, 14 Dec 1998 03:21:52 GMT, tmoran@bix.com (Tom Moran) wrote: >Do you mean integer'image(5) >which gives " 5"? or do you mean "fifth"? Hi, Thank You for your msg, 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 I may need to dload a Package. Any Help is much appreciated, Thnx ,Johnny ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ord Function HELP Please HELP HELP HELP 1998-12-14 0:00 ` Johnny @ 1998-12-14 0:00 ` dennison 1998-12-14 0:00 ` dennison 1998-12-14 0:00 ` Matthew Heaney 1 sibling, 1 reply; 8+ messages in thread From: dennison @ 1998-12-14 0:00 UTC (permalink / raw) 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ord Function HELP Please HELP HELP HELP 1998-12-14 0:00 ` dennison @ 1998-12-14 0:00 ` dennison 0 siblings, 0 replies; 8+ messages in thread From: dennison @ 1998-12-14 0:00 UTC (permalink / raw) In article <753bi6$2s8$1@nnrp1.dejanews.com>, dennison@telepath.com wrote: > 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. Whoops! Replace the "'image" above with "'value". "'image" does the inverse process. I have *got* to start getting more sleep... -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ord Function HELP Please HELP HELP HELP 1998-12-14 0:00 ` Johnny 1998-12-14 0:00 ` dennison @ 1998-12-14 0:00 ` Matthew Heaney 1998-12-14 0:00 ` Johnny 1 sibling, 1 reply; 8+ messages in thread From: Matthew Heaney @ 1998-12-14 0:00 UTC (permalink / raw) John_Lin@paramount.com (Johnny) writes: > On Mon, 14 Dec 1998 03:21:52 GMT, tmoran@bix.com (Tom Moran) wrote: > > >Do you mean integer'image(5) > >which gives " 5"? or do you mean "fifth"? > > > Hi, Thank You for your msg, > 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 > I may need to dload a Package. > > Any Help is much appreciated, > > Thnx ,Johnny Use Get_Immediate to deliver the character corresponding to the key, then convert that character to its integer code by using Character'Pos. ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ord Function HELP Please HELP HELP HELP 1998-12-14 0:00 ` Matthew Heaney @ 1998-12-14 0:00 ` Johnny 0 siblings, 0 replies; 8+ messages in thread From: Johnny @ 1998-12-14 0:00 UTC (permalink / raw) On Mon, 14 Dec 1998 03:56:42 GMT, Matthew Heaney <matthew_heaney@acm.org> wrote: >John_Lin@paramount.com (Johnny) writes: > >> On Mon, 14 Dec 1998 03:21:52 GMT, tmoran@bix.com (Tom Moran) wrote: >> >> >Do you mean integer'image(5) >> >which gives " 5"? or do you mean "fifth"? >> >> >> Hi, Thank You for your msg, >> 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 >> I may need to dload a Package. >> >> Any Help is much appreciated, >> >> Thnx ,Johnny > > >Use Get_Immediate to deliver the character corresponding to the key, >then convert that character to its integer code by using Character'Pos. Thank You Very Very Much, Will implement the Character'Pos tonight, Thanks to your help, Thank goodness for Usenet and nice people ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Ord Function HELP Please HELP HELP HELP 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 ` Matthew Heaney 1 sibling, 0 replies; 8+ messages in thread From: Matthew Heaney @ 1998-12-14 0:00 UTC (permalink / raw) John_Lin@paramount.com (Johnny) writes: > Does anyone know the ADA function equivelent to Pascals "Ord" > Function, the function that gives the ASCII number for it's related > symbol? > > ANY hELP IS APPRECIATED > > THANK YOU Character'Pos You should familiarize yourself with the pre-defined language attributes, which are listed in the back of your Ada Reference Manaual. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~1998-12-14 0:00 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 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 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
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox