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=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f6b9e7a488a8fbdb,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!sn-xit-04!sn-xit-06!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "mr1yh1" Newsgroups: comp.lang.ada Subject: a beginner question Date: Wed, 20 Oct 2004 19:01:47 -0400 Organization: www.talkaboutprogramming.com Message-ID: <10b97a973c8cc17010b8a5e9d55be273@localhost.talkaboutprogramming.com> X-Newsreader: www.talkaboutprogramming.com Content-Type: text/plain; X-Complaints-To: abuse@supernews.com Xref: g2news1.google.com comp.lang.ada:5549 Date: 2004-10-20T19:01:47-04:00 List-Id: i am very new in ada , i try to write codes from book and see result i tried something but i couldnt get a good result (i use gnat) ****************** with Ada.Text_Io;use Ada.Text_Io; procedure test is type Sex_T is (Male, Female); type Person ( S:Sex_T:=Male )is record Age:Positive ; Sex:Sex_T:=S;------please look at here first case S is when Male => Has_Wife:Boolean ; when Female=> Has_Husband:Boolean; end case; end record;--person end Me : Person; she : Person (Female); ---- and this one , begin Me:=( S => Male, Sex => Male, Age => 33, Has_Wife => True); she:=( S => Female, Sex => Male, ---please look at here now!!!!! Age => 23, Has_Husband => True); Put(Sex_T'Image(she.Sex)); end test; **** there is not any alert and result is " male " ?? if i dont put "sex=>male" , or "sex=>female" it dont let me to use a named association... even is i dont put " s=> female " it dont let me too , but i said about discriminant when i declare the variable ( she : person(female) ) why its not possible ? to put she:=(age=>23,has_husband=>true); regards