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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c3155860644be062 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-24 07:12:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uninett.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Thanks guys..my project and my many problems Date: Mon, 24 Feb 2003 15:12:08 +0000 (UTC) Organization: Norwegian university of science and technology Message-ID: References: <3E5A2381.21FD3F14@bton.ac.uk> NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1046099528 11747 129.241.83.78 (24 Feb 2003 15:12:08 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Mon, 24 Feb 2003 15:12:08 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:34513 Date: 2003-02-24T15:12:08+00:00 List-Id: Paul Gregory wrote: > Thank-you Larry and Preban for your kind help. e ;-) > type English is > (big, black, cat, dog, es, small, the, white); > > type French is (grand, noir, chat, chien, est, petit, le, blanc); > > English_to_French: constant array(English) of French:= > ( big => grand, > black => noir, > cat => chat, > dog => chien, > es => est, > small => petit, > the => le, > white => blanc); > Why do you use enumerates? Is it required? If you are supposed to be able to add words and possibly store them too, why don't you rather make something like: type Max_Word_Length : constant Natural := 80; type Word_Record is record english : String (1 .. Max_Word_Length); french : String (1 .. Max_Word_Length); end record; of course you have to build a linked list or an array and a way to search for the correct word. Another way could be to use arrays (you don't have to deal with the linked list problems) but have the design a bit more flexible so you can add more languages if you want: type Dictionary is record word_id : Natural := 0; word : String (1 .. Max_Word_Length); end record; type English_List is array (1 .. 1000) of Dictionary; type French_List is array (1 .. 1000) of Dictionary; then when you add you generate a unique word_id /= 0 for each word and you put this in the English list along with the English word and in the French list with the french word. So that when you look up a word you get the word_id and you use this to find the same word in the other language. Of course you don't have to do this if you know that word number 3 in the English list will correspond with word number 3 in the French. Please note I haven't checked my code so there might be errors in it. Hope you can get further on your project with this. -- Preben Randhol ---------------- http://www.pvv.org/~randhol/ -- "Violence is the last refuge of the incompetent", Isaac Asimov