comp.lang.ada
 help / color / mirror / Atom feed
From: Chrono <pablittto@gmail.com>
Subject: Re: reference to a name variable
Date: Thu, 30 Jul 2009 07:37:27 -0700 (PDT)
Date: 2009-07-30T07:37:27-07:00	[thread overview]
Message-ID: <764f7902-69f6-4af6-b8f4-b9a39189caec@v36g2000yqv.googlegroups.com> (raw)
In-Reply-To: fc064dea-e4e7-4874-b4d2-28ea3a187ce9@b15g2000yqd.googlegroups.com

On 28 jul, 15:25, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:
> On Jul 28, 3:51 pm, Chrono <pablit...@gmail.com> wrote:
>
>
>
> > On 24 jul, 08:03, Stephen Leake <stephen_le...@stephe-leake.org>
> > wrote:
>
> > > Pablo <pablit...@gmail.com> writes:
> > > > I have an integer variable which I'd like to set dinamically equal to
> > > > a value of a variable that I don't know at priori. Say as:
> > > > I want to set My_Integer = IntegerValue(MyString),
>
> > > My_Integer := Integer'Value (MyString);
>
> > > --
> > > -- Stephe
>
> > Stephe, the idea is this really, instead of MyString is not a number
> > string, it's a string whose name is the name of a integer variable,
> > and it's the value of this variable what I want. This would work if I
> > had a string like "123", so Integer'Value("123") would give me 123.
> > When I try with a real naming string (instead of a number string),
> > program keeps waiting for an entry so it suspends itself...
>
> Like Dmitry said, a map (i.e. a container of name-value pairs, where
> names are Strings and values are integers) seems the best solution.
> See Ada.Containers.Hashed_Maps.
>
> However I'm curious to know why you need this? What is the higher-
> level problem you're trying to solve?
Basically I need test run time variables (thousands!) of a real-time
program machine..
>
> --
> Ludovic Brenta.




      reply	other threads:[~2009-07-30 14:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23 19:08 reference to a name variable Pablo
2009-07-23 20:02 ` Hibou57 (Yannick Duchêne)
2009-07-23 20:26   ` Dmitry A. Kazakov
2009-07-24 11:03 ` Stephen Leake
2009-07-28 13:51   ` Chrono
2009-07-28 18:25     ` Ludovic Brenta
2009-07-30 14:37       ` Chrono [this message]
replies disabled

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