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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9677a3433b89e25b,start X-Google-Attributes: gid103376,public From: daelen@my-deja.com Subject: attributes in generic procedure Date: 1999/11/21 Message-ID: <818esd$t6l$1@nnrp1.deja.com>#1/1 X-Deja-AN: 551191633 X-Http-Proxy: 1.0 www-proxy2.eur.cis.philips.com:8080 (Squid/2.2.STABLE4), 1.0 x34.deja.com:80 (Squid/1.1.22) for client unknown, 192.68.44.34 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sun Nov 21 09:43:41 1999 GMT X-MyDeja-Info: XMYDJUIDdaelen Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/2.0 (compatible; MSIE 3.02; Windows 95) Date: 1999-11-21T00:00:00+00:00 List-Id: I would like to create a generic procedure as shown below which will only be used for scalar types. Does anybody have a hint how to accomplish this? generic type A_Type is private; procedure Update (Par : in out A_Type; Value : String); procedure Update (Par : in out A_Type; Value : String) is begin if Value = "+" then if Par = A_Type'Last then Par := A_Type'First; else Par := A_Type'Succ (Par); end if; elsif Value = "++" then Par := A_Type'Last; elsif Value = "-" then if Par = A_Type'First then Par := A_Type'Last; else Par := A_Type'Pred (Par); end if; elsif Value = "--" then Par := A_Type'First; elsif Value /= "" then Par := A_Type'Value (Value); end if; end Update; Sent via Deja.com http://www.deja.com/ Before you buy.