Re: Predeclared function CAP

From: [at]} <Rene>
Date: Wed, 15 Sep 2004 23:44:33 +0200

----boundary-LibPST-iamunique-951589452_-_-
Content-type: text/plain

Martin, Marc wrote:

>> Apparently, this function substracts 32 (20H) from the code of many
>> characters. It's correct for lower case letters, but a little
>> surprising for
>> digits or punctuations.
>
>
> This is how I would have expected the CAP() function to work,
> but for some reason it doesn't:
>
> PROCEDURE Cap*( ch: CHAR ): CHAR;
> BEGIN
> IF ( ch >= "a" ) & ( ch <= "z" ) THEN
> RETURN CHR(ORD(ch)-32)
> ELSE
> RETURN ch
> END
> END Cap;
>
> Marc
>
WE've discussed this in October 2003 already. Back then I wrote:

Second thought: CAP could be something that is used quite often, so
internal check you require (IF ORD(x) < 65 THEN RETURN(x) ELSE RETURN
CHR(ORD(x)-32) END;) could have been omitted for performance reasons.
But it would be easy to implement
on one's own:


PROCEDURE Caps(x:CHAR) : CHAR;
BEGIN
 IF ORD(x) < 65 THEN
  RETURN(x)
 ELSE
  RETURN CHR(ORD(x)-32)
 END;
END Caps;

Rene
--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-951589452_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1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