Loading ...
Sorry, an error occurred while loading the content.

RE: [Clip] Build an Index

Expand Messages
  • ajyoung@insolwwb.net
    I posted this last Thursday but it never showed up so I m sending it again. Thanks. Hi, all, I ve been on the road for 3 days and am about to leave again for a
    Message 1 of 8 , Feb 11, 2001
    • 0 Attachment
      I posted this last Thursday but it never showed up so I'm sending it
      again. Thanks.

      Hi, all,
      I've been on the road for 3 days and am about to leave again for a
      couple of days. I've been doing this by hand (CTR+R, etc.) but I know
      (maybe) that NoteTab can do it faster. I'm sorry about the lack of
      clarity, but I think that Alan had the idea.

      > sounds like yours be called a keyword search or reference system
      > with an index that uses html as the means to accomplish its end
      > result.

      I'm not referencing every word in the documents just certain words.
      I'll show you what I'm trying to do and what I've got so far. I've
      done part of it without variables or prompts:

      H="Search and Replace"
      ^!Set %webpage%=^?{(T=O;S=M)What document do you wish to index?}
      ^!Set %searchword%=^?{What word do you wish to index?}
      ^!Info Your file is ^%webpage%. Your search word is ^%searchword%
      ^!Set %findnumber%=1001
      ^!Set %abbrevwrd%=^$StrCopyLeft(^%searchword%;3)$
      ^!Set %abbrevnum%=^$StrCopyRight(^%findnumber%;3)$
      ^!Set %hrefname%=^%abbrevwrd%^%abbrevnum%
      !Info Your counter marking number is ^%findnumber%. Your abbreviated
      search word and counter is ^%abbrevwrd% and ^%abbrevnum%. Your next
      search will reference ^%hrefname%
      ^!Open ^%webpage%
      ^!Jump LINE_START
      ^!Replace "{prince(s|(es)|d|(ed))*}" >> "<a name="pri001">\1</a>" CW
      ^!Inc %findnumber%
      ^!Set %abbrevnum%=^$StrCopyRight(^%findnumber%;3)$
      ^!Set %hrefname%=^%abbrevwrd%^%abbrevnum%
      ^!Info Your counter marking number is ^%findnumber%. Your abbreviated
      search word and counter is ^%abbrevwrd% and ^%abbrevnum%. Your next
      search will reference ^%hrefname%
      ^!Replace "{prince(s|(es)|d|(ed)|(ing))*}">&</a>" >> "<a
      name="pri002">&</a>" CW
      ^!Close SAVE

      H="Add to Index"
      ^!Open "indexpage1.htm"
      ^!Replace "<-- End of Index -->^P" >>
      "<dt>prince:</dt>^P<dd>webpage1.html: <a
      href="webpage1.html#pri001">001</a>, <a
      href="webpage1.html#pri001">001</a>, <a
      href="webpage1.html#pri002">002</a></dd>^P<-- End of Index -->^P"
      ^!Close SAVE

      I still have several problems to work out. I need to get my search and
      replace to work with the named variables and with forms of the word.
      What I've got in the example doesn't do the job. So I could really use
      some help here. There are probably ways to clean things up.

      The direction I'm heading is as follows. Of course I don't mind going
      a better, simpler path. I plan to create the loops for incrementing
      the variable and change the incrementing to a sub-routine (function?
      my progaming weakness is showing). Then I need a Conditional statement
      to stop when there are no more words in the document. I need to retain
      the variables %webpage%, %searchword% and %findnumber% to create the
      addition to the index page without referencing the %webpage% file.
      Just increment according to the increase of %findnumber% from its
      original setting. Based on the basic stuff one of the lines of the
      above the clip for building the index might be changed like this:
      <a href="^%webpage%#^%hrefname%">^%findnumber%</a>

      Thanks,
      Andy
    Your message has been successfully submitted and would be delivered to recipients shortly.