View Single Post
Old 05-05-2008, 07:25 AM   #1 (permalink)
nanaman
Registered User
 
Join Date: May 2008
Posts: 1
OS: Xp


Ada Type checker

Quick question, I have a program that needs to check if a character read into it is part of the alphabet. Now I know I could do this using a list of the alphabet and using a function to check that list a return a boolean value (but this method is ugly and slow). So I thought I could make a subtype i.e. subtype valid_letter is Character Range 'a'..'z';

I was wondering if anyone knew a way to check this in an if statement

i.e. if X = 'a' then,

but replacing the 'a' with "is part of type valid_letter".

Thanks in advance.
nanaman is offline   Reply With Quote