![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
Thread Tools |
|
|
#1 (permalink) |
|
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. |
|
|
|
|
|
#2 (permalink) |
|
Registered User
Join Date: Jul 2007
Posts: 459
OS: Win Vista Home Premium
|
Re: Ada Type checker
Hey sorry but i dont know the language you're using...
But....Could it be compared with an integer (which represents the letter) e.g. if X = 1 (representing 'a') or could you use an integer and convert it into a character for the check... e.g. if X = Char(1); sorry this wont be in any way accurate, but data conversion between ordinal types (integer and character) should be easy? if theres a char function then you could use a for loop then use the char function to check each digit (though it would probably be ascii so 1 would not be a etc)... Hope any of this helps, Jamey |
|
|
|
![]() |
| Thread Tools | |
|
|