Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!claris!drc From: drc@claris.com (Dennis Cohen) Newsgroups: comp.sys.mac.programmer Subject: Re: Trouble with using Munger Message-ID: <11122@claris.com> Date: 13 Jul 90 14:28:11 GMT References: <477@psych.psy.uq.oz.au> <42915@apple.Apple.COM> Organization: Claris Corporation, Santa Clara CA Lines: 42 keith@Apple.COM (Keith Rollin) writes: >In article <477@psych.psy.uq.oz.au> strasser@psych.psy.uq.oz.au (Michael Strasser) writes: >>I am having a problem using Munger in a macApp program I'm writing. I >>am trying to use it as part of a simple text-parsing routine. Here is >>an example of what I have now: >> >>Given: >> >> VAR >> aChar : Char; >> text : Handle; >> offset : LONGINT; >> where : LONGINT; >> >>I have text set correctly (I've checked this), and offset set to 0. >>I then try to find the first tab character in a string which I know >>contains at least one tab using: >> >> aChar := chTab; >> where := Munger(text, offset, @aChar, 1, NIL, 0); >> >>but Munger returns -1, signifying that the string was not found. >> >>Am I doing anything wrong? According to my reading of IM, it should be >>OK. >You're passing a pointer to the length byte of "aChar", rather than the >first character of aChar. Try: > where := Munger(text, offset @aChar[1], Length(aChar), NIL, 0); Keith, since when does a Char have a length byte? This cannot be the problem as stated. I don't know what he has as a value for chTab, but I'd be curious since the code he has works for me when I try it. -- Dennis Cohen Claris Corp. **************************************************** Disclaimer: Any opinions expressed above are _MINE_!