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

using a variable in a wizard?

Expand Messages
  • Don
    Not having any luck trying to do this. From help: ^?[(T=C)Choose a value==Value1|Value2|_DefaultValue3|Value4|Value5] Combobox field with 5 items in the list.
    Message 1 of 25 , Dec 27, 2011
    • 0 Attachment
      Not having any luck trying to do this.

      From help:
      ^?[(T=C)Choose a value==Value1|Value2|_DefaultValue3|Value4|Value5]

      Combobox field with 5 items in the list. DefaultValue3 is selected by
      default because it is preceded by an underscore character. The double
      equal sign means the user can only choose one of the values contained in
      the list.

      If I do a set a variable .... it doesn't work because the ^ is a special
      character in wizards I think and/or it's not evaluated.

      ^!Set %testvar%="one|_two|three"
      ^?[(T=C)Choose a value==^%testvar%]
    • Don
      ... Think I got it from a great old thread! ^!Set %testvar%= ^!Append %testvar%= ^?{(T=C)Choose a value==one|_two|three} ^%testvar% ^!Set
      Message 2 of 25 , Dec 27, 2011
      • 0 Attachment
        On 12/27/2011 10:16 AM, Don wrote:
        > Not having any luck trying to do this.
        >
        >>From help:
        > ^?[(T=C)Choose a value==Value1|Value2|_DefaultValue3|Value4|Value5]
        >
        > Combobox field with 5 items in the list. DefaultValue3 is selected by
        > default because it is preceded by an underscore character. The double
        > equal sign means the user can only choose one of the values contained in
        > the list.
        >
        > If I do a set a variable .... it doesn't work because the ^ is a special
        > character in wizards I think and/or it's not evaluated.
        >
        > ^!Set %testvar%="one|_two|three"
        > ^?[(T=C)Choose a value==^%testvar%]


        Think I got it from a great old thread!
        ^!Set %testvar%=""
        ^!Append %testvar%="^?{(T=C)Choose a value==one|_two|three}"
        ^%testvar%

        ^!Set %choices%="five|_six|seven"
        ^!Set %testvar2%=""
        ^!Append %testvar2%="^?{(T=C)Choose a value==^%choices%}"
        ^%testvar2%

        http://tech.groups.yahoo.com/group/ntb-clips/message/15449
      • Don
        Okay, saving bookmarks ... Think I have this down pretty well. Note that I use .*? instead of the line feed, carriage return bit from John s clip. Here is the
        Message 3 of 25 , Dec 27, 2011
        • 0 Attachment
          Okay, saving bookmarks ...
          Think I have this down pretty well. Note that I use .*? instead of the
          line feed, carriage return bit from John's clip.

          Here is the Library:
          = V5 MultiLine NoSorting TabWidth=30

          H=";Bookmark Manager"


          H="Find BookMarks/Titles"
          :JumpToTitleClip
          ;by don at htmlfixit dot com
          ;using many thoughts of others!

          :CreateBookmarks
          ;create bookmarks
          ^!Set %bookmarks%=""
          ^!Jump Doc_Start
          ^!SetListDelimiter |
          ;get the titles without Title:: per suggestion in list
          ^!Set %bookmarkchoices%="^$GetDocMatchAll("(##)(.*?)(##)";2)$"
          ;by using append the wizard is not executed in real time
          ^!Append %bookmarks%="^?{(T=C)Choose a bookmark==_^%bookmarkchoices%}"

          :GenerateList
          ;offer choice of bookmarks
          ;note that the variable bookmarks in the wizard we set above with append
          ^!Set %goGetIt%="^%bookmarks%"
          ^!Find "##^%goGetIt%##" TIWS
          ^!ClearVariable %goGetIt%
          ;line 21 including blanks/comments above -- look for long lines if not true




          H="Insert Book Mark"
          ##^?[Type bookmark name]##

          H="Remove Bookmark"
          :JumpToTitleClip
          ;by don at htmlfixit dot com
          ;using many thoughts of others!

          :CreateBookmarks
          ;create bookmarks
          ^!Set %bookmarks%=""
          ^!Jump Doc_Start
          ^!SetListDelimiter |
          ;get the titles without Title:: per suggestion in list
          ^!Set %bookmarkchoices%="^$GetDocMatchAll("(##)(.*?)(##)";2)$"
          ;by using append the wizard is not executed in real time
          ^!Append %bookmarks%="^?{(T=C)Choose a bookmark==_^%bookmarkchoices%}"

          :GenerateList
          ;offer choice of bookmarks
          ;note that the variable bookmarks in the wizard we set above with append
          ^!Set %goGetIt%="^%bookmarks%"
          ^!Replace "##^%goGetIt%##" >> "" ACIWS
          ^!ClearVariable %goGetIt%
          ;line 21 including blanks/comments above -- look for long lines if not true




          H="Generate Copy Without Bookmarks"
          :Generat Clean Copy
          ;by don at htmlfixit dot com
          ;using many thoughts of others!

          :CopyDocument
          ^!ToolBar Copy All
          ^!ToolBar Paste New
          ^!Replace "##.*?##" >> "" RAWS
          ;line 9 including blanks/comments above -- look for long lines if not true


          End of the library is above ... and following is the test data:
          ##Yummy Dog Food##
          Ut eu ligula nec nibh laoreet feugiat ac sit##BOOKMARKS CAN BE
          ANYWHERE## amet diam. Curabitur orci ligula, aliquam in posuere eget,
          feugiat eu arcu. Ut faucibus metus vitae quam dictum vehicula. Sed ac
          felis sit amet lectus rhoncus porta congue in nulla. Nulla sed turpis
          sem. Quisque gravida feugiat risus, ut laoreet nunc rutrum sed. Donec
          bibendum nisl vitae tellus aliquam ultricies. Sed var##MUST BE ON ONE
          LINE HOWEVER##ius vestibulum dui, at auctor felis pharetra a. Proin
          faucibus rhoncus nisi, eget euismod risus gravida eget. Vestibulum vel
          erat scelerisque justo volutpat faucibus. Proin vitae ligula non enim
          gravida blandit sit amet eu nunc.

          ##Yummy Cat Food##
          Cras blandit urna vel nisi blandit ut fermentum mauris mattis. Donec
          elit risus, hendrerit eget laoreet quis, aliquam et velit. Curabitur
          magna risus, venenatis eget vehicula eu, tincidunt vel arcu. Ut euismod
          purus id risus imperdiet venenatis. Quisque pretium porta hendrerit.
          Nullam vel feugiat nibh. Mauris molestie vehicula mattis. Quisque
          molestie, massa sit amet consequat porttitor, dolor nulla sodales nisi,
          at vulputate turpis dui sed felis. Pellentesque ut mauris nec velit
          lacinia ultricies nec ut velit. Pellentesque nec enim quis sapien
          vulputate adipiscing. Vivamus sagittis nunc eget orci bibendum nec
          convallis nisl placerat. Nam ante velit, interdum eget mattis at,
          ultricies non ante. Cras congue pharetra velit, sed commodo ante
          facilisis non. Maecenas eleifend tellus viverra velit varius id
          dignissim libero consectetur. Mauris mattis pretium nisi, ac molestie
          felis elementum sit amet. Etiam ac nisi id ligula cursus condimentum.

          ##Yummy Fish Food##
          Curabitur vestibulum iaculis imperdiet. Aenean id aliquet tortor. Duis
          in diam vel elit rutrum aliquam. Pellentesque non quam a risus congue
          lacinia. Nullam lacus mauris, bibendum sit amet bibendum sed, mollis
          quis##test book mark## nibh. Vestibulum laoreet dignissim lectus. Etiam
          gravida arcu ac arcu pellentesque at gravida eros facilisis. Fusce in
          commodo ligula. Maecenas faucibus gravida metus at gravida. Quisque vel
          ligula est. Fusce ultricies turpis quis orci blandit posuere.

          ##Yummy Gopher Food##
          Nam ipsum arcu, mollis eu lobortis sed, egestas eu ligula. Phasellus
          neque leo, malesuada nec posuere non, luctus eu velit. Aenean vel mattis
          tellus. Pellentesque sit amet ante in tortor dignissim suscipit a ut
          metus. Donec dictum semper leo, viverra aliquam ligula lacinia a.
          Integer augue leo, sagittis et imperdiet ut, ornare ut nisl. Aliquam
          erat volutpat. Vestibulum ##Yummy puppy Food## ante ipsum primis in
          faucibus orci luctus et ultrices posuere cubilia Curae; Sed luctus
          porttitor nunc, quis mattis urna mattis id. Sed aliquet diam non neque
          vestibulum venenatis. Nulla tempus laoreet imperdiet. Fusce dictum
          tincidunt nibh eu tempor. Donec at mi dui, sit amet faucibus massa.
          Donec neque dolor, consectetur vel elementum ut, varius ut risus. Nunc
          sit amet velit eget nibh eleifend aliquam in ac tellus.

          ##Yummy Deer Food##
          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque
          vulputate, justo vel varius dignissim, mi odio rhoncus nibh, ac luctus
          dui tortor a eros. Sed mollis semper tortor nec adipiscing. Phasellus
          adipiscing auctor libero ac placerat. Vestibulum metus eros, consequat
          nec pretium id, cursus eget risus. Suspendisse vel augue vitae odio
          pellentesque suscipit ut ac lacus. Vestibulum semper nisi a lacus dictum
          pulvinar.
        • cq9
          John, thanks VERY much for your helpful response. It sounds very promising, but my head is spinning from trying to understand the clip syntax and even the
          Message 4 of 25 , Dec 27, 2011
          • 0 Attachment
            John, thanks VERY much for your helpful response. It sounds very promising, but my head is spinning from trying to understand the clip syntax and even the vocabulary. For example, I'm not really sure what a wizard is. I thought that it was the dropdown box that would present me with the names of my bookmarks, but then what does it mean to say I need TWO wizards? I did check the Help file before asking this question, but I didn't find a clear explanation of what a wizard is, how one starts to use one, etc.

            Am I right in understanding that for each file in which I want to create bookmarks, I'd have to have a separate wizard? How are the wizards summoned? Do they all have to sit at the bottom of the NTP interface with the Libraries?

            I realize that these are absurdly newbie-ish questions, but that's because I'm an absurd newbie. :-) I'm grateful to you for taking the time to help me, and I hope you won't give up on me quite yet.

            CQ

            --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
            > You can set a wizard up to create an infinite number of 'bookmarks' by inserting the text you type into the wizard into
            > the file at the location of the cursor. Once you pass through the file, marking them all, you would save the file, and
            > then you'd have permanent 'bookmarks'. If there are words within the file that you could search for, you could add the
            > bookmarks using a clip instead of a wizard. We don't know if the bookmarks would be the same for each document, or if
            > they would have completely different names.
            > . . . .
            > A second wizard would be used to find the bookmarks.
          • flo.gehrke
            ... Don, It s no matter of ^!Append but of the brackets you are using. That is, also... ^!Set %testvar%= one|_two|three ^?{(T=C)Choose a value==^%testvar%}
            Message 5 of 25 , Dec 27, 2011
            • 0 Attachment
              --- In ntb-clips@yahoogroups.com, Don <don@...> wrote:
              >
              > On 12/27/2011 10:16 AM, Don wrote:
              > Think I got it from a great old thread!
              >
              > ^!Set %choices%="five|_six|seven"
              > ^!Set %testvar2%=""
              > ^!Append %testvar2%="^?{(T=C)Choose a value==^%choices%}"
              > ^%testvar2%

              Don,

              It's no matter of ^!Append but of the brackets you are using. That is, also...

              ^!Set %testvar%="one|_two|three"
              ^?{(T=C)Choose a value==^%testvar%}

              works fine when using curly braces (as you did in your second example).

              Regards,
              Flo
            • cq9
              Mod note: Apologies for the delay in posting this message. Somehow it slipped by me as I ve been approving them from my phone and hadn t had time to go to the
              Message 6 of 25 , Dec 27, 2011
              • 0 Attachment
                Mod note:
                Apologies for the delay in posting this message. Somehow it slipped by me as I've been approving them from my phone and hadn't had time to go to the website to approve (and consequently see this message!)

                Julie

                ******

                Thanks very much, Don. I suppose I'm willing to insert content as bookmarks. It's easiest to do this with HTML files, since there are all sorts of HTML codes that clearly separate a given header, say, from other text. I probably wouldn't have to add anything to an HTML file to be able to create bookmarks. With regular text files, adding content and delimiters would be more invasive, but probably worth it, especially if there were a way to print the files without physically removing the added content and delimiters (I wouldn't want to have to re-create the bookmarks after printing a file).

                I still have only a vague idea how to write a script that would actually create the bookmarks, but little by little I'm getting more familiar with the clip syntax and terminology. To be honest, I'm somewhat disappointed that I have to go through all this just to get bookmarks, but I guess a day without challenges is like a day without sunshine. :-) At any rate, I very much appreciate the help that I'm getting from you and other knowledgeable forum members.

                CQ

                --- In ntb-clips@yahoogroups.com, Don <don@...> wrote:
                > If you are willing to insert content as book marks you can easily write
                > a "bookmark generator". If you create a clip library that does this
                > ##insert named bookmark here## and then it generates a drop down of all
                > items within double pound (#) signs, then you are golden. You can add a
                > clip to print the document without the book marks easily enough. Would
                > this server your purposes?
              • cq9
                Thanks very much, Don. I sent you a message in response to your earlier message, but apparently it didn t make it to the forum. In my earlier message, I said
                Message 7 of 25 , Dec 27, 2011
                • 0 Attachment
                  Thanks very much, Don. I sent you a message in response to your earlier message, but apparently it didn't make it to the forum. In my earlier message, I said that I'm willing to insert content as bookmarks. I went on to say the following: "It's easiest to do this with HTML files, since there are all sorts of HTML codes that clearly separate a given header, say, from other text. I probably wouldn't have to add anything to an HTML file to be able to create bookmarks. With regular text files, adding content and delimiters would be more invasive, but probably worth it, especially if there were a way to print the files without physically removing the added content and delimiters (I wouldn't want to have to re-create the bookmarks after printing a file)."

                  When I wrote that message, I commented that I had only a vague idea how to write a script that would actually create the bookmarks, but now you've very kindly provided a terrific example. Many thanks!!

                  CQ
                • Don
                  I tried all sorts of combinations earlier ... but I think you may be right. Oddly, look at this clip Flo: ^!Set %testvar1%= one|_two|three ^?{(T=C)Choose a
                  Message 8 of 25 , Dec 27, 2011
                  • 0 Attachment
                    I tried all sorts of combinations earlier ... but I think you may be right.

                    Oddly, look at this clip Flo:
                    ^!Set %testvar1%="one|_two|three"
                    ^?{(T=C)Choose a value==^%testvar1%}

                    ^!Append %testvar2%="one|_four|three"
                    ^?{(T=C)Choose a value==^%testvar2%}

                    ^!Set %testvar3%="^?[(T=C)Choose a value==one|_five|three]"
                    ^%testvar3%

                    ^!Set %testvar4%=""
                    ^!Append %testvar4%="^?[(T=C)Choose a value==one|_six|three]"
                    ^%testvar4%

                    Explain testvar4 -- I'm missing how it becomes five in the end. Somehow
                    the wizards overlap I guess since the words in it are the same.


                    When you are all done with that, then do this:
                    ^!Set %testvar1%="one|_two|three"
                    ^?{(T=C)Choose a First value==^%testvar1%}

                    ^!Append %testvar2%="^?{(T=C)Choose a Second value==one|_four|three}"
                    ^%testvar2%

                    ^!Set %testvar3%="^?[(T=C)Choose a Third value==one|_five|three]"
                    ^%testvar3%

                    ^!Set %testvar4%=""
                    ^!Append %testvar4%="^?[(T=C)Choose a Fourth value==one|_six|three]"
                    ^%testvar4%

                    On 12/27/2011 4:12 PM, flo.gehrke wrote:
                    > ^!Set %testvar%="one|_two|three"
                    > ^?{(T=C)Choose a value==^%testvar%}
                  • Don
                    ... CQ, I did not get your earlier response. This list is awesome. People have problems/questions and other people try to solve those problems. That is just
                    Message 9 of 25 , Dec 27, 2011
                    • 0 Attachment
                      On 12/27/2011 7:58 PM, cq9 wrote:
                      > Thanks very much, Don. I sent you a message in response to your earlier message, but apparently it didn't make it to the forum. In my earlier message, I said that I'm willing to insert content as bookmarks. I went on to say the following: "It's easiest to do this with HTML files, since there are all sorts of HTML codes that clearly separate a given header, say, from other text. I probably wouldn't have to add anything to an HTML file to be able to create bookmarks. With regular text files, adding content and delimiters would be more invasive, but probably worth it, especially if there were a way to print the files without physically removing the added content and delimiters (I wouldn't want to have to re-create the bookmarks after printing a file)."
                      >
                      > When I wrote that message, I commented that I had only a vague idea how to write a script that would actually create the bookmarks, but now you've very kindly provided a terrific example. Many thanks!!
                      >
                      > CQ

                      CQ, I did not get your earlier response.

                      This list is awesome. People have problems/questions and other people
                      try to solve those problems. That is just the way it is :-)

                      People will try examples - great brain teasers, we often learn
                      ourselves, etc. We've all been helped along the way and we are just
                      helping give back where we withdrew from in the past and as a result
                      this is a great community of users.

                      Hopefully what I did works on your end and makes sense.

                      We could easily adapt this for an html document of course if that was
                      the desire, even inserting anchor links that work in the html document.
                      If you use a lot of pound signs in your document (#) then you can use a
                      different symbol for the indicator, however be careful what character
                      you pick as some will have to be treated with an "escape" character (\)
                      in a regular expression search.

                      As long as I have been at this clip writing game I learn all the time
                      from others here. I'll do something in twenty steps and someone else
                      will do it with a simple search and replace clip half of the time. I
                      found or re-found two commands just today while working on this, and I
                      write clips daily. If you plan to write more than one clip, do yourself
                      a favor and get something written by Sheri called ClipCodeSyntax. It is
                      a clip that runs in the toolbar of the pro version (not sure how you run
                      it in light?) and it essentially does the heavy lifting of clip writing
                      for you as you simply type a bit of the command you want and it inserts
                      the command with proper syntax. Pretty slick.

                      Anyway, ask away and we'll solve any lingering issues.
                    • cq9
                      Don, thanks very much for another helpful response. I m not surprised that you didn t get my first reply; I sent it to the forum but it never appeared. I m
                      Message 10 of 25 , Dec 28, 2011
                      • 0 Attachment
                        Don, thanks very much for another helpful response. I'm not surprised that you didn't get my first reply; I sent it to the forum but it never appeared. I'm not sure why. Fortunately, I use a Firefox extension called Lazarus that records what I type into Firefox, so I was able to recover the text (and confirm that I'm not crazy--I really did write it :-) ).

                        As for the HTML document, I assume that I could use <h1>SECTION (with "SECTION" being the name of the particular section) for identifying the places where I want to place bookmarks and the names I want to give the bookmarks. If it turns out that the pointed brackets are used in a different way by the clip language, I guess I could use the anchors, which are already in the document. You may wonder why I want bookmarks if I already have anchors. The reason is that I very frequently edit this document, and I'm accustomed to editing it in a plain text editor.

                        Thanks for mentioning ClipCodeSyntax. I had already included it in the Library tabs at the bottom of the NoteTab Pro interface, though I haven't used it. NoteTab Pro came with a bunch of Library tabs at the bottom. I've now gotten rid of some (e.g., Euro, which I thought might be useful until I saw that in order to get it to calculate between dollars and Euros, I first had to tell it the current conversion rate, which for me defeats the purpose of having it). Most of the Libraries that I've kept visible on the Interface are there so I can look more closely at their syntax, when I have more time. Frankly, I don't see myself writing a lot of clips, but that may change as I become more familiar with NoteTab Pro and with Clips.

                        I've been very impressed by this forum and the willingness of you and others to provide help. Again, thanks very much!

                        CQ
                      • cq9
                        ... Don, thanks very much for another helpful response. I m not surprised that you didn t get my first reply; I sent it to the forum but it never appeared.
                        Message 11 of 25 , Dec 28, 2011
                        • 0 Attachment
                          --- In ntb-clips@yahoogroups.com, Don <don@...> wrote:
                          >
                          > CQ, I did not get your earlier response.

                          Don, thanks very much for another helpful response. I'm not surprised that you didn't get my first reply; I sent it to the forum but it never appeared. I'm not sure why. Fortunately, I use a Firefox extension called Lazarus that records what I type into Firefox, so I was able to recover the text (and confirm that I'm not crazy--I really did write it :-) ).

                          As for the HTML document, I assume that I could use <h1>SECTION (with "SECTION" being the name of the particular section) for identifying the places where I want to place bookmarks and the names I want to give the bookmarks. If it turns out that the pointed brackets are used in a different way by the clip language, I guess I could use the anchors, which are already in the document. You may wonder why I want bookmarks if I already have anchors. The reason is that I very frequently edit this document, and I'm accustomed to editing it in a plain text editor.

                          Thanks for mentioning ClipCodeSyntax. I had already included it in the Library tabs at the bottom of the NoteTab Pro interface, though I haven't used it. NoteTab Pro came with a bunch of Library tabs at the bottom. I've now gotten rid of some (e.g., Euro, which I thought might be useful until I saw that in order to get it to calculate between dollars and Euros, I first had to tell it the current conversion rate, which for me defeats the purpose of having it). Most of the Libraries that I've kept visible on the Interface are there so I can look more closely at their syntax, when I have more time. Frankly, I don't see myself writing a lot of clips, but that may change as I become more familiar with NoteTab Pro and with Clips.

                          I've been very impressed by this forum and the willingness of you and others to provide help. Again, thanks very much!

                          CQ

                          P.S. This is the second time I'm sending this message as well. When it didn't appear, I went to retrieve it in Lazarus and found that the pointed brackets I used above were being seen as the start of an HTML code (which normally they are), and the rest of the message was in a huge font, since the brackets surrounded an h1 HTML code. I'm now trying again. The current preview shows the code--I'm assuming that when the message appears--assuming it does--the pointed brackets will appear.
                        • flo.gehrke
                          ... Don, I can t explain the behavior of clip #I either -- it seems rather erratic to me. Clip #II starts correctly showing a combined view of wizard #3 and #4
                          Message 12 of 25 , Dec 28, 2011
                          • 0 Attachment
                            --- In ntb-clips@yahoogroups.com, Don <don@...> wrote:
                            >
                            > I tried all sorts of combinations earlier ... but I think you may be right.
                            >
                            > Oddly, look at this clip Flo:
                            > ^!Set %testvar1%="one|_two|three"
                            > ^?{(T=C)Choose a value==^%testvar1%}
                            >
                            > ^!Append %testvar2%="one|_four|three"
                            > ^?{(T=C)Choose a value==^%testvar2%}
                            >
                            > ^!Set %testvar3%="^?[(T=C)Choose a value==one|_five|three]"
                            > ^%testvar3%
                            >
                            > ^!Set %testvar4%=""
                            > ^!Append %testvar4%="^?[(T=C)Choose a value==one|_six|three]"
                            > ^%testvar4%
                            >
                            > Explain testvar4 -- I'm missing how it becomes five in the end. Somehow
                            > the wizards overlap I guess since the words in it are the same.
                            >
                            >
                            > When you are all done with that, then do this:
                            > ^!Set %testvar1%="one|_two|three"
                            > ^?{(T=C)Choose a First value==^%testvar1%}
                            >
                            > ^!Append %testvar2%="^?{(T=C)Choose a Second value==one|_four|three}"
                            > ^%testvar2%
                            >
                            > ^!Set %testvar3%="^?[(T=C)Choose a Third value==one|_five|three]"
                            > ^%testvar3%
                            >
                            > ^!Set %testvar4%=""
                            > ^!Append %testvar4%="^?[(T=C)Choose a Fourth value==one|_six|three]"
                            > ^%testvar4%
                            >
                            > On 12/27/2011 4:12 PM, flo.gehrke wrote:
                            > > ^!Set %testvar%="one|_two|three"
                            > > ^?{(T=C)Choose a value==^%testvar%}
                            >


                            Don,

                            I can't explain the behavior of clip #I either -- it seems rather erratic to me.

                            Clip #II starts correctly showing a combined view of wizard #3 and #4 pre-selecting 'five' resp. 'six'. In clip #I, we see wizard #3 only displaying 'five' -- which is wrong.

                            Strange enough, also Clip #I is showing a correct start if I write "Choose a Third value" in wizard #3 instead of "Choose a value" -- absurd, isn't it?

                            This little change has an effect on the output too. Also clip #I now outputs all four values -- but on one line: 'twofourfivesix'.

                            With "Choose a value", for me, clip #I outputs...

                            two
                            four
                            five
                            five

                            whereas the last value should be 'six'. In debug mode we see that, with wizard #3, 'five' is assigned to %testvar3%. Next, with wizard #4, the clip doesn't assign 'six' to %testvar4% but 'five' again. So 'five' gets output twice. Again I have no idea why this happens.

                            Your original issue was how to use a variable in a wizard. For me, the consequence is not to use '^!Append' in this specific context. A more concise and reliable clip would be...

                            ^!Set %Options%="one|two|three"
                            ^!Set %testvar1%=^?{Choose value #1:==^%Options%}; %testvar2%=^?{Choose value #2:==^%Options%}; %testvar3%=^?{Choose value #3:==^%Options%}
                            ^%testvar1%
                            ^%testvar2%
                            ^%testvar3

                            If we've got multiple choices and want to pre-select particular options it doesn't make sense to assign those options to a variable. We better write something like...

                            ^!Set %testvar1%=^?[Choose value #1:==_one|two|three]; %testvar2%=^?[Choose value #2:==one|_two|three]; %testvar3%=^?[Choose value #3:==one|two|_three]
                            ^%testvar1%
                            ^%testvar2%
                            ^%testvar3%


                            Regards,
                            Flo
                          • Don
                            ... I have it on the clip bar at the top of my screen. view / clipbar / clipcode syntax or something like that, so I type set and then hit the clipcode
                            Message 13 of 25 , Dec 28, 2011
                            • 0 Attachment
                              On 12/28/2011 9:50 AM, cq9 wrote:
                              > Thanks for mentioning ClipCodeSyntax.

                              I have it on the clip bar at the top of my screen. view / clipbar /
                              clipcode syntax or something like that, so I type "set" and then hit the
                              clipcode button and it pulls up the dialog to create a set command ...
                              very helpful.

                              New users are moderated, so you may be seeing a delay over the holidays
                              from that perhaps.
                            • Don
                              ... Hi Flo, Glad it wasn t just me :-) seeing the strange behavior on this clip. Yes the behavior seems odd indeed, but somehow it sees two wizards executed
                              Message 14 of 25 , Dec 28, 2011
                              • 0 Attachment
                                On 12/28/2011 7:19 PM, flo.gehrke wrote:
                                > If we've got multiple choices and want to pre-select particular options it doesn't make sense to assign those options to a variable. We better write something like...

                                Hi Flo,

                                Glad it wasn't just me :-) seeing the "strange" behavior on this clip.

                                Yes the behavior seems odd indeed, but somehow it sees two wizards
                                executed "at the same time" as the same.

                                I assume you see how I used the "on the fly" method of creating drop
                                downs for CQ in the other thread as that was why I needed this. I can
                                just pick the first variable to highlight as I didn't want a blank
                                dialog box was all.

                                Other than learning a quirky behavior or two this was a fun little
                                riddle to crack.

                                Don
                              • flo.gehrke
                                ... Don, I see a similar inconsistency in this... ^!Set %testvar%= ^!Append %testvar%= ^?{(T=L)Choose a value==one|_two|three} ^!Info testvar: ^%testvar%
                                Message 15 of 25 , Dec 29, 2011
                                • 0 Attachment
                                  --- In ntb-clips@yahoogroups.com, Don <don@...> wrote:
                                  >
                                  > Hi Flo,
                                  >
                                  > Glad it wasn't just me :-) seeing the "strange" behavior on
                                  > this clip.
                                  >
                                  > Yes the behavior seems odd indeed, but somehow it sees two wizards
                                  > executed "at the same time" as the same.
                                  >

                                  Don,

                                  I see a similar inconsistency in this...

                                  ^!Set %testvar%=""
                                  ^!Append %testvar%="^?{(T=L)Choose a value==one|_two|three}"
                                  ^!Info testvar: ^%testvar%
                                  ^!Info The year is: ^$GetDate(yyyy)$
                                  ; Append year to %testvar%
                                  ^!Append %testvar%=^%Space%^$GetDate(yyyy)$
                                  ^!Info testvar (new): ^%testvar%

                                  Why on earth is the wizard popping up a second time (with line #6)?

                                  In this context, the Help on Clip Programming is confusing me:

                                  ^!Append %Variable%=Value
                                  Appends value to the content of %Variable%. This command also has the advantage of allowing assignments of function names and ^?{} prompts without causing these to be evaluated. This command is particularly useful for creating sophisticated Clip Wizards.

                                  Well, what we've got here is a '^?{}' prompt. Isn't it 'evaluated' with line #2?

                                  Also, we've got a date function in line #6. Isn't it 'evaluated' with '^!Append'?

                                  That's why I suspect that there is an inconsistency in the way '^!Append' is working here.

                                  Regards,
                                  Flo
                                • cq9
                                  ... Ah, that explains it! I thought only a new user s first message was moderated. And I think you may be right about the holidays slowing things down.
                                  Message 16 of 25 , Dec 29, 2011
                                  • 0 Attachment
                                    --- In ntb-clips@yahoogroups.com, Don <don@...> wrote:
                                    > New users are moderated, so you may be seeing a delay over the holidays
                                    > from that perhaps.

                                    Ah, that explains it! I thought only a new user's first message was moderated. And I think you may be right about the holidays slowing things down. Anyway, not realizing this, I assumed that including "<h1>" had screwed things up and made the message unacceptable, so I then wrote out the rather ugly HTML coding and wound up posting the message twice. Oh well, now I know.

                                    Thanks too for the tip about how you use ClipCodeSyntax.

                                    CQ
                                  • Pete Turner
                                    Just to revisit this (sorry, I ve been away from a computer for three weeks - it was wonderful!!) Don s original example:- ^!Set %testvar%= one|_two|three
                                    Message 17 of 25 , Jan 8, 2012
                                    • 0 Attachment
                                      Just to revisit this (sorry, I've been away from a computer for three weeks - it was wonderful!!)

                                      Don's original example:-

                                      ^!Set %testvar%="one|_two|three"
                                      ^?[(T=C)Choose a value==^%testvar%]
                                      doesn't work in this situation because of the way the wizard is defined: as Flo pointed out, but without explaining why, you need to use {} rather than [] for the wizard delimiters.

                                      Just to clarify why, where {} is used, the wizard will be displayed at the point in the clip execution where it is defined: in this example, the variable will be set first, and then the wizard will appear with the dropdown options correctly populated.

                                      Where [] is used, the NoteTab actually reads the entire clip looking for [] wizard definitions before executing it, and displays the wizard first, then executes the clip ignoring any [] wizard definitions. This means that the variable has not yet been set when the wizard appears (AFAIK NoteTab doesn't even bother trying to parse the variable).

                                      One other point to be aware of is that if the clip contains multiple [] wizard definitions, they will all be lumped together and displayed in a single wizard at the start of the clip, even if they're scattered throughout the clip.

                                      Pete


                                      [Non-text portions of this message have been removed]
                                    • Axel Berger
                                      ... Exactly. I have just used this in a wizard: ^!Set %vBox%=^?[(T=L,H=7)Welche Box?=_mbox^= mbox{^&}|makebox^= makebox[^%vWid%][^%vPos%]{^&}];
                                      Message 18 of 25 , Jan 8, 2012
                                      • 0 Attachment
                                        Pete Turner wrote:
                                        > (AFAIK NoteTab doesn't even bother trying to parse the variable).

                                        Exactly. I have just used this in a wizard:

                                        ^!Set %vBox%=^?[(T=L,H=7)Welche
                                        Box?=_mbox^=\mbox{^&}|makebox^=\makebox[^%vWid%][^%vPos%]{^&}];
                                        %vWid%=^?[Breite (mit Einheit oder \width)=]; %vPos%=^?[Position lrs(c)
                                        oder bt(m)=]
                                        ^!InsertSelect ^%vBox%
                                        ^!InsertText ^$StrReplace("[]";"";"^$GetSelection$";False;False)$
                                        ^!Jump SELECT_END
                                        ^!MoveCursor -1

                                        The Set line is long and the first choice contains many more options in
                                        the original.

                                        Axel

                                        --
                                        Dipl.-Ing. F. Axel Berger Tel: +49/ 2174/ 7439 07
                                        Johann-H├Ąck-Str. 14 Fax: +49/ 2174/ 7439 68
                                        D-51519 Odenthal-Heide eMail: Axel-Berger@...
                                        Deutschland (Germany) http://berger-odenthal.de
                                      Your message has been successfully submitted and would be delivered to recipients shortly.