comp.lang.ada
 help / color / mirror / Atom feed
* How to convert characters in a string into integers ?
@ 2002-02-02 21:59 Jim
  2002-02-02 22:09 ` Florian Weimer
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Jim @ 2002-02-02 21:59 UTC (permalink / raw)


is this possible, if so how ?

say im reading a string (1 + 2 + 3)    (yep carrying on with my calculator
program :-))

how to get 1 and the convert to integer, then get + and store as character,
get 2 and convert to integer etc ?






^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-02 21:59 How to convert characters in a string into integers ? Jim
@ 2002-02-02 22:09 ` Florian Weimer
  2002-02-02 23:27 ` Michal Nowak
  2002-02-12 12:03 ` How to convert characters in a string into integers ? John English
  2 siblings, 0 replies; 24+ messages in thread
From: Florian Weimer @ 2002-02-02 22:09 UTC (permalink / raw)


"Jim" <genx54321@hotmail.com> writes:

> how to get 1 and the convert to integer, then get + and store as
> character, get 2 and convert to integer etc ?

You have to write a parser.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-02 21:59 How to convert characters in a string into integers ? Jim
  2002-02-02 22:09 ` Florian Weimer
@ 2002-02-02 23:27 ` Michal Nowak
  2002-02-02 23:57   ` Jim
  2002-02-12 12:03 ` How to convert characters in a string into integers ? John English
  2 siblings, 1 reply; 24+ messages in thread
From: Michal Nowak @ 2002-02-02 23:27 UTC (permalink / raw)


On 02-02-02 at 21:59 Jim wrote:

>is this possible, if so how ?
>
>say im reading a string (1 + 2 + 3)    (yep carrying on with my calculator
>program :-))
>
>how to get 1 and the convert to integer, then get + and store as
character,
>get 2 and convert to integer etc ?

Have a look a Find_Token procedure (LRM A.4.3 - A.4.5). 

Little example:

Find_Token (Source => "(102 + 200 + 32)",
            Set=>To_Set("0123456789"),
            Test=>Inside,
            First,
            Last,);

This will give you the beginning and ending of first integer
in source string. You may than slice it and convert this slice
to integer:
Operand := Integer'Value (Input_String (First .. Last) );
For this case you will have 102 in Operand.

Hope this was a bit helpful,
Mike

PS. To make this code compile you will have to "with" some
packeges - look at mentioned LRM sections to which ones.
-----------------------------------------
                             ____|
                             \%/ |~~\
  O                                  |
 o>>        Mike Nowak               |
 T                                   |
/ >       vinnie@inetia.pl           |
http://www.geocities.com/vinnie14pl _|__




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-02 23:27 ` Michal Nowak
@ 2002-02-02 23:57   ` Jim
  2002-02-03  3:25     ` Jim Rogers
  2002-02-03  8:56     ` Michal Nowak
  0 siblings, 2 replies; 24+ messages in thread
From: Jim @ 2002-02-02 23:57 UTC (permalink / raw)


sorry to sound dumb, whats LRM ?


"Michal Nowak" <vinnie@inetia.pl> wrote in message
news:mailman.1012692482.11946.comp.lang.ada@ada.eu.org...
> On 02-02-02 at 21:59 Jim wrote:
>
> Have a look a Find_Token procedure (LRM A.4.3 - A.4.5).
>
> Little example:
>
> Find_Token (Source => "(102 + 200 + 32)",
>             Set=>To_Set("0123456789"),
>             Test=>Inside,
>             First,
>             Last,);
>
> This will give you the beginning and ending of first integer
> in source string. You may than slice it and convert this slice
> to integer:
> Operand := Integer'Value (Input_String (First .. Last) );
> For this case you will have 102 in Operand.
>
> Hope this was a bit helpful,
> Mike
>
> PS. To make this code compile you will have to "with" some
> packeges - look at mentioned LRM sections to which ones.
> -----------------------------------------
>                              ____|
>                              \%/ |~~\
>   O                                  |
>  o>>        Mike Nowak               |
>  T                                   |
> / >       vinnie@inetia.pl           |
> http://www.geocities.com/vinnie14pl _|__
>





