comp.lang.ada
 help / color / mirror / Atom feed
* Convert ASCII numerals to Integer numbers
@ 2001-08-05 16:58 Stewart
  2001-08-05 17:34 ` Jacob Sparre Andersen
  2001-08-06 16:09 ` Adrian Knoth
  0 siblings, 2 replies; 6+ messages in thread
From: Stewart @ 2001-08-05 16:58 UTC (permalink / raw)


HI,

Gnat 3.13 on win98 and linux.

I am creating a menu and I am grabbing the terminal input using
get_line, but on this particular command the last 1 .. 3 characters
can be numerals in the range of 1 .. 999.

I am considering character'pos but how can I manipulate to an integer?

Extracted from menu:

The commands work as I require them including error handling.
If I dont use get_line I can get the integers but I cant resolve the
error handling.

 elsif Input(1..4) = Link and  19 < Max_Size and Max_Size < 23 then
         Nodea := Input(6..11); Nodeb := Input(13..18);
         Edget := Input(20..22);
         Put("The command is : "); Put(Input(1..4)); New_Line;
         Put("Node A is : "); Put(Nodea); New_Line;
         Put("Node B is : "); Put(Nodeb); New_Line;
         Put("Cost is : ");   Put(Edget); New_Line;

         Int_Range := Max_Size - 19;
         Put("Cost range is : "); Put(Int_Range); New_Line;


I now want to get the last three characters and convert them to
integers




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

end of thread, other threads:[~2001-08-06 16:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-05 16:58 Convert ASCII numerals to Integer numbers Stewart
2001-08-05 17:34 ` Jacob Sparre Andersen
2001-08-05 17:57   ` Stewart
2001-08-05 18:13     ` martin.m.dowie
2001-08-05 18:15     ` tmoran
2001-08-06 16:09 ` Adrian Knoth

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