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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd4e0f4e248c8168 X-Google-Attributes: gid103376,public From: tconiam@ionet.net (Todd Coniam) Subject: Re: String to Variable Name Mapping Date: 1996/04/19 Message-ID: <4l72r6$rj2@ionews.ionet.net>#1/1 X-Deja-AN: 150617722 references: <4kjico$emb@newssvr.cacd.rockwell.com> content-type: Text/Plain; charset=ISO-8859-1 organization: IONet mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-04-19T00:00:00+00:00 List-Id: In article <4kjico$emb@newssvr.cacd.rockwell.com>, fbsnodgr@cacd.rockwell.com says... > >Is there an attribute or some other way to use the contents of a string >variable to point to another variable? > >For example, if I have the following declarations, > > Int_Var : Integer; > Str_Var : String (1..32) := "Int_Var"; > >can I somehow use the contents of Str_Var to make an assignment to >Int_Var? > >I'd like to do this as a way of initializing variables by reading from a >text file containing the variable name and the desired initial value. > >Thanks, >Britt Snodgrass (mailto:britt@acm.org) > -- Yes, but it involves writing a small parser that determines which variable is listed in the file, reads the value, and assigns it to the appropriate actual variable. What your wanting is not directly supported by Ada as it is in some other languages. It is not considered "safe" (which I agree with) but I do see the utility of your need (it's a initialization file, and done all the time). Sorry, there is no fast answer. If you are having problems creating the necessary procedure let us (c.l.a) know and we can help you out. ------------------------------------------------------------------------- Todd Coniam | Member: Team Ada tconiam@ionet.net | Ada 95 - The international standard in OO languages ------------------------------------------------------------------------- Check: http://lglwww.epfl.ch/Ada/ Free compiler: http://www.gnat.com/