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,94b44ecb42c031b9 X-Google-Attributes: gid103376,public From: Matthias Teege Subject: Re: Searching for an object Date: 2000/08/21 Message-ID: <87g0nyy1kk.fsf@moon.mteege.de>#1/1 X-Deja-AN: 660796120 Sender: matthias@moon.mteege.de References: <87og2q9yyp.fsf@moon.mteege.de> <8nrh3t$ht9$1@nnrp1.deja.com> Organization: DVZ Datenverarbeitungszentrum Mecklenburg-Vorpommern GmbH Content-Type: text/plain; charset=iso-8859-1 User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.5 Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 2000-08-21T00:00:00+00:00 List-Id: Ted Dennison writes: > In article <87og2q9yyp.fsf@moon.mteege.de>, > Matthias Teege wrote: > > I've defined the following type: > > > > type customer is record > > aname : String( 1..25); > > bname : String( 1..25); > > end record; > > This looks shaky right from the start. How do you know how many > characters in these fields are valid? Ada string handling doesn't rely Yes it is really bad code but is only for my learning purposes. It is a quick hack and I'm very impatient. ;-) [...] > Is object supposed to be some global variable? Otherwise, this looks > like you are familiar with "object" notation in some other "OO" > languages, and are looking for the same notation in Ada. Eg: you want > to call Object.Find (...) rather than Find(Object, ...) Is that your > question? Yes, I want to call Object.Find(in_field, for_this_string) but the only way to implement this I see is: if in_field = "field1" and for_this_string = "foo" then result = "found"; if in_field = "field2" and for_this_string = "foo" then result = "found"; and so on. The problem isn't the "object notation" but the record notation. I can access an record field with "record.fieldname = ..." and now I want a variable "fieldname" to spare myself from the long way described bellow. I'm looking for a short notation like "record.$fieldname". I hope I can make you understand. :-) Many thanks Matthias -- Matthias Teege -- matthias@mteege.de -- http://emugs.de make world not war PGP-Key auf Anfrage