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

RE: Looking for clip/ method to alphabetise...

Expand Messages
  • Peter Stagg
    ... The following clip will create a string of the open file names that is ... H= Alphabetise File Names ^!ClearVariables ;Copy the document count in a
    Message 1 of 1 , Apr 13, 2003
      > Message: 1
      > Date: Sun, 13 Apr 2003 14:04:46 +0200
      > From: "Grant Botes" <grantbotes@...>
      > Subject: Looking for clip/ method to alphabetise
      > document/file tab bar in NoteTab
      > Hi
      > I'm pretty new to NoteTabT "clipping", but I've been working on a
      > clip library for authoring HTML Help for a while now. It's starting
      > to get useful now, but I still need a way to alphabetise the
      > document/ file tab bar.
      > My clip library regards open documents as HTML Help topics, and uses
      > the filename and title to generate the HTML Help table of Contents
      > and Index. The order in which documents appear on the tab bar
      > determinses their order in the table of contents. From time to time,
      > it is useful to have these alphabetically sorted but I can't find a
      > way to do it.

      The following clip will create a string of the open file names that is
      alphabetised it may be of some use to you:

      -------------------- Copy From Here --------------------
      H="Alphabetise File Names"
      ;Copy the document count in a variable
      ^!Set %Index%=^$GetDocCount$
      ;Don't update the screen while looping through the docs
      ^!SetScreenUpdate Off
      ;Check every open document through the following loop
      ;Activate the specified document (starts with the last one in the tab bar)
      ^!SetDocIndex ^%Index%
      ;Skip if the document is a Clipbook library
      ^!IfTrue ^$IsClipDoc$ UpdateIndex
      ;Add the File Name to a string
      ^!Set %OrgDocName%=^$GetDocName(^%Index%)$
      ^!IfFalse ^%FileNames% NEXT ELSE SKIP
      ^!Set %FileNames%=^$GetName(^%OrgDocName%)$
      ^!Set %FileNames%=^$GetName(^%OrgDocName%)$^P^%FileNames%
      ;Substract one from the Index value
      ^!Dec %Index%
      ;Go back to start of loop if there are still documents left to check
      ^!If ^%Index% > 0 LoopStart
      ;Else sort the file names
      ^!Set %FileNames%=^$StrSort(^%FileNames%;True;False;False)$
      ;Display the file names (sorted)
      ^!Info [L]^%FileNames%
      -------------------- Copy To Here --------------------
    Your message has been successfully submitted and would be delivered to recipients shortly.