^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-02 23:57   ` Jim
@ 2002-02-03  3:25     ` Jim Rogers
  2002-02-03  8:56     ` Michal Nowak
  1 sibling, 0 replies; 24+ messages in thread
From: Jim Rogers @ 2002-02-03  3:25 UTC (permalink / raw)


Language Reference Manual.


Jim Rogers

Jim wrote:

> sorry to sound dumb, whats LRM ?
> 




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-02 23:57   ` Jim
  2002-02-03  3:25     ` Jim Rogers
@ 2002-02-03  8:56     ` Michal Nowak
  2002-02-04 16:12       ` Marin David Condic
  1 sibling, 1 reply; 24+ messages in thread
From: Michal Nowak @ 2002-02-03  8:56 UTC (permalink / raw)



On 02-02-02 at 23:57 Jim wrote:

>sorry to sound dumb, whats LRM ?

Language Reference Manual. It is available online at:
http://www.adapower.com/rm95/index.html

Mike
-----------------------------------------
                             ____|
                             \%/ |~~\
  O                                  |
 o>>        Mike Nowak               |
 T                                   |
/ >       vinnie@inetia.pl           |
http://www.geocities.com/vinnie14pl _|__




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-03  8:56     ` Michal Nowak
@ 2002-02-04 16:12       ` Marin David Condic
  2002-02-05  1:40         ` ARM (was: Re: How to convert characters in a string into integers ?) Jeffrey Carter
  2002-02-05 14:36         ` How to convert characters in a string into integers ? Michal Nowak
  0 siblings, 2 replies; 24+ messages in thread
From: Marin David Condic @ 2002-02-04 16:12 UTC (permalink / raw)


Although with Ada95 - to be accurate and/or pedantic, it should be "ARM" for
"Ada95 Reference Manual". "LRM" was the correct abbreviation for Ada83 &
still seems to hang on - probably mostly out of habbit. Maybe we should add
to the "Ada vs ADA" harangue a similar "ARM vs LRM" harangue? :-)

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Michal Nowak" <vinnie@inetia.pl> wrote in message
news:mailman.1012726562.29220.comp.lang.ada@ada.eu.org...
>
> Language Reference Manual. It is available online at:
> http://www.adapower.com/rm95/index.html
>






^ permalink raw reply	[flat|nested] 24+ messages in thread

* ARM (was: Re: How to convert characters in a string into integers ?)
  2002-02-04 16:12       ` Marin David Condic
@ 2002-02-05  1:40         ` Jeffrey Carter
  2002-02-05 14:57           ` Marin David Condic
  2002-02-10 16:47           ` Florian Weimer
  2002-02-05 14:36         ` How to convert characters in a string into integers ? Michal Nowak
  1 sibling, 2 replies; 24+ messages in thread
From: Jeffrey Carter @ 2002-02-05  1:40 UTC (permalink / raw)


Marin David Condic wrote:
> 
> Although with Ada95 - to be accurate and/or pedantic, it should be "ARM" for
> "Ada95 Reference Manual". "LRM" was the correct abbreviation for Ada83 &
> still seems to hang on - probably mostly out of habbit. Maybe we should add
> to the "Ada vs ADA" harangue a similar "ARM vs LRM" harangue? :-)

Every page of ANSI/MIL-STD 1815A (the Ada-83 RM) has "ARM" at the top.
It meant "Ada Reference Manual" then and it still does. LRM? Could refer
to any language.

-- 
Jeff Carter
"I unclog my nose towards you."
Monty Python & the Holy Grail



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-04 16:12       ` Marin David Condic
  2002-02-05  1:40         ` ARM (was: Re: How to convert characters in a string into integers ?) Jeffrey Carter
@ 2002-02-05 14:36         ` Michal Nowak
  2002-02-05 15:17           ` Jerry Petrey
  1 sibling, 1 reply; 24+ messages in thread
