Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!rochester!pt.cs.cmu.edu!cat.cmu.edu!ns From: ns@cat.cmu.edu (Nicholas Spies) Newsgroups: comp.sys.mac.hypercard Subject: Re: Problem with "word" Message-ID: <3336@pt.cs.cmu.edu> Date: 18 Oct 88 13:54:10 GMT References: <135@sunset.MATH.UCLA.EDU> Sender: netnews@pt.cs.cmu.edu Organization: Carnegie-Mellon University, CS/RI Lines: 50 The HyperCard Script Language Guide: The HyperTalk Language, on page 55, says that "Words are composed of any characters, including punctuation, delimited by spaces, and are designated by the chunk name _word_..." sounds simple enough--only problem is that it's not true, in that European characters such as the German double-s ("B") are treated as a space, too. This is a particular shame, because it further complicates using HyperCard for language-tutorial stacks, an obvious and important class of application. Some new text operations would help greatly: such as... --the clickLine == return the line number of a field clicked on, compensating properly for scrolling and wideMargins; --if the above is too difficult, because of line wraparound, have the clickLine return the _text_ delimited on either end by return characters; --the clickWord == return the space-delimited word clicked on; this shouldn't be hard to do because HyperCard can do it already with a double-click for selection OR command-click to put word into Message, both which sort of do what's wanted but require special user action and have the side effects of selecting the word or showing message box. -- the clickChars first, last == return an arbitrary string of characters starting from character "first" to character "last"; thus the clickChars |,| could be used to return substring between "|" characters, for example. --the offsetLine(pattern, text) return the line number of pattern in text; this would be extremely useful for table lookups. --permit the programmer to decide what character to use to separate an item list; retain commas as default, but permit changing the character used for items with "set itemChar to " which would last for the duration of execution of the current handler; this would not conflict with current usage and would allow many interesting parsing operations to be done quite easily. -- define "comma" as a system constant, like "space" and "return". --the selectedPos == return the character position of the start of the selection, even if the selection is just an insertion point; one should be able to indicate where to, say, split a paragraph of text with a single click, rather than having to make a slow and potentially dangerous selection by dragging accross the text. -- Nicholas Spies ns@cat.cmu.edu.arpa Center for Design of Educational Computing Carnegie Mellon University