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

Help with checkbox wizard

Expand Messages
  • John Shotsky
    Hi again, folks! In my application, I have been using a wizard in which the user types Y or N for various options. Of course, it is case sensitive, and I
    Message 1 of 7 , Dec 7, 2009
    • 0 Attachment
      Hi again, folks!



      In my application, I have been using a wizard in which the user types Y or N for various options. Of course, it is case
      sensitive, and I realize a checkbox type wizard would be a better way to collect user options. I don't know how to set
      it up to collect the checkbox values into variables and then use them for making processing decisions. I have looked at
      some samples, but haven't found enough to get me started.



      So, I have a clip called 'Set User Options'.

      I have an .ini file named useroptions.ini, where I want to store the user's choices. I want the options to stay set once
      the user sets them once, even if they receive a new clip library from me, thus an .ini file.

      I have two user options (many more really, but this will get me started.) Option1, Option2.

      If the ini file isn't present, it is created. (I have the code for this.)

      If the options are not already present in variables from reading the .ini file, the variables are created, and the
      state of the missing variable is set to false and the variables are saved. So, when the user clicks on the Set User
      Options clip, all variables should be presented as found in the .ini file. (Which were added to the .ini file if they
      were missing when the user clicks the clip.) In essence, if the .ini file is not found, it is created, both options are
      created and set to false, then saved, so the .ini file will always have all the variables upon starting the clip. This
      is done because I periodically add new user options, and a user's existing .ini file won't yet have the new ones, so
      they are created and set as false if missing.



      If the option is already set either true or false in variables from the .ini file, it is assumed they are user set.

      When the checkbox wizard is presented, the user sees a checkmark for true, and no checkmark for false. User can change
      any of them, then dismiss the wizard, and the values will again be saved, including any changes. This is a hard to
      understand part for me - how to prepopulate the checkbox wizard with the existing values.



      Elsewhere in my clip library, processing is controlled via the user options.

      I previously used Y or N in my If statement.

      Existing:

      ^!If ^%Option1% = "N" Option1Done

      [Any processing needed if option is true]

      :Option1Done



      Now I need to change it to 'true' or 'false'. Is the following If statement correctly formed?

      New:

      ^!IfFalse ^%Option1% GoToOption1Done

      [Any processing needed if option is true]

      :Option1Done



      Thanks in advance,

      John













      [Non-text portions of this message have been removed]
    • Axel Berger
      ... I don t agree that forcing the user to use the mouse is better. ... No of course about it: ^!If ^$StrUpper( ^%Option1% )$ = N Option1Done Another point
      Message 2 of 7 , Dec 7, 2009
      • 0 Attachment
        John Shotsky wrote:
        > I realize a checkbox type wizard would be a better way

        I don't agree that forcing the user to use the mouse is better.

        > Of course, it is case sensitive

        No of course about it:

        ^!If ^$StrUpper("^%Option1%")$ = "N" Option1Done

        Another point is, you seem only to check for No and assume Yes if not
        equal. When the answerv is neither yes nor no you should loop back and
        ask again, it's easy to just miss a key.

        Axel
      • John Shotsky
        Well, I still want to convert to a checkbox format, because users can type anything in the existing wizard. I don t want to have to error check their input or
        Message 3 of 7 , Dec 7, 2009
        • 0 Attachment
          Well, I still want to convert to a checkbox format, because users can type anything in the existing wizard. I don't want
          to have to error check their input or explain what to type there.



          As to the checking for No only, you're right, the clips always assume that the processing should be performed if the
          user has not explicitly prevented it. The default of my whole system is to 'do everything', and let the users choose
          what to skip.



          Regards,

          John



          From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Axel Berger
          Sent: Monday, December 07, 2009 8:52 AM
          To: ntb-clips@yahoogroups.com
          Subject: Re: [Clip] Help with checkbox wizard





          John Shotsky wrote:
          > I realize a checkbox type wizard would be a better way

          I don't agree that forcing the user to use the mouse is better.

          > Of course, it is case sensitive

          No of course about it:

          ^!If ^$StrUpper("^%Option1%")$ = "N" Option1Done

          Another point is, you seem only to check for No and assume Yes if not
          equal. When the answerv is neither yes nor no you should loop back and
          ask again, it's easy to just miss a key.

          Axel





          [Non-text portions of this message have been removed]
        • john041650
          Have you considered using a listbox instead? With that you can force them to make one choice from the choices you offer them. No typing, unless they want to
          Message 4 of 7 , Dec 7, 2009
          • 0 Attachment
            Have you considered using a listbox instead? With that you can force them to make one choice from the choices you offer them. No typing, unless they want to use the tab and arrow keys, and no guessing on your part as to what they mean.

            john too


            --- In ntb-clips@yahoogroups.com, "John Shotsky" <jshotsky@...> wrote:
            >
            > Well, I still want to convert to a checkbox format, because users can type anything in the existing wizard. I don't want
            > to have to error check their input or explain what to type there.
            >
            >
            >
            > As to the checking for No only, you're right, the clips always assume that the processing should be performed if the
            > user has not explicitly prevented it. The default of my whole system is to 'do everything', and let the users choose
            > what to skip.
            >
            >
            >
            > Regards,
            >
            > John
            >
            >
            >
            > From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Axel Berger
            > Sent: Monday, December 07, 2009 8:52 AM
            > To: ntb-clips@yahoogroups.com
            > Subject: Re: [Clip] Help with checkbox wizard
            >
            >
            >
            >
            >
            > John Shotsky wrote:
            > > I realize a checkbox type wizard would be a better way
            >
            > I don't agree that forcing the user to use the mouse is better.
            >
            > > Of course, it is case sensitive
            >
            > No of course about it:
            >
            > ^!If ^$StrUpper("^%Option1%")$ = "N" Option1Done
            >
            > Another point is, you seem only to check for No and assume Yes if not
            > equal. When the answerv is neither yes nor no you should loop back and
            > ask again, it's easy to just miss a key.
            >
            > Axel
            >
            >
            >
            >
            >
            > [Non-text portions of this message have been removed]
            >
          • Art Kocsis
            John, I did something very similar in an app that I wrote a few months ago. In my app I have a number of actions, all of which are optional, which are selected
            Message 5 of 7 , Dec 7, 2009
            • 0 Attachment
              John,

              I did something very similar in an app that I wrote a few months ago. In my
              app I have a number of actions, all of which are optional, which are
              selected in a drop down check box list. (This may be called a list box -
              there are so many names in so many systems that I can't keep track.) Each
              selection is associated with a single variable and, if true, the action is
              taken. I've extracted the pertinent parts below:

              In my app, I create a valuelist during setup with all options set to
              "Checked" but this variable could be saved into your ini file. (The
              underscore sets the default to checked.) check

              ^!SetIniFile ArkClips
              ^!Set %ActnList%=_Download|_Extract|_Viewer|_DBase|_Leech|_Rename|_Display
              ;^!Set %ActnList%=^$GetValue("ActnList")$
              ^!Set %actn%=^?{(T=A)Actions:=^%ActnList%}
              ;^!SaveValue ActnList=^%ActnList%

              ^!Set %dnld%=^$StrCount("Downlo";"^%actn%";False;False)$
              ^!Set %xtrx%=^$StrCount("Extract";"^%actn%";False;False)$
              ^!Set %view%=^$StrCount("Viewer";"^%actn%";False;False)$
              ^!Set %dbas%=^$StrCount("DBase";"^%actn%";False;False)$
              ^!Set %lech%=^$StrCount("Leech";"^%actn%";False;False)$
              ^!Set %rnam%=^$StrCount("Rename";"^%actn%";False;False)$
              ^!Set %disp%=^$StrCount("Display";"^%actn%";False;False)$

              ^!IFTrue ^%dnld% ^!Clip "CmxC DnLod"
              ^!IFTrue ^%xtrx% ^!Clip "CmxC Xtrct"
              ^!IFTrue ^%dbas% ^!Clip "CmxC DBase"
              ^!IFTrue ^%lech% ^!Clip "CmxC Leech"
              ^!IFTrue ^%rnam% ^!Clip "CmxC Renam"
              ^!IFTrue ^%view% ^!Clip "CmxC Viewr"
              ^!IFTrue ^%disp% ^!Clip "CmxC Dsply"

              This technique makes it easy to add options.

              This almost works but the result of the wizard does not seem to be stored
              back into ^%ActnList%.
              Sure would be helpful if it did. Anybody else know where it is stored?
              In lieu of that function you would have to reprocess the ^%ActnList% string
              to reset the underscores per the user's choice. Or store the individual
              variables and create the ^%ActnList% string just before the wizard line
              from the stored values.

              BTW, I thought you could make the height of the wizard larger so that they
              could all be visible but I can't find the reference.

              HTH

              Namaste', Art


              At 12-07-09 09:07, John wrote:
              >Well, I still want to convert to a checkbox format, because users can type
              >anything in the existing wizard. I don't want to have to error check their
              >input or explain what to type there.
              >
              >As to the checking for No only, you're right, the clips always assume that
              >the processing should be performed if the user has not explicitly prevented it.
              >The default of my whole system is to 'do everything', and let the users
              >choose what to skip.
              >
              >From: <mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com
              >[mailto:ntb-clips@yahoogroups.com] On Behalf Of Axel Berger
              >Sent: Monday, December 07, 2009 8:52 AM
              >To: <mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com
              >Subject: Re: [Clip] Help with checkbox wizard
              >
              >John Shotsky wrote:
              > > I realize a checkbox type wizard would be a better way
              >I don't agree that forcing the user to use the mouse is better.
              >
              > > Of course, it is case sensitive
              >No of course about it:
              >
              >^!If ^$StrUpper("^%Option1%")$ = "N" Option1Done
              >
              >Another point is, you seem only to check for No and assume Yes if not
              >equal. When the answerv is neither yes nor no you should loop back and
              >ask again, it's easy to just miss a key.
              >
              >Axel

              ----------


              No virus found in this outgoing message.
              Checked by AVG - www.avg.com
              Version: 9.0.710 / Virus Database: 270.14.98/2551 - Release Date: 12/07/09 11:34:00


              [Non-text portions of this message have been removed]
            • John Shotsky
              Art, This is indeed fairly close to what I want to do. There is a group of options, any of which may be true or false. And you have hit on the two
              Message 6 of 7 , Dec 8, 2009
              • 0 Attachment
                Art,



                This is indeed fairly close to what I want to do. There is a group of options, any of which may be true or false. And
                you have hit on the two implementation problems. One is how to indicate the user's existing preferences, the other is
                how to extract any changed values and save them to an .ini file.



                I thought there was a 'wizard wizard' in the clip libraries, but I searched everywhere I know about, and couldn't find
                it. The help is really unclear about how to preset and extract data in checkboxes.



                Regards,

                John



                From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Art Kocsis
                Sent: Monday, December 07, 2009 10:16 PM
                To: NoteTab-Clips
                Subject: RE: [Clip] Help with checkbox wizard





                John,

                I did something very similar in an app that I wrote a few months ago. In my
                app I have a number of actions, all of which are optional, which are
                selected in a drop down check box list. (This may be called a list box -
                there are so many names in so many systems that I can't keep track.) Each
                selection is associated with a single variable and, if true, the action is
                taken. I've extracted the pertinent parts below:

                In my app, I create a valuelist during setup with all options set to
                "Checked" but this variable could be saved into your ini file. (The
                underscore sets the default to checked.) check

                ^!SetIniFile ArkClips
                ^!Set %ActnList%=_Download|_Extract|_Viewer|_DBase|_Leech|_Rename|_Display
                ;^!Set %ActnList%=^$GetValue("ActnList")$
                ^!Set %actn%=^?{(T=A)Actions:=^%ActnList%}
                ;^!SaveValue ActnList=^%ActnList%

                ^!Set %dnld%=^$StrCount("Downlo";"^%actn%";False;False)$
                ^!Set %xtrx%=^$StrCount("Extract";"^%actn%";False;False)$
                ^!Set %view%=^$StrCount("Viewer";"^%actn%";False;False)$
                ^!Set %dbas%=^$StrCount("DBase";"^%actn%";False;False)$
                ^!Set %lech%=^$StrCount("Leech";"^%actn%";False;False)$
                ^!Set %rnam%=^$StrCount("Rename";"^%actn%";False;False)$
                ^!Set %disp%=^$StrCount("Display";"^%actn%";False;False)$

                ^!IFTrue ^%dnld% ^!Clip "CmxC DnLod"
                ^!IFTrue ^%xtrx% ^!Clip "CmxC Xtrct"
                ^!IFTrue ^%dbas% ^!Clip "CmxC DBase"
                ^!IFTrue ^%lech% ^!Clip "CmxC Leech"
                ^!IFTrue ^%rnam% ^!Clip "CmxC Renam"
                ^!IFTrue ^%view% ^!Clip "CmxC Viewr"
                ^!IFTrue ^%disp% ^!Clip "CmxC Dsply"

                This technique makes it easy to add options.

                This almost works but the result of the wizard does not seem to be stored
                back into ^%ActnList%.
                Sure would be helpful if it did. Anybody else know where it is stored?
                In lieu of that function you would have to reprocess the ^%ActnList% string
                to reset the underscores per the user's choice. Or store the individual
                variables and create the ^%ActnList% string just before the wizard line
                from the stored values.

                BTW, I thought you could make the height of the wizard larger so that they
                could all be visible but I can't find the reference.

                HTH

                Namaste', Art

                At 12-07-09 09:07, John wrote:
                >Well, I still want to convert to a checkbox format, because users can type
                >anything in the existing wizard. I don't want to have to error check their
                >input or explain what to type there.
                >
                >As to the checking for No only, you're right, the clips always assume that
                >the processing should be performed if the user has not explicitly prevented it.
                >The default of my whole system is to 'do everything', and let the users
                >choose what to skip.
                >
                >From: <mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com>
                >[mailto:ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com> ] On Behalf Of Axel Berger
                >Sent: Monday, December 07, 2009 8:52 AM
                >To: <mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com <mailto:ntb-clips%40yahoogroups.com>
                >Subject: Re: [Clip] Help with checkbox wizard
                >
                >John Shotsky wrote:
                > > I realize a checkbox type wizard would be a better way
                >I don't agree that forcing the user to use the mouse is better.
                >
                > > Of course, it is case sensitive
                >No of course about it:
                >
                >^!If ^$StrUpper("^%Option1%")$ = "N" Option1Done
                >
                >Another point is, you seem only to check for No and assume Yes if not
                >equal. When the answerv is neither yes nor no you should loop back and
                >ask again, it's easy to just miss a key.
                >
                >Axel

                ----------

                No virus found in this outgoing message.
                Checked by AVG - www.avg.com
                Version: 9.0.710 / Virus Database: 270.14.98/2551 - Release Date: 12/07/09 11:34:00

                [Non-text portions of this message have been removed]





                [Non-text portions of this message have been removed]
              • John Shotsky
                I have created a clip set to accomplish my goals. Thanks, Art, for your ideas - they helped. In case anyone else has this need, I m including my clips below.
                Message 7 of 7 , Dec 8, 2009
                • 0 Attachment
                  I have created a clip set to accomplish my goals. Thanks, Art, for your ideas - they helped.



                  In case anyone else has this need, I'm including my clips below. It should be pretty clear how to add new options.



                  If anyone sees any errors or missing best practices in how I have constructed the clips, please let me know.



                  Setup:

                  Custom .ini file is created in a specified folder if not already present. (Folder is known to already exist.)

                  Existing User options are read from .ini file, and new ones are added if missing

                  'True' options are prefixed with an underscore for the wizard

                  User is presented a checkbox list of options, with the True options checked

                  User input is captured and saved to .ini file.



                  It seems to work ok, although I may have made more steps than are necessary.

                  Regards,

                  John



                  ;====================

                  ;Create the ini file, if missing

                  ^!SetIniFile ^$GetAppPath$RecipeClips\OptionTest

                  ^!IfFileExist ^$GetAppPath$RecipeClips\OptionTest.ini IniFileComplete

                  ^!ProgIniSave ^$GetAppPath$RecipeClips\OptionTest.ini

                  :IniFileComplete



                  ;Get the values of the variables from the .ini file

                  ^!Set %Option1%=^$GetValue(UserOptions:Option1)$

                  ^!Set %Option2%=^$GetValue(UserOptions:Option2)$

                  ^!Set %Option3%=^$GetValue(UserOptions:Option3)$



                  ;Set up default option states

                  ^!Set %Option1State%=Option1

                  ^!Set %Option2State%=Option2

                  ^!Set %Option3State%=Option3



                  ;If the option is already set to 'True', add the underscore to OptionState

                  ^!IfTrue ^%Option1% ^!Set %Option1State%=_Option1

                  ^!IfTrue ^%Option2% ^!Set %Option2State%=_Option2

                  ^!IfTrue ^%Option3% ^!Set %Option3State%=_Option3



                  ;Save the options values to the .ini file in case they are new (May not be needed.)

                  ^!SaveValue UserOptions:Option1=^%Option1%

                  ^!SaveValue UserOptions:Option2=^%Option2%

                  ^!SaveValue UserOptions:Option3=^%Option3%



                  ;Run the wizard

                  ^!Set %Options%=^?{(T=A)Options:=^%Option1State%|^%Option2State%|^%Option3State%}



                  ;Set the checked options True

                  ^!Set %Option1%=^$StrCount("Option1";"^%Options%";False;False)$

                  ^!Set %Option2%=^$StrCount("Option2";"^%Options%";False;False)$

                  ^!Set %Option3%=^$StrCount("Option3";"^%Options%";False;False)$



                  ;Save the values to the .ini file

                  ^!SaveValue UserOptions:Option1=^%Option1%

                  ^!SaveValue UserOptions:Option2=^%Option2%

                  ^!SaveValue UserOptions:Option3=^%Option3%



                  ;Display the values as read from the .ini file

                  ^!InsertText ^PAll variables after saving and rereading from .ini file

                  ^!InsertText ^POption1=^$GetValue(UserOptions:Option1)$

                  ^!InsertText ^POption2=^$GetValue(UserOptions:Option2)$

                  ^!InsertText ^POption3=^$GetValue(UserOptions:Option3)$

                  ;==========



                  [Non-text portions of this message have been removed]
                Your message has been successfully submitted and would be delivered to recipients shortly.