From: Michal Nowak @ 2002-02-05 14:36 UTC (permalink / raw)


On 02-02-04 at 11:12 Marin David Condic wrote:

>Although with Ada95 - to be accurate and/or pedantic, it should be "ARM"
>for
>"Ada95 Reference Manual". "LRM" was the correct abbreviation for Ada83 &
>still seems to hang on - probably mostly out of habbit. Maybe we should
add
>to the "Ada vs ADA" harangue a similar "ARM vs LRM" harangue? :-)

Ooops. In fact, my mistake, I apologise for it. I hope that I did not hurt
anyone with mixing these abbreviations. Maybe this mistake isn't so serious
as writting Ada as ADA...
I wonder when (and where) did "LRM" stick to my mind - I had no contact
with Ada83.

Mike
-----------------------------------------
                             ____|
                             \%/ |~~\
  O                                  |
 o>>        Mike Nowak               |
 T                                   |
/ >       vinnie@inetia.pl           |
http://www.geocities.com/vinnie14pl _|__




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM (was: Re: How to convert characters in a string into integers ?)
  2002-02-05  1:40         ` ARM (was: Re: How to convert characters in a string into integers ?) Jeffrey Carter
@ 2002-02-05 14:57           ` Marin David Condic
  2002-02-06 15:19             ` Ted Dennison
                               ` (2 more replies)
  2002-02-10 16:47           ` Florian Weimer
  1 sibling, 3 replies; 24+ messages in thread
From: Marin David Condic @ 2002-02-05 14:57 UTC (permalink / raw)


I don't have my Ada83 reference manual handy, but IIRC, it said "Language
Reference Manual" on the cover somewhere in the title. I think that's why
"LRM" got started - maybe someone with a hardcopy handy can check? Anyway,
I'll bet it was changed specifically because LRM could - as you observe -
refer to any language.

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Jeffrey Carter" <jrcarter@acm.org> wrote in message
news:3C5F3817.AE9080FA@acm.org...
>
> Every page of ANSI/MIL-STD 1815A (the Ada-83 RM) has "ARM" at the top.
> It meant "Ada Reference Manual" then and it still does. LRM? Could refer
> to any language.
>






^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-05 14:36         ` How to convert characters in a string into integers ? Michal Nowak
@ 2002-02-05 15:17           ` Jerry Petrey
  2002-02-05 16:06             ` Marin David Condic
  0 siblings, 1 reply; 24+ messages in thread
From: Jerry Petrey @ 2002-02-05 15:17 UTC (permalink / raw)




Michal Nowak wrote:
> 
> On 02-02-04 at 11:12 Marin David Condic wrote:
> 
> >Although with Ada95 - to be accurate and/or pedantic, it should be "ARM"
> >for
> >"Ada95 Reference Manual". "LRM" was the correct abbreviation for Ada83 &
> >still seems to hang on - probably mostly out of habbit. Maybe we should
> add
> >to the "Ada vs ADA" harangue a similar "ARM vs LRM" harangue? :-)
> 
> Ooops. In fact, my mistake, I apologise for it. I hope that I did not hurt
> anyone with mixing these abbreviations. Maybe this mistake isn't so serious
> as writting Ada as ADA...
> I wonder when (and where) did "LRM" stick to my mind - I had no contact
> with Ada83.
> 
> Mike
>


LRM was the common term for the Ada 83 Reference Manual back at the time I got 
involved with Ada in the late 80's.

Jerry

