home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / toolbl / 32 < prev    next >
Encoding:
Text File  |  1993-01-28  |  3.0 KB  |  67 lines

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