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

19371Re: [Clip] Re: sorting an array

Expand Messages
  • Jeff
    Jul 1, 2009
    • 0 Attachment
      OK here it is again.

      The original concept is to highlight a name ("Jeffery G. Scism") in a
      document, have the Clip change it to "scism-jeffery-g.htm" on the
      clipboard, so I can autosave the document using that as the file name. I
      don't want to change the name ON te source document, but only the name
      it is saved as. I want it to error out if the Doc already exists. I
      don't want to overwrite existing files. If a file already exists I need
      to merge the new entry, probably manually.

      I had clips that did the name swap in my old computer, but they ere
      lost in a HD Crash.

      I searched the Clips list archive and found some of the previous
      discussion but with what I am starting with I am getting "syntax
      errors" probably due to the improved Reg-ex now in use. It was
      originally written for NoteTab Std 4.95.

      Here is the broken clip I have been working on- it goes NOWHERE. (I
      just can't grasp the concepts apparently).


      __CLIP__

      :PARSE_NAME

      ^!Set %Folder%=^%Drop%
      ^!Toolbar Copy
      ^!SetListDelimiter " "
      ^!SetArray %full_name%=^$GetSelection$
      ^!Set %indexed_name%="^%full_name^%full_name0%%"
      ^!Set %name_counter%=1

      :CreateName
      ^!If ^%name_counter% = ^%full_name0% NameDone
      ^!Set %indexed_name%="^%indexed_name%-^%full_name^%name_counter%%"
      ^!Inc %name_counter%
      ^!Goto CreateName

      :NameDone
      ;strip periods
      ^!Set %indexed_name%=^$StrReplace(".";"";"^%indexed_name%";0;0)

      ^!Set %indexed_name%=^$StrLower("^%indexed_name%")$
      ;(Syntax error this line)
      ^!Set %indexed_name%=^$FileName$.htm

      __/CLIP__/
      /

      Don - HtmlFixIt.com wrote:
      >
      >
      > Hi Jeff,
      >
      > I certainly could, but then I have to keep track of what document I am
      > coming from and then get it back. What we have concluded is that I
      > don't need to do that. I can work directly on a variable (with ^P as
      > separators) or on the clipboard also and that way I need not leave my
      > document at all.
      >
      > I was doing exactly what you are suggesting which is to sort them and
      > then put them back into the array variable.
      >
      > I understand it much better (I think anyway) than I did yesterday. We
      > can probably try to help you with your clip if you post up the relevant
      > parts (or all) and we can probably help you along.
      >
      > Don
      >
      > Jeff wrote:
      > >
      > > Don - HtmlFixIt.com wrote:
      > > What I didn't want to do
      > > was to sort my entire document because that isn't the object I am
      > > working on.
      > >
      > > can you cut the piece to a new document, process it there then cut the
      > > finished work back to Doc Prev? That approach worked for my site
      > > indexing clip.
      > >
      >
      >
      > ------------------------------------------------------------------------
      >
      >
      > No virus found in this incoming message.
      > Checked by AVG - www.avg.com
      > Version: 8.5.375 / Virus Database: 270.13.1/2211 - Release Date: 06/30/09 11:37:00
      >
      >

      --


      Jeffery G. Scism, IBSSG
      Flockmaster,
      International Blacksheep Society of Genealogists

      http://ibssg.org/blacksheep/

      http://bsmeadow.blogspot.com/ Blacksheep's Meadow

      http://www.flickr.com/photos/7764576@N05/ Photostream
    • Show all 25 messages in this topic