comp.lang.ada
 help / color / mirror / Atom feed
From: Stewart <s_aitken@lineone.net>
Subject: Convert ASCII numerals to Integer numbers
Date: Sun, 05 Aug 2001 17:58:33 +0100
Date: 2001-08-05T17:58:33+01:00	[thread overview]
Message-ID: <h1uqmto63djje1sgg1futccs5adbsvkokf@4ax.com> (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




             reply	other threads:[~2001-08-05 16:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-05 16:58 Stewart [this message]
2001-08-05 17:34 ` Convert ASCII numerals to Integer numbers 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
replies disabled

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