Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!brunix!cs.brown.edu!man From: man@cs.brown.edu (Mark H. Nodine) Newsgroups: comp.sys.mac.hypercard Subject: Re: Hypertalk questions for gurus... Message-ID: <63627@brunix.UUCP> Date: 4 Feb 91 19:45:46 GMT References: <9101292006.aa01354@BONNIE.ICS.UCI.EDU> <48786@apple.Apple.COM> Sender: news@brunix.UUCP Reply-To: man@cs.brown.edu (Mark H. Nodine) Organization: Brown Computer Science Dept. Lines: 32 In article <48786@apple.Apple.COM>, jdevoto@Apple.COM (Jeanne A. E. DeVoto) writes: |> In article <9101292006.aa01354@BONNIE.ICS.UCI.EDU> |> rhutchin@BONNIE.ICS.UCI.EDU writes: |> > So I have a table of contents set up with "Chapter" names in one field. |> > When the user clicks on a line that has the name of the chapter, it |> > sets the visible of the appropriate field that contains the names of |> > "sections" in the chapter. But I'd like to keep the chapter name hilighted |> > in when I write into other fields, so the user can see how they got where |> > they are. So here's what the problem boils down to: How can I write text |> > into a field while NOT altering the selected text in another field? |> |> Basically, you can't -- you can only have one selection at a time. |> You have a couple of alternatives: |> |> [two proposed solutions] Another solution that I have used in the past is to ignore Hypercard's highlighting ability and mark the selection by a different mechanism. Specifically, what I did was to start each line with a space and use the bullet character (option-8) in character 1 to indicate the selection. So a selection looks something like set char 1 to 1 of line selLine to " " set char 1 to 1 of line newLine to "" set selLine to newLine The advantages of this are that (1) it is quick, (2) it works even in a scrolling field, and (3) the field maintains a permanent record of what is selected. --Mark