Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!pacbell.com!att!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!uxa.cso.uiuc.edu!amb43790 From: amb43790@uxa.cso.uiuc.edu (Anthony M Brummett) Newsgroups: comp.lang.pascal Subject: Re: What's wrong with this: Message-ID: <1991Apr20.043958.14471@ux1.cso.uiuc.edu> Date: 20 Apr 91 04:39:58 GMT References: <1991Apr20.011454.25016@javelin.sim.es.com> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 31 tpehrson@javelin.sim.es.com (Tim Clinkenpeel) writes: >hi, it's me again. please DO NOT respond with email, as my last question >received over 30 responses. >why doesn't this work: >function upper(I:string):string; > var z:integer; > begin > for z:=1 to length(I) do > if (ord(I[z])>96) and (ord(I[z])<123) then I[z]:=upcase(I[z]); > end; >i have a feeling i'm overlooking the obvious (to people with a decent text). >in the index under function pages are referenced like this one (entire page >quoted): > "In this chapter we will be discussing functions" >however, the discussion of functions is superficial at best. NOTE: i have >deemed my text fit only for fire fodder at this point. >and, as always, thank you for your response. >-- >one two! one two! & through & through /=============================/ hear your >the vorpal blade went snicker-snack! / tpehrson@javelin.sim.es.com / death boon >he left it dead, and with his head /=====aka: tim clinkenpeel====/ the wail of >he went galumphing back [DISCLAIMER: send SASE to: disclaimer, 84151-0521] DOOM Probably the best thing to do is to delete the if clause and make it: for z:=1 to length(I) do I[z]:=upcase(I[z]); because upcase returns an uppercase letter if I[z] is upper or lower case.