Newsgroups: comp.sys.mac.programmer Path: utzoo!utgpu!watserv1!maytag!watdragon!bwbecker From: bwbecker@watdragon.waterloo.edu (Byron Weber Becker) Subject: WordBreak routine for TextEdit Message-ID: <1990May3.161824.14395@watdragon.waterloo.edu> Organization: University of Waterloo Distribution: na Date: Thu, 3 May 90 16:18:24 GMT Lines: 29 I am trying to implement a word-break routine for TextEdit. When text is inserted with TEInsert and my routine is called, 'text' points to the text being inserted, but 'CharPos' is longer than the text is. Thus '*t' in the code below points to random memory. Any pointers? I'm using MPW C 3.1. Everything works fine with the default word- break routine. pascal Boolean MyWordBreak(Ptr text, short charPos) { unsigned char * t; t = text + charPos; if ( *t <= ' ' || *t == '<' || *t == '>' ) return(TRUE); else return(FALSE); } Thanks in advance! Byron Weber Becker bwbecker@watdragon.waterloo.edu Open Text Systems, Inc. Waterloo, Ont. Canada