Path: utzoo!attcan!uunet!husc6!paperboy!snorkelwacker!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: Trouble with using Munger Message-ID: <42936@apple.Apple.COM> Date: 13 Jul 90 19:44:06 GMT References: <477@psych.psy.uq.oz.au> <42915@apple.Apple.COM> <11122@claris.com> Organization: Apple Computer Inc, Cupertino, CA Lines: 39 In article <11122@claris.com> drc@claris.com (Dennis Cohen) writes: >keith@Apple.COM (Keith Rollin) writes: > >>In article <477@psych.psy.uq.oz.au> strasser@psych.psy.uq.oz.au (Michael Strasser) writes: >>>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. > >>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. Merde. I don't know why I assumed that aChar was a string, especially since the variable declaration was given. You are, of course, correct. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions