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

Re: [Clip] DO loops

Expand Messages
  • Robert Bull
    Hello, Ian; Sunday, November 21, 2010, 11:41:48 PM, you wrote: IaY I have not read the old threads, but this is what I do. I didn t think to do that - Don,
    Message 1 of 4 , Nov 22, 2010
      Hello, Ian;

      Sunday, November 21, 2010, 11:41:48 PM, you wrote:

      IaY> I have not read the old threads, but this is what I do.

      I didn't think to do that - Don, thanks for the tip.

      IaY> I use loops regularly. I was using the pre-made one from the "quick
      IaY> list" but now I have two pre-made loops in a functions.
      [...]

      That's far too advanced for me ATM :) I wish I'd discovered the loop
      in the Quick List before, as it would have been most of what I needed.
      But not all, as I also had a struggle with Masked Input Fields. I use
      the Donation Coder forums at
      http://www.donationcoder.com/Forums/bb/index.php They use SMF
      software, and using either the "It's All Text!" extension in Firefox,
      or the similar (but multi-browser) feature in Listary,
      http://www.listary.com/ , I edit all but very short messages in NTP. I
      wanted a clip to set the SMF code for a bulleted list of any length up
      to 99. That's a lot more than is normally sensible, but I couldn't
      immediately see how to restrict the maximum number in an NTP input
      field, not that it really matters. The clip below is cobbled together
      from the Help file, augmented by a bit of searching in the NoteTab
      Clips forum:

      ------------------
      ^!Set %elements%=^?[(M="09;0; ")Number of items]
      ^!IfError Exit
      ^!If ^%elements%=0 Quit
      [list]

      ^!Set %num%=0
      :StartLoop
      [li] [/li]

      ^!Inc %num%
      ^!If ^%num%>=^%elements% EndLoop ELSE StartLoop
      :EndLoop
      [/list]

      :Quit
      ------------------

      For an input value of 3, it generates this:

      ------------------
      [list]
      [li] [/li]
      [li] [/li]
      [li] [/li]
      [/list]
      ------------------

      Have I missed anything I should have included, particularly regarding
      error checking?


      --
      Thanks,

      Robert Bull
      mailto:barlennan@...
    Your message has been successfully submitted and would be delivered to recipients shortly.