Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!unido!rwthinf!rwthi3!ricki From: ricki@john.informatik.rwth-aachen.de (Richard Breuer) Newsgroups: comp.lang.pascal Subject: Re: wish i could figure this out for myself Message-ID: Date: 6 May 91 11:11:53 GMT References: <1991May3.140719.5931@javelin.sim.es.com> <1991May3.150243.3793@e2big.mko.dec.com> <1991May3.170232.7710@javelin.sim.es.com> Sender: news@rwthinf.UUCP Lines: 34 tpehrson@javelin.sim.es.com (Tim Clinkenpeel) writes: >granoff@vaxwrk.enet.dec.com (Mark H. Granoff) writes: >>Close... Try something like this: >>FUNCTION ValidChar(Ch:Char):Boolean; >> CONST >> ValidChars : SET OF Char = ['A'..'Z','a'..'z','0'..'9']; >> BEGIN >> ValidChar := Ch IN ValidChars; >> END; >yeah, i had considered doing it this way but i thought it was sloppy. >besides, i really like to know how to do such a thing exclusively. >in any event, thanks for your help. i may have to resort to using the above >method (if nothing else turns up here on c.s.p) >-- > /=============================/ > / tpehrson@javelin.sim.es.com / i will work for food > /=====aka: tim clinkenpeel====/ >[DISCLAIMER: send SASE to: disclaimer, 84151-0521] In fact there might be one better (that means faster) solution. I did not test whether it is so, so do it yourself, if you wish. Here it is: FUNCTION ValidChar(Ch:Char):Boolean; CONST ValidChars = 'ABCDEFHIJKLMNO'; (* and so on... *) BEGIN ValidChar := Pos(Ch,ValidChars)>0; END; Ricki.