-- 
-----------------------------------------------------------------------------
-- Jerry Petrey                                                
-- Senior Principal Systems Engineer - Navigation, Guidance, & Control
-- Raytheon Missile Systems          - Member Team Ada & Team Forth
-- NOTE: please remove <NOSPAM> in email address to reply                  
-----------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-05 15:17           ` Jerry Petrey
@ 2002-02-05 16:06             ` Marin David Condic
  2002-02-14 19:52               ` ARM vs. LRM vs. ... (was: Re: How to convert characters in a string into integers ?) Tucker Taft
  0 siblings, 1 reply; 24+ messages in thread
From: Marin David Condic @ 2002-02-05 16:06 UTC (permalink / raw)


I don't have the original paper copy handy, but FWIW, the online version at:
http://archive.adaic.com/standards/83lrm/html/ada_lrm.html clearly titles
the manual as "Ada '83 Language Reference Manual". In contrast, the page at:
http://www.adaic.org/standards/95lrm/html/RM-Ttl.html shows the title for
the Ada95 reference manual as: "Ada Reference Manual". I believe this is why
originally, we called it the "LRM", but with Ada95 it became the "ARM".

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Jerry Petrey @west.raytheon.com>" <"jdpetrey<NOSPAM> wrote in message
news:3C5FF78B.D3E73A94@west.raytheon.com...
>
> LRM was the common term for the Ada 83 Reference Manual back at the time I
got
> involved with Ada in the late 80's.
>






^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
@ 2002-02-06  6:55 Christoph Grein
  2002-02-06  9:20 ` Jean-Etienne Doucet
  0 siblings, 1 reply; 24+ messages in thread
From: Christoph Grein @ 2002-02-06  6:55 UTC (permalink / raw)


I've got the hard copy. Its title page (coloured green) says:

          REFERENCE MANUAL FOR THE
                    Ada
            PROGRAMMING LANGUAGE

             ANSI/MIL-STD-1815A

     United States Department of Defense

                 Honeywell
         Systems and Research Center
            2600 Ridgway Parkway
           Minneapolis, MN 55413

                   and
     
                  alsys
          29 Avenue de Versailles
      78170 La Celle Saint Cloud, France

               January 1983



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-06  6:55 Christoph Grein
@ 2002-02-06  9:20 ` Jean-Etienne Doucet
  0 siblings, 0 replies; 24+ messages in thread
From: Jean-Etienne Doucet @ 2002-02-06  9:20 UTC (permalink / raw)


Christoph Grein <christoph.grein@eurocopter.com> writes:

| I've got the hard copy. Its title page (coloured green) says:
| 
|           REFERENCE MANUAL FOR THE
|                     Ada
|             PROGRAMMING LANGUAGE
| 
|              ANSI/MIL-STD-1815A
| 
|      United States Department of Defense
| 
|                  Honeywell
|          Systems and Research Center
|             2600 Ridgway Parkway
|            Minneapolis, MN 55413
| 
|                    and
|      
|                   alsys
|           29 Avenue de Versailles
|       78170 La Celle Saint Cloud, France
| 
|                January 1983


I have this book, though it's quit dusty by now.

And the edge says: ANSI/MIL-STD 1815 A    ADA REFERENCE MANUAL

So what ?

--jed--




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
@ 2002-02-06 10:01 Christoph Grein
  0 siblings, 0 replies; 24+ messages in thread
From: Christoph Grein @ 2002-02-06 10:01 UTC (permalink / raw)


> From: doucet@laas.fr
...
> | I've got the hard copy. Its title page (coloured green) says:
> | 
> |           REFERENCE MANUAL FOR THE
> |                     Ada
> |             PROGRAMMING LANGUAGE
> | 
> |              ANSI/MIL-STD-1815A
> | 
> |      United States Department of Defense
> | 
> |                  Honeywell
> |          Systems and Research Center
> |             2600 Ridgway Parkway
> |            Minneapolis, MN 55413
> | 
> |                    and
> |      
> |                   alsys
> |           29 Avenue de Versailles
> |       78170 La Celle Saint Cloud, France
> | 
> |                January 1983
> 
> 
> I have this book, though it's quit dusty by now.
> 
> And the edge says: ANSI/MIL-STD 1815 A    ADA REFERENCE MANUAL
> 
> So what ?

You're right, "So what?". I find it quite useless to argue whether one should 
say ARM, LRM, RM.

Let's hope this futile thread is dead now.

And let's hope the Adaphiles don't jump at ADA REFERENCE MANUAL with Ada 
capitalized the wrong way :-)



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM (was: Re: How to convert characters in a string into integers ?)
  2002-02-05 14:57           ` Marin David Condic
