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-Thread: 103376,aab48c153d1e916b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!news.cs.univ-paris8.fr!informatik.uni-bremen.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: questions from a newbie Date: Thu, 15 Jul 2004 14:44:39 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <40f684a8@dnews.tpgi.com.au> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1089902679 12755 134.91.1.34 (15 Jul 2004 14:44:39 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Thu, 15 Jul 2004 14:44:39 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:2185 Date: 2004-07-15T14:44:39+00:00 List-Id: zork wrote: : : if c in 'A'..'Z' or c in 'a'..'z' or c in '0'..'9' then : : : if c in ('A'..'Z', 'a'..'z', '0'..'9') then This is the purpose of Ada.Strings.Maps etc. In Ada.Strings.Maps.Constants you will find predefined Character_Set constant that match yours. : Also, I know you can do the following: : : type new_type is array(1..20) of string(1..50); : words : new_type; : index : integer := 20; : words (15) (index ..index) := "K"; : : however I find that I cannot instead say: : : words(15)(index):="K"; : : why is this so? ...(index) denotes a Character, one component of an array, ...(index .. index) denotes an array slice. The index values can in general be results of computations at runtime, i.e., ...(n .. m). What kind of thing other than an array slice should (n .. m) denote? OTOH, ...(n) where n is an index value cannot but denote one array component. : I get a "Type mismatch in assignment statement, continuing" : error. It does however work when I use words(15)(index):='K'. The rational : behind this is that (index..index) represents a range - hence a string - : whereas (index) represents a single character?