comp.lang.ada
 help / color / mirror / Atom feed
From: lutz@iks-jena.de (Lutz Donnerhacke)
Subject: Re: Characters and Numerics
Date: Wed, 5 Dec 2001 12:07:56 +0000 (UTC)
Date: 2001-12-05T12:07:56+00:00	[thread overview]
Message-ID: <slrna0s3gq.kq.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: e499e546.0112050403.680c6db9@posting.google.com

* Duke Luke wrote:
>How can I change type character to type natural??
>e.g: '3' -> 3;

S'Value denotes a function with the following specification:

  function S'Value(Arg : String) return S'Base;
  
This function returns a value given an image of the value as a String,
ignoring any leading or trailing spaces.
  
For the evaluation of a call on S'Value for an enumeration subtype S, if the
sequence of characters of the parameter (ignoring leading and trailing
spaces) has the syntax of an enumeration literal and if it corresponds to a
literal of the type of S (or corresponds to the result of S'Image for a
value of the type), the result is the corresponding enumeration value;
otherwise Constraint_Error is raised. For a numeric subtype S, the
evaluation of a call on S'Value with Arg of type String is equivalent to a
call on S'Wide_Value for a corresponding Arg of type Wide_String.

=> Natural'Value ((1 => '3'));



  reply	other threads:[~2001-12-05 12:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-05 12:03 Characters and Numerics Duke Luke
2001-12-05 12:07 ` Lutz Donnerhacke [this message]
2001-12-05 12:16 ` M. A. Alves
2001-12-05 14:58   ` Matthew Heaney
2001-12-05 18:55     ` Wes Groleau
2001-12-05 19:24       ` Matthew Heaney
2001-12-05 21:27         ` Wes Groleau
2001-12-06  0:19     ` tmoran
replies disabled

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