@ 2002-02-06 15:19             ` Ted Dennison
  2002-02-06 15:52             ` Stephen Leake
  2002-02-06 16:13             ` Jeffrey Carter
  2 siblings, 0 replies; 24+ messages in thread
From: Ted Dennison @ 2002-02-06 15:19 UTC (permalink / raw)


"Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> wrote in message news:<a3orso$q56$1@nh.pace.co.uk>...
> I don't have my Ada83 reference manual handy, but IIRC, it said "Language
> Reference Manual" on the cover somewhere in the title. I think that's why
> "LRM" got started - maybe someone with a hardcopy handy can check? Anyway,
> "Jeffrey Carter" <jrcarter@acm.org> wrote in message
> news:3C5F3817.AE9080FA@acm.org...
> >
> > Every page of ANSI/MIL-STD 1815A (the Ada-83 RM) has "ARM" at the top.
> > It meant "Ada Reference Manual" then and it still does. LRM? Could refer
> > to any language.
> >

I do. The cover reads:

"REFERENCE MANUAL FOR THE Ada(R) PROGRAMMING LANGUAGE" (Note the one
word that isn't all caps :-) ).

The only phrase that seems to appear on every (actually, every
*other*) page is:

"ANSI/MIL-STD-1815A Ada Reference Manual"

A proper acronym for that would probably be something like: "A/MARM"
:-)

-- 
T.E.D.
Home     -  mailto:dennison@telepath.com (Yahoo: Ted_Dennison)
Homepage -  http://www.telepath.com/dennison/Ted/TED.html
To know recursion, you must first know recursion.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM (was: Re: How to convert characters in a string into integers ?)
  2002-02-05 14:57           ` Marin David Condic
  2002-02-06 15:19             ` Ted Dennison
@ 2002-02-06 15:52             ` Stephen Leake
  2002-02-06 16:13             ` Jeffrey Carter
  2 siblings, 0 replies; 24+ messages in thread
From: Stephen Leake @ 2002-02-06 15:52 UTC (permalink / raw)


"Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org> writes:

> I don't have my Ada83 reference manual handy, 

Well, I do :). It occupies an honored spot on my bookshelf, within
handy reach. The drab green cover contrasts nicely with the gaudy
"Accelerated C++" book; I like function over form any day :).

The cover says "REFERENCE MANUAL FOR THE Ada PROGRAMMING LANGUAGE".

So RMAPL might have been the most appropriate acronym, but that could
have refered to "APL", that wonderful language from IBM. 

> "Jeffrey Carter" <jrcarter@acm.org> wrote in message
> news:3C5F3817.AE9080FA@acm.org...
> >
> > Every page of ANSI/MIL-STD 1815A (the Ada-83 RM) has "ARM" at the top.
> > It meant "Ada Reference Manual" then and it still does. LRM? Could refer
> > to any language.

Actually, it has "ANSI/MIL-STD-1815A Ada Reference Manual" on the left
page header, and the chapter title in the right top margin.


I propose a standard jargon: "Ada LRM" means the Ada language
reference manual, "C LRM" means the C language reference manual, "Foo
LRM" means the Foo language reference manual, etc.

How do we propose that to ISO :) ?

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM (was: Re: How to convert characters in a string into integers ?)
  2002-02-05 14:57           ` Marin David Condic
  2002-02-06 15:19             ` Ted Dennison
  2002-02-06 15:52             ` Stephen Leake
@ 2002-02-06 16:13             ` Jeffrey Carter
  2 siblings, 0 replies; 24+ messages in thread
From: Jeffrey Carter @ 2002-02-06 16:13 UTC (permalink / raw)


Marin David Condic wrote:
> 
> I don't have my Ada83 reference manual handy, but IIRC, it said "Language
> Reference Manual" on the cover somewhere in the title. I think that's why
> "LRM" got started - maybe someone with a hardcopy handy can check? Anyway,
> I'll bet it was changed specifically because LRM could - as you observe -
> refer to any language.

The title is "Reference Manual for the Ada Programming Language". It has
a green cover; perhaps that will call it to mind. Every page still has
"ARM" at the top, which is why I've been using "ARM" since 1984, unless
we can reach a consensus to use "RMFTAPL".

> "Jeffrey Carter" <jrcarter@acm.org> wrote in message
> news:3C5F3817.AE9080FA@acm.org...
> >
> > Every page of ANSI/MIL-STD 1815A (the Ada-83 RM) has "ARM" at the top.
> > It meant "Ada Reference Manual" then and it still does. LRM? Could refer
> > to any language.
> >

-- 
Jeffrey Carter



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM (was: Re: How to convert characters in a string into integers ?)
  2002-02-05  1:40         ` ARM (was: Re: How to convert characters in a string into integers ?) Jeffrey Carter
  2002-02-05 14:57           ` Marin David Condic
@ 2002-02-10 16:47           ` Florian Weimer
  2002-02-10 17:24             ` ARM (was: Re: How to convert characters in a string intointegers ?) Uckfay Ouyay
  1 sibling, 1 reply; 24+ messages in thread
From: Florian Weimer @ 2002-02-10 16:47 UTC (permalink / raw)


Jeffrey Carter <jrcarter@acm.org> writes:

> Every page of ANSI/MIL-STD 1815A (the Ada-83 RM) has "ARM" at the top.
> It meant "Ada Reference Manual" then and it still does. LRM? Could refer
> to any language.

I can't tell you anything about history for obvious reasons, but the
current usage on comp.lang.ada seems to be to reserve "LRM" to Ada 83,
and use "AARM", "ARM", or "RM" for the Ada 95 manual.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM (was: Re: How to convert characters in a string intointegers ?)
  2002-02-10 16:47           ` Florian Weimer
@ 2002-02-10 17:24             ` Uckfay Ouyay
  0 siblings, 0 replies; 24+ messages in thread
From: Uckfay Ouyay @ 2002-02-10 17:24 UTC (permalink / raw)


Florian Weimer wrote:
> 
> Jeffrey Carter <jrcarter@acm.org> writes:
> 
> > Every page of ANSI/MIL-STD 1815A (the Ada-83 RM) has "ARM" at the top.
> > It meant "Ada Reference Manual" then and it still does. LRM? Could refer
> > to any language.
> 
> I can't tell you anything about history for obvious reasons, but the
> current usage on comp.lang.ada seems to be to reserve "LRM" to Ada 83,
> and use "AARM", "ARM", or "RM" for the Ada 95 manual.

I've been using "ARM" since 1984, and I'm too old to change now :)

-- 
Jeff Carter
"Death awaits you all, with nasty, big, pointy teeth!"
Monty Python & the Holy Grail



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: How to convert characters in a string into integers ?
  2002-02-02 21:59 How to convert characters in a string into integers ? Jim
  2002-02-02 22:09 ` Florian Weimer
  2002-02-02 23:27 ` Michal Nowak
@ 2002-02-12 12:03 ` John English
  2 siblings, 0 replies; 24+ messages in thread
From: John English @ 2002-02-12 12:03 UTC (permalink / raw)


Jim wrote:
> 
> is this possible, if so how ?
> 
> say im reading a string (1 + 2 + 3)    (yep carrying on with my calculator
> program :-))
> 
> how to get 1 and the convert to integer, then get + and store as character,
> get 2 and convert to integer etc ?

One way is described in section 13.3 of the textbook you're using:
you use Ada.Text_IO.Look_Ahead to see if the character you're about
to read is a digit, and if it is use Ada.Integer_Text_IO.Get to read
an integer.

Another way is to convert this pseudocode to Ada:
  result = 0
  while (next char is a digit) loop
    result = result * 10 + (value of digit char)
  end loop

There are other ways than these, too...

-----------------------------------------------------------------
 John English              | mailto:je@brighton.ac.uk
 Senior Lecturer           | http://www.it.bton.ac.uk/staff/je
 Dept. of Computing        | ** NON-PROFIT CD FOR CS STUDENTS **
 University of Brighton    |    -- see http://burks.bton.ac.uk
-----------------------------------------------------------------



^ permalink raw reply	[flat|nested] 24+ messages in thread

* ARM vs. LRM vs. ... (was: Re: How to convert characters in a string into integers ?)
  2002-02-05 16:06             ` Marin David Condic
@ 2002-02-14 19:52               ` Tucker Taft
  2002-02-14 20:12                 ` Jerry Petrey
  0 siblings, 1 reply; 24+ messages in thread
From: Tucker Taft @ 2002-02-14 19:52 UTC (permalink / raw)


Marin David Condic wrote:
> 
> I don't have the original paper copy handy, but FWIW, the online version at:
> http://archive.adaic.com/standards/83lrm/html/ada_lrm.html clearly titles
> the manual as "Ada '83 Language Reference Manual". In contrast, the page at:
> http://www.adaic.org/standards/95lrm/html/RM-Ttl.html shows the title for
> the Ada95 reference manual as: "Ada Reference Manual". I believe this is why
> originally, we called it the "LRM", but with Ada95 it became the "ARM".

I am told Jean Ichbiah hated the term "LRM" -- he preferred simply "RM" (reminds
me of the country club in Boston called "The Country Club" -- under "T" in
the phone book!).

For Ada 95, we didn't want to offend the hater(s?) of the term "LRM," and perhaps
were willing to recognize the presence of other languages, so using "ARM" became
natural.  Of course, then we added an annotated version, which became
known as "AARM."

> 
> MDC
> --
> Marin David Condic
> Senior Software Engineer
> Pace Micro Technology Americas    www.pacemicro.com
> Enabling the digital revolution
> e-Mail:    marin.condic@pacemicro.com
> Web:      http://www.mcondic.com/
> 
> "Jerry Petrey @west.raytheon.com>" <"jdpetrey<NOSPAM> wrote in message
> news:3C5FF78B.D3E73A94@west.raytheon.com...
> >
> > LRM was the common term for the Ada 83 Reference Manual back at the time I
> got
> > involved with Ada in the late 80's.
> >

-- 
-Tucker Taft   stt@avercom.net   http://www.avercom.net
Chief Technology Officer, AverCom Corporation (A Titan Company) 
Bedford, MA  USA (AverCom was formerly the Commercial Division of AverStar:
http://www.averstar.com/~stt)



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM vs. LRM vs. ... (was: Re: How to convert characters in a string into integers ?)
  2002-02-14 19:52               ` ARM vs. LRM vs. ... (was: Re: How to convert characters in a string into integers ?) Tucker Taft
@ 2002-02-14 20:12                 ` Jerry Petrey
  2002-02-15  9:56                   ` Steffen Huber
  0 siblings, 1 reply; 24+ messages in thread
From: Jerry Petrey @ 2002-02-14 20:12 UTC (permalink / raw)




Tucker Taft wrote:
> 
> Marin David Condic wrote:
> >
> > I don't have the original paper copy handy, but FWIW, the online version at:
> > http://archive.adaic.com/standards/83lrm/html/ada_lrm.html clearly titles
> > the manual as "Ada '83 Language Reference Manual". In contrast, the page at:
> > http://www.adaic.org/standards/95lrm/html/RM-Ttl.html shows the title for
> > the Ada95 reference manual as: "Ada Reference Manual". I believe this is why
> > originally, we called it the "LRM", but with Ada95 it became the "ARM".
> 
> I am told Jean Ichbiah hated the term "LRM" -- he preferred simply "RM" (reminds
> me of the country club in Boston called "The Country Club" -- under "T" in
> the phone book!).
> 
> For Ada 95, we didn't want to offend the hater(s?) of the term "LRM," and perhaps
> were willing to recognize the presence of other languages, so using "ARM" became
> natural.  Of course, then we added an annotated version, which became
> known as "AARM."
> 
> >
> > MDC
> > 
> >
> > "Jerry Petrey @west.raytheon.com>" <"jdpetrey<NOSPAM> wrote in message
> > news:3C5FF78B.D3E73A94@west.raytheon.com...
> > >
> > > LRM was the common term for the Ada 83 Reference Manual back at the time I
> > got
> > > involved with Ada in the late 80's.
> > >
> 
> --
> -Tucker Taft   

I know John Barnes referred to it as the LRM in all of his old books but in 
"Programming in Ada95" he switched over to ARM or RM95.

I still like LRM better - after all, we all know there shouldn't be any other
language besides Ada :=)

Jerry
-- 
-----------------------------------------------------------------------------
-- Jerry Petrey                                                
-- Senior Principal Systems Engineer - Navigation, Guidance, & Control
-- Raytheon Missile Systems          - Member Team Ada & Team Forth
-- NOTE: please remove <NOSPAM> in email address to reply                  
-----------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ARM vs. LRM vs. ... (was: Re: How to convert characters in a string into integers ?)
  2002-02-14 20:12                 ` Jerry Petrey
@ 2002-02-15  9:56                   ` Steffen Huber
  0 siblings, 0 replies; 24+ messages in thread
From: Steffen Huber @ 2002-02-15  9:56 UTC (permalink / raw)


Jerry Petrey wrote:
[snipLRM - ARM discussion]
> I know John Barnes referred to it as the LRM in all of his old books but in
> "Programming in Ada95" he switched over to ARM or RM95.
> 
> I still like LRM better - after all, we all know there shouldn't be any other
> language besides Ada :=)

The difficult thing about "ARM" is that there is a processor architecture
called ARM. They have an architecture reference manual, which they call the
ARM ARM...

When I quickly switch between comp.lang.ada and comp.sys.arm, I am often
surprised that the Ada group discusses a processor architecture and that
the ARM group discusses Ada ;-)

Steffen

-- 
steffen.huber@gmx.de               steffen@huber-net.de
GCC for RISC OS  - http://www.arcsite.de/hp/gcc/
Private homepage - http://www.huber-net.de/



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2002-02-15  9:56 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-02 21:59 How to convert characters in a string into integers ? Jim
2002-02-02 22:09 ` Florian Weimer
2002-02-02 23:27 ` Michal Nowak
2002-02-02 23:57   ` Jim
2002-02-03  3:25     ` Jim Rogers
2002-02-03  8:56     ` Michal Nowak
2002-02-04 16:12       ` Marin David Condic
2002-02-05  1:40         ` ARM (was: Re: How to convert characters in a string into integers ?) Jeffrey Carter
2002-02-05 14:57           ` Marin David Condic
2002-02-06 15:19             ` Ted Dennison
2002-02-06 15:52             ` Stephen Leake
2002-02-06 16:13             ` Jeffrey Carter
2002-02-10 16:47           ` Florian Weimer
2002-02-10 17:24             ` ARM (was: Re: How to convert characters in a string intointegers ?) Uckfay Ouyay
2002-02-05 14:36         ` How to convert characters in a string into integers ? Michal Nowak
2002-02-05 15:17           ` Jerry Petrey
2002-02-05 16:06             ` Marin David Condic
2002-02-14 19:52               ` ARM vs. LRM vs. ... (was: Re: How to convert characters in a string into integers ?) Tucker Taft
2002-02-14 20:12                 ` Jerry Petrey
2002-02-15  9:56                   ` Steffen Huber
2002-02-12 12:03 ` How to convert characters in a string into integers ? John English
  -- strict thread matches above, loose matches on Subject: below --
2002-02-06  6:55 Christoph Grein
2002-02-06  9:20 ` Jean-Etienne Doucet
2002-02-06 10:01 Christoph Grein

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