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

Re: [Clip] Re: book mark indexing for HTML pages

Expand Messages
  • Don - HtmlFixIt.com
    ... ;code fragment by don at htmlfixit dot com ;for Jeff Schism ;Goal is to take Thomas D. Smith ;and yield output smith-thomas-d ;split name at each space
    Message 1 of 5 , Dec 24, 2006
    • 0 Attachment
      Jeff Scism wrote:
      > Thanks Sherri, I have been playoing with it more, (The goal is to
      > create a linked name index for a website)
      >
      >
      > Here is where I am at, which WORKS, the ONLY thing left to figure out
      > is to get it to take the name from the highlighted section, which is
      > normally formatted as "John D. Smith" and convert it to
      > 'smith-john-d' for the 'a name' referenced link.
      >
      ;code fragment by don at htmlfixit dot com
      ;for Jeff Schism

      ;Goal is to take Thomas D. Smith
      ;and yield output smith-thomas-d

      ;split name at each space
      ^!SetListDelimiter " "
      ;set array = selection
      ^!SetArray %full_name%=^$GetSelection$

      ;assemble name in reverse order
      ;step one pull last name to front of list
      ^!Set %indexed_name%="^%full_name^%full_name0%%"


      ;variable number of name parts so create a loop for them
      ;set counter for loop
      ^!Set %name_counter%=1

      :CreateName
      ;decide if we have fully processed or process next piece
      ^!If ^%name_counter% = ^%full_name0% NameDone
      ;add next piece to end
      ^!Set %indexed_name%="^%indexed_name%-^%full_name^%name_counter%%"
      ;increment the counter
      ^!Inc %name_counter%
      ;repeat loop
      ^!Goto CreateName

      ;here is where you would use indexed name
      :NameDone
      ;strip periods
      ^!Set %indexed_name%=^$StrReplace(".";"";"^%indexed_name%";0;0)$
      ;convert to lower case
      ^!Set %indexed_name%=^$StrLower("^%indexed_name%")$
      ^!Info [C]Here is Where You Would Return to Processing: ^%indexed_name%
    Your message has been successfully submitted and would be delivered to recipients shortly.