Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Ansi -iso > Re: Lower case ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 176 of 215
Post > Topic >>

Re: Lower case and isalpaha

by "Chuck F. " <cbfalconer@[EMAIL PROTECTED] > Dec 10, 2005 at 04:43 PM

Scott Moore wrote:
> TC wrote On 11/17/05 08:24,:
>>
>> there is a function that make lowercase of char or string?
>> And there is a standard function that return true/false if
>> char is a  character?
> 
> All characters are characters. That's why the're called that.
> 
> function isalpha(c: char): boolean;
> 
> begin
>    isalpha := c in ['A'..'Z', 'a'..'z']
> end;

There is no guarantee in Pascal that alphabetical characters are 
continuous.  You need to enumerate all the possible chars.

> 
> function lcase(c: char): char;
> 
> begin
>    if c in ['A'..'Z'] then c := chr(ord(c)-ord('A')+ord('a'));
>    lcase := c
> end;

Again, the same comment applies.  You would be better advised to 
create and initialize two sets, one consisting of the enumerated 
upper case chars, and another for the lower case ones.  Then the 
isalpha can refer to the set lowers + uppers.

Also, since there is no guarantee of any numeric relation****p 
between the corresponding lower and upper case characters, you 
probably need some explicit arrays of char for the conversion.

Your solutions will work only for the limited conditions of Ascii 
coding, with no allowance for such things as Swedish, German, etc. 
characters.

-- 
Read about the Sony stealthware that is a security leak, phones
home, and is generally illegal in most parts of the world.  Also
the apparent connivance of the various security software firms.
http://www.schneier.com/blog/archives/2005/11/sonys_drm_rootk.html
 




 3 Posts in Topic:
Lower case and isalpaha
TC <tecomeco@[EMAIL PR  2005-11-17 16:24:47 
Re: Lower case and isalpaha
Scott Moore <samiamsan  2005-11-17 13:16:31 
Re: Lower case and isalpaha
"Chuck F. " <  2005-12-10 16:43:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 23 16:05:03 CDT 2008.