home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!uvaarpa!darwin.sura.net!paladin.american.edu!auvm!UALTAVM.BITNET!TBUTLER
- Message-ID: <TOOLB-L%93012722162636@UAFSYSB.UARK.EDU>
- Newsgroups: bit.listserv.toolb-l
- Date: Wed, 27 Jan 1993 21:00:37 MST
- Sender: Asymetrix 'Toolbook' product discussions <TOOLB-L@UAFSYSB.BITNET>
- From: Terry Butler <TBUTLER@UALTAVM.BITNET>
- Subject: Re: Relationship between Text and Hotwords
- Lines: 56
-
- Although the trail of this topic has gone cold, I found the question
- to be of interest and immediate relevance to what I am doing with
- Toolbook. For students of French, I have an exercise with uses
- a recordField with the text of a story, where numerous
- words (and phrases) are hotWords. These hotWords have the text of
- a verb in its infinitive form.
- Eg in English: I [to go] to the store after [to stop] at the bank.
- The student clicks on the hotWord and is given a series of choices
- through menus to develop the correct verb forms:
- Eg went and stopping
- Now I want to change that part of the text in the recordField to read:
- I went to the store after stopping at the bank.
- I could find no way to relate the hotWord to the text of the field
- which contains it except the following:
-
- -- This script connects the text of a field with the hotwords in it.
- -- It is the only way that the text of a hotword can be changed
- -- under script control: it must be changed as
- -- "chars x to y of text of (record)Field Z"
- -- Changing the text DESTROYS the hotword: if needed, reselect and
- -- recreate it. Changing the text also changes the offsets of
- -- all the hotwords FOLLOWING it: they have to be adjusted
- -- by the difference in length between the new text and the old text.
- -- This script takes a significant time to execute in Toolbook.
- -- NB: the following script assumes that two hotwords are not
- -- immediately adjacent (no space or character between them).
- put the charCount(text of recordField "Text") into lastCount -- the text
- put the objects of recordField "Text" into objList -- the hotwords
- -- Hotwords are reported in their visible order no matter what order
- -- they have been created.
- put 1 into hotWordNumber
- step i from 1 to lastCount
- select char i of (text of recordField "Text")
- if (item 5 of selectedTextState) is false then
- continue step -- the text is not in a hot word
- end if
- put i into firstChar -- first character of the hotword
- while (item 5 of selectedTextState) is true
- increment i
- select char i of (text of recordField "Text")
- -- moving through the hotword
- end while
- -- we have selected the first character after the hotword
- put (i - 1) into lastChar -- last character of the hotword
- -- The system variable offsetList stores the character
- -- offsets of this hotword.
- set item hotWordNumber of offsetList to \
- firstChar && lastChar
- increment hotWordNumber
- end step
-
- Any other ideas? Any hope for something better in version 2.0?
-
- Terry Butler CALL/Humanities Computing Coordinator
- University of Alberta
- TButler@VM.UCS.UALBERTA.CA
-