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

Re: [Clip] Arrays

Expand Messages
  • Larry Hamilton
    Robert, Here is something I got from SMYRU on the clips list in the Fall of 1999, I think. You will see it has a base routine marked off. I put a comment
    Message 1 of 2 , Apr 25 5:19 PM
    • 0 Attachment
      Robert,

      Here is something I got from SMYRU on the clips list in the Fall of 1999, I
      think.

      You will see it has a "base routine" marked off. I put a comment above the
      line that does what you want, it looks like this: ^!SetArray
      %Line%=^%All^%_%%
      You have to set up multiple arrays before you get to this line. In this case
      it was for working with a delimited text file, but should easily be adapted
      to many other uses.

      <--Clip Starts after this line.-->
      ; --- starts base routine ---
      ;From SMYRU on clips list fall 1999??
      ^!Set %_%=1
      ^!SetListDelimiter ^p
      ;^!Set %file%=^?{(T=O;F="My base file|*.*")Point the source of base=C:\My
      Documents\HNGS_Mem.txt}
      ^!Set %file%="C:\My Documents\whatever.txt"
      ^!SetArray %All%=^$GetFileText(^%file%)$
      ^!Toolbar New document
      ^!SetScreenUpdate Off

      :get_line
      ^!If ^%All0% < ^%_% no_more_lines
      ^!SetListDelimiter |
      ;The next line is key.
      ^!SetArray %Line%=^%All^%_%%
      ^!Inc %_%
      ; --- ends base routine ---
      ;^!IfFalse ^%Line3% do_nothing
      ;Line is and array that holds the lines of the text file, and the numbers
      represent the items in each part of each line delimited by a | (Vertical
      Bar).
      ^%NL%^%line14%|^%Line6% ^%Line3% ^%Line2% ^%Line4%
      ^%Line5%|^%line12%|^%Line7% ^%Line8%, ^%Line9% ^%Line10% ^%Line11%,
      ^%Line18%|^%line17%|^%Line16%
      ^!Goto get_line

      :do_nothing
      ;^%NL%^%Line1%|^%Line2%|^%Line4%|^%Line5%|^%Line6%
      ^!Goto get_line
      <--Clip ends above this line.-->

      HTH,

      Larry Hamilton

      ----- Original Message -----
      From: "Robert Barrows" <Robert.Barrows@...>
      To: <ntb-clips@yahoogroups.com>
      Sent: Thursday, April 25, 2002 3:37 PM
      Subject: [Clip] Arrays


      > I'm trying to create a clip to sort headings in an HTML document.
      > I want to store the name of the heading, and then the text of the heading
      in an array.
      > Things would be easier if I could have sub-headings be sub-entries in the
      array.
      > The NoteTab help file doesn't mention anything about using multiple
      dimensions in an array. The example array is just a one column list with the
      first entry being the number of entries.
      >
      > Can I do something like this:
      >
      > ^!SetArray %Array%HLEVEL%%Count%%=^$GetSelection$
      >
      > Thanks.
      >
      > -Rob.
      > This e-mail contains PortalPlayer INTERNAL INFORMATION.
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.