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=2.9 required=5.0 tests=BAYES_50,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a6beb80151a3525b,start X-Google-Attributes: gid103376,public From: Tracy Fletcher Subject: Constrained Character Subtype Date: 1997/03/12 Message-ID: <33270944.588B@primenet.com>#1/1 X-Deja-AN: 225119472 Organization: Primenet Services for the Internet X-Posted-By: @204.212.59.228 (tfletch) Reply-To: tfletch@primenet.com Newsgroups: comp.lang.ada Date: 1997-03-12T00:00:00+00:00 List-Id: Howdy, I am trying to define a type, which would be a subtype of CHARACTER. I want it to contain a list of CHARACTER constants i.e. type VOWELS is ('a', 'e', 'i', 'o', 'u'); The problem is that I cannot compare one element of a string with type VOWELS (compile error) for instance to count the vowels in a string (i.e. if INPUT_STRING(j) in VOWELS . . .) I have tried making VOWELS a subtype of CHARACTER, but cannot then specify the actual characters I want to be included (aside from range, which does me no good). I would also like to do something similar to recognize substrings such as: type More_than_one_syllable is ("ana", "ani", "uno", etc.) if INPUT_STRING(i..i+2) in More_than_one_syllable then . . . I know this must be possible, but I have been able to find no effective solution in reference books, internet documenets, etc. Any advice would be greatly appreciated. Thanks, Tracy Fletcher