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

[NTB] Re: Arrays?

Expand Messages
  • Wayne M. VanWeerthuizen
    ... Clip programming is considered an advanced topic. To keep beginners from getting too overwhelmed on this list, most advanced topics are discussed on the
    Message 1 of 10 , Nov 1, 1998
    • 0 Attachment
      djust@... wrote:
      >There was a guide somewhere to different methods for setting
      >up arrays in NTP. Anyone remember where?

      Clip programming is considered an advanced topic. To keep
      beginners from getting too overwhelmed on this list, most
      advanced topics are discussed on the NoteTab ADVANCED list.

      Followups to this message should be sent to the advanced
      list, rather than to here.

      --------

      The basic method for creating arrays is the create simple
      variables with similar names, such as

      ^!Set %Item1%="First Item"
      ^!Set %Item2%="Second Item"
      ^!Set %Item3%="Third Item"


      It is convenient that part of NoteTab variable name, can
      be the contents of another variable. Below %ItemNumber%
      is assigned the value 4, then the %ItemNumber% variable is
      used in forming the name of another variable: %Item4%

      ^!Set %ItemNumber%=4
      ^!Set %Item^%ItemNumber%%="Another Item"

      NoteTab parses this command in stages. In the first stage
      the ^%ItemNumber$ is replaced with a 4. Then the command
      effectively becomes: ^!Set %Item4%="Another Item". Pay
      careful attention to the placement of the % (percent) and
      ^ (circumflex) symbols.






      It is easy to use a loop to access each item in the array.


      ^!Set %ItemNumber%=1
      :OurLoop
      ^!Info Item Number ^%ItemNumber% is: ^%Item^%ItemNumber%%
      ^!Inc %ItemNumber%
      ^!If ^%ItemNumber% <= 4 OurLoop



      Several of my clips take advantage of array techniques.
      If you ask, I can send you some other examples.


      I'll note that above, where I have ^%ItemNumber%, you can
      have text strings (without spaces or special characters)
      instead of just numbers. For example:

      ^!Set %ItemMONDAY%="Something"
      ^!Set %ItemTUESDAY%="Something else"

      ^!Set %Day%="SATURDAY"
      ^!Info ^%Item^%Day%%


      Here is my demonstration clip.
      =========================================

      H="Wayne's Array Demo Clip version 5"
      ^!ClearVariables
      ^!Set %NumItems%=5
      :SetupQuery
      ^!ClearVariable %Query%
      ^!Append %Query%=%NewNum%=^?{Change the number of items=_No Change^=NC|1|2|3|4|5|6|7|8|9|10|100|200|400|800|1600|3200}

      ^!Set %Count%=0
      :LoopForInput
      ^!Inc %Count%
      ^!Set %Default1%=^$[^%Count%*2;0]
      ^!Append %QUERY%=; %Array^%Count%%=^?{Item#^%Count%=_^%Default1%|Notetab|Is|Awesome}
      ^!If ^%Count% < ^%Numitems% LoopForInput

      ^!SetWizardTitle Array Test 5
      ^!SetWizardLabel Set The Following ^%Numitems% Items.
      ^!Set ^%Query%

      ^!IfSame ^%Newnum% NC LoopForOutput
      ^!Set %Numitems%=^%Newnum%
      ^!Goto Setupquery

      :LoopForOutput
      ^!Set %Count%=0
      :LoopForOutput2
      ^!Inc %Count%
      ^!Set %Output%="^%Output% Item #^%Count% = ^%Array^%Count%%^P"
      ^!Iftrue ^%Count%<^%Numitems% LoopForOutput2

      ; Display Output All At Once
      ^!Info=[L]^%Output%



      --
      Wayne M. VanWeerthuizen
      ICQ: 15117288
      Homepage: http://www2.localaccess.com/waynemv
      ------------------------------------------------------------------------
      Subscribe, unsubscribe, opt for a daily digest, or start a new e-group
      at http://www.eGroups.com -- Free Web-based e-mail groups.
    • Wren McMains
      Hi Eric, The pictures are beautiful. I ll be curious to hear what kind of a market there is for these. I wouldn t pay for one in its current form, but I
      Message 2 of 10 , Nov 1, 1998
      • 0 Attachment
        Hi Eric,

        The pictures are beautiful. I'll be curious to hear what
        kind of a market there is for these. I wouldn't pay for one
        in its current form, but I admit I'm not a screen saver kind
        of person (ever since the advent of energy saving monitors I
        usually just turn off my monitor without ever going to a
        screen saver first.)

        The free ones are fine, the advertising is not too obnoxious.

        As you say they display VERY well at high-res on a 21"
        monitor--so nice I wanted to use some as backgrounds, but
        you seem to make that impossible ;-) After finding that, I
        wasn't even willing to take the time to download a second --
        I went for CH first, one of my favorite countries (been far
        to long since my last visit.)

        Any chance of posting a seasonal .jpg of the month on one of
        your pages that would work well as a background -- I really
        like your photography.

        Best of Luck,
        Wren

        p.s.

        >There is one detail I haven't seen mentioned yet.
        >
        >It is: http://www.stardustsoftware.com/sstoolkit/

        I checked out one of the free ones from someone claiming to
        be in the photography business -- the quality of Eric's is
        SO much better. (A good camera, lens and scanner still
        gives better quality than the digital cameras.)
        ------------------------------------------------------------------------
        Subscribe, unsubscribe, opt for a daily digest, or start a new e-group
        at http://www.eGroups.com -- Free Web-based e-mail groups.
      • R.S.
        Hi David, ... This is how it works: ;*********************** H=Arrays ^!Set i=1 ^!Set arr^%i%= One ^!Inc i ^!Set arr^%i%= Two ^!Inc i ^!Set arr^%i%= Three
        Message 3 of 10 , Nov 1, 1998
        • 0 Attachment
          Hi David,

          At 08:02 AM 11/01/98 +0200, you wrote:

          >There was a guide somewhere to different methods for setting
          >up arrays in NTP. Anyone remember where?


          This is how it works:

          ;***********************
          H=Arrays

          ^!Set i=1

          ^!Set arr^%i%="One"
          ^!Inc i
          ^!Set arr^%i%="Two"
          ^!Inc i
          ^!Set arr^%i%="Three"

          ;ALWAYS SAVE INDEX TO LAST CREATED ITEM TO
          ;HAVE CONTROL OVER THE ARRAY:
          ^!Set iArrayTop=^%i%

          ^!Info First array item is = ^%arr1% ^p Second array item is = ^%arr2% ^p
          Third array item is = ^%arr3%



          ;YOU CAN ALSO USE A LOOP TO GET THE CONTENTS OF THE ARRAY:
          ^!SetWizardTitle Recursing array through a loop

          ^!Set i=1
          :loop
          ^!If ^%i%>^%iArrayTop% Next1
          ^!Info Array item ^%i% is = ^%arr^%i%%
          ^!inc i
          ^!Goto loop

          :Next1
          ;NOW, AS CONSCIOUS PROGRAMMERS WE ARE, WE SHOULD
          ;CLEAN AFTER OURSELVES:
          ; (notice how I'm avoiding the sloppy use of
          ; the ^!ClearVariables command -- a programmer
          ; should always know his/her variables!)

          ;DELETE THE ARRAY:
          ^!Set i=1
          :loop2
          ^!If ^%i%>^%iArrayTop% Next2
          ^!ClearVariable %arr^%i%%
          ^!inc i
          ^!Goto loop2

          :Next2

          ;THIS WILL SHOW THE VARIABLES ARE CLEARED:
          ^!SetWizardTitle After Variables were cleared:
          ^!Set i=1
          :loop3
          ^!If ^%i%>^%iArrayTop% End
          ^!Info Array item ^%i% is = ^%arr^%i%%
          ^!inc i
          ^!Goto loop3
          ;************************




          Regards,


          RS
          ------------------------------------------------------------------------
          Subscribe, unsubscribe, opt for a daily digest, or start a new e-group
          at http://www.eGroups.com -- Free Web-based e-mail groups.
        • Lawrence R. Thomas
          Hi Wren, ... You can download some pictures from Eric as I have from: http://www.unige.ch/sciences/terre/geologie/fookes/photos.htm If you have a suitable
          Message 4 of 10 , Nov 1, 1998
          • 0 Attachment
            Hi Wren,

            At 11:20 AM 11/1/98 -0500, you wrote:
            >Hi Eric,
            >
            >The pictures are beautiful. I'll be curious to hear what
            >kind of a market there is for these. I wouldn't pay for one
            >in its current form, but I admit I'm not a screen saver kind
            >of person (ever since the advent of energy saving monitors I
            >usually just turn off my monitor without ever going to a
            >screen saver first.)
            >
            >The free ones are fine, the advertising is not too obnoxious.
            >
            >As you say they display VERY well at high-res on a 21"
            >monitor--so nice I wanted to use some as backgrounds, but
            >you seem to make that impossible ;-) After finding that, I
            >wasn't even willing to take the time to download a second --
            >I went for CH first, one of my favorite countries (been far
            >to long since my last visit.)
            >
            >Any chance of posting a seasonal .jpg of the month on one of
            >your pages that would work well as a background -- I really
            >like your photography.
            >
            >Best of Luck,
            > Wren

            You can download some pictures from Eric as I have from:

            http://www.unige.ch/sciences/terre/geologie/fookes/photos.htm

            If you have a suitable graphics editor such as Paint Shop Pro, you can
            remake these images into very nice wallpaper. I especially like
            suisse3t.jpg which I found at:

            http://www.unige.ch/sciences/terre/geologie/fookes/pictures/suisse3t.jpg

            Regards,



            Larry Thomas
            larryt@...

            ------------------------------------------------------------------------
            Subscribe, unsubscribe, opt for a daily digest, or start a new e-group
            at http://www.eGroups.com -- Free Web-based e-mail groups.
          • R.S.
            Hi Eric and Wren, At 11:20 AM 11/01/98 -0500, you wrote: ... The pictures are fantastic, I agree with Wren. I was really impressed. As for the market, I think
            Message 5 of 10 , Nov 2, 1998
            • 0 Attachment
              Hi Eric and Wren,

              At 11:20 AM 11/01/98 -0500, you wrote:

              Wren wrote:

              >The pictures are beautiful. I'll be curious to hear what
              >kind of a market there is for these. I wouldn't pay for one
              >in its current form, but I admit I'm not a screen saver kind
              >of person (ever since the advent of energy saving monitors I
              >usually just turn off my monitor without ever going to a
              >screen saver first.)

              The pictures are fantastic, I agree with Wren. I was really impressed.

              As for the market, I think there are many people using screen savers and
              many who are willing to pay for it. To my utter amazement I've actually
              seen people coming into a computer store and ASKING (!) for screen savers.
              Several times. --- As Wren, I would like to know about your success, which
              I wish you have, in this enterprise.

              I personally don't use screen savers, I find them distracting and
              irritating. Last one I tried was the Maccaroni screen saver from Risoft,
              which was really cute; but, after a while, I was climbing up the walls!
              Long ago I settled for the blank screen saver, which has become my all time
              favorite. Besides, with an energy saving monitor, there's no material need
              for a screen saver. --- But the fact is that, anyway, most people USE
              screen savers, so don't loose hope! And, again, your photographs are really
              good.



              Regards,


              RS
              ------------------------------------------------------------------------
              Subscribe, unsubscribe, opt for a daily digest, or start a new e-group
              at http://www.eGroups.com -- Free Web-based e-mail groups.
            Your message has been successfully submitted and would be delivered to recipients shortly.