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

Re: [Clip] Loop within a ^& [HIGHLIGHTED]Selection Question

Expand Messages
  • Alan C.
    Hi Hans, ... (an array clip code is below) To follow NoteTab s tradition, someone will have/create a third way, but until then: From text that you have
    Message 1 of 4 , May 9, 2001
    • 0 Attachment
      Hi Hans,

      >...applying clip above, the result is the the following:
      >
      >STEPHEN
      >BY2STEPHEN
      >CZ3STEPHEN
      >STEPHEN

      (an array clip code is below)

      To follow NoteTab's tradition, someone will have/create a third way, but
      until then:

      From text that you have selected, you want first three characters of each
      line stripped -> If I have a correct understanding of desired tasks for
      clip to perform then, as far as clip's needed structure/mechanics -> I see
      2 somewhat differing ways to do it -> Either 1. you need an array or else,
      instead, 2. paste your entire selection into a new doc and then "work" the
      pasted text on a "line by line" basis (can close discard that doc just
      previous to clip's end) but paste/insert its accumulated results into
      another, your keeper doc.

      This is a fun one, brought me some needed practice, gave exercise to my
      thinking cap which had been sitting over in the corner collecting dust.

      Thanks to all my teachers, Jody, Wayne, Eb, Claes, Charles, and, really,
      All members on this list, too many to mention here, there's not been a
      member that I didn't learn something from.

      Following uses an array, advances/"works" one line at a time during each
      loop. The clip worked for me when I tested it on Hans's sample text.

      ; Last edited:Wednesday, 09 May 2001
      ^!ClearVariables
      ^!Set %lines%=^$GetSelection$
      ^!SetListDelimiter ^p
      ^!SetArray %lines%=^%lines%
      ^!Set %index%=0
      :Loop
      ^!Inc %Index%
      ^!If ^%Index% > ^%lines0% wrapup
      ^!Set %x%=^$StrDelete("^%lines^%Index%%";1;3)$
      ^!Append %s%=^%x%^%NL%
      ^!Goto Loop
      :wrapup
      ^!StatusClose
      ^!TOOLBAR New Document
      ^!InsertText ^%s% ^p
      ^!Save As "c:\temp\test_pos_1-3_^$GetDate(yyyymmddhhnnss)$.txt"
      ;---<end clip code<<

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