From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,6085ae1d74309e83 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!v36g2000yqv.googlegroups.com!not-for-mail From: Chrono Newsgroups: comp.lang.ada Subject: Re: reference to a name variable Date: Thu, 30 Jul 2009 07:37:27 -0700 (PDT) Organization: http://groups.google.com Message-ID: <764f7902-69f6-4af6-b8f4-b9a39189caec@v36g2000yqv.googlegroups.com> References: <9129a8e6-1aba-430c-bfbc-3154026697b8@i18g2000pro.googlegroups.com> NNTP-Posting-Host: 201.7.145.1 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1248964647 2605 127.0.0.1 (30 Jul 2009 14:37:27 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 30 Jul 2009 14:37:27 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v36g2000yqv.googlegroups.com; posting-host=201.7.145.1; posting-account=n9Sa1woAAACZc_iwSjaEkj9Lnt-XVrSr User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:7446 Date: 2009-07-30T07:37:27-07:00 List-Id: On 28 jul, 15:25, Ludovic Brenta wrote: > On Jul 28, 3:51=A0pm, Chrono wrote: > > > > > On 24 jul, 08:03, Stephen Leake > > wrote: > > > > Pablo 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 =3D IntegerValue(MyString), > > > > My_Integer :=3D 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.