Path: utzoo!attcan!uunet!mcsun!hp4nl!eurtrx!euraiv1!reino From: reino@cs.eur.nl (Reino de Boer) Newsgroups: comp.lang.pascal Subject: Re: uppercase and char and string[1]; Keywords: help.. me.. Message-ID: <1989Nov17.085217.10809@cs.eur.nl> Date: 17 Nov 89 08:52:17 GMT References: <5477@uhccux.uhcc.hawaii.edu> Organization: Erasmus Universiteit Rotterdam, dept. CS (Informatica) Lines: 23 cs211s65@uhccux.uhcc.hawaii.edu (Cs211s65) writes: >Aloha Networld, ....... >....... So.. when I declare a string, >I have to declare it as type packed array [1..10] of char. My question >is, how would I change a string of that type to an all upper case string, How about: var s : packed array [1..10] of char; i : integer; begin .... for i := 1 to 10 do if( 'a' <= s[i] ) and ( s[i] <= 'z' ) then { convert it } s[i] := chr( ord( s[i] ) - ord( 'a' ) + ord( 'A' ) ); { else leave it alone } .... end. -- Reino R. A. de Boer Erasmus University Rotterdam ( Informatica ) e-mail: reino@cs.eur.nl