Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!e2big.mko.dec.com!guest From: granoff@vaxwrk.enet.dec.com (Mark H. Granoff) Newsgroups: comp.lang.pascal Subject: Re: Help me (problems with strings) Message-ID: <1991May22.125953.25651@e2big.mko.dec.com> Date: 22 May 91 12:59:53 GMT References: <1991Apr18.221625.13529@watmath.waterloo.edu> Sender: guest@e2big.mko.dec.com (Guest (DECnet)) Reply-To: granoff@vaxwrk.enet.dec.com (Mark H. Granoff) Organization: Digital Equipment Corporation, Maynard MA Lines: 40 >nmouawad@watmath.waterloo.edu (Naji Mouawad) writes: >> In article <1991Apr18.020517.7767@javelin.sim.es.com tpehrson@javelin.sim.es. >> I'm getting the error "Type mismatch" in the following: >> >> Procedure writ(txt:string); >> var huh:char; >> begin; >> for x:=1 to length(txt) do begin >> huh:=copy(txt,x,1); <---error occurs here >> case huh of >>... For starters, check that your parameters to Copy() are in the correct order. But more likely the problem is that huh is a Char and Copy() returns a string. You might try huh := txt[x]; or eliminate this all together and use case txt[x] of (I think that will work.) Hope this helps, -Mark -- --------------------------------------------------------------------------- Mark H. Granoff | Enterprise Integration Services/Engineering VAXworks --------------------------------------------------------------------------- Digital Equipment Corporation | Internet: granoff@vaxwrk.enet.dec.com 129 Parker Street | Usenet : ...!decwrl!vaxwrk.enet!granoff PKO2-1/M21 | AT&T : +1 508 493 4512 Maynard, MA 01754 | FAX : +1 508 493 2240 --------------------------------------------------------------------------- Opinions herein are my own and do not necessarily reflect those of Digital. ---------------------------------------------------------------------------