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,ccb8bd6b4c3162fd X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Beginner's questions Date: 1999/05/03 Message-ID: <7gkq7e$dcm$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 473581493 References: <372da49c.12366381@news.rwth-aachen.de> X-Http-Proxy: 1.0 x2.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Mon May 03 18:34:22 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-05-03T00:00:00+00:00 List-Id: In article <372da49c.12366381@news.rwth-aachen.de>, marcoschmidt@geocities.com wrote: > I have to write my first longer program in Ada and could resolve all > questions except for those two using the reference manual. Maybe > someone could help me here... I'm using GNAT 3.11p for NT. > > 1) I couldn't find out how to use bitwise operations "and" and "or" > (which would be "and" / "or" in Pascal and "&" / "|" in C). Do I have > to include a certain package? There are two ways to perform bitwise operations. One way is to use modular types, and the other is to use packed arrays of booleans. Which one is best for you to use depends on what you want to do with your objects *besides* the bitwise operations. > 2) I want to use a fixed-size array of constant strings to store some > names which do not all have the same length, but no name is longer .. > is raised. How should I do it? If you won't need to change the contents of the strings, one quick-and-dirty method is the following: type String_Ptr is access String; type String_Ptr_List is array (1..3) of String_Ptr; String_List : constant String_Ptr_List := (new String'("Hi there!"), new String'("How are you doing?"), new String'("Why, I'm fine. How are you?") ); Don't do this in a loop or subroutine, unless you are prepared to deallocate the strings when you are done. But as one-time-only code on an OS that cleans up process resources after termination this often does the trick for me. -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own