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

RE: [Clip] Saving defaults in a valuelist

Expand Messages
  • Martyn Folkes
    Hi Dick, This might do what you need (beware the long line!): ^!SetListDelimiter | ^!SetArray %temp%=1|3|5 ^!Set %count%=0; %list%=1|2|3|4|5 ... ^!Inc %count%
    Message 1 of 5 , Mar 5, 2002
      Hi Dick,

      This might do what you need (beware the long line!):

      ^!SetListDelimiter |
      ^!SetArray %temp%=1|3|5
      ^!Set %count%=0; %list%=1|2|3|4|5
      :Loop
      ^!Inc %count%
      ^!Set
      %list%=^$StrReplace("^%temp^%count%%";"_^%temp^%count%%";"^%list%";N;N)$
      ^!IfDiff ^%count% ^%temp0% Loop
      ^!Set %checkboxes%=^?{(T=A;H=10)Choose==^%list%}

      Martyn


      > -----Original Message-----
      > From: Dick Gascoigne [mailto:dick.gascoigne@...]
      > Sent: 05 March 2002 14:47
      > To: ntb-clips@yahoogroups.com
      > Subject: [Clip] Saving defaults in a valuelist
      >
      >
      > I have a curly wizard with checkboxes. Of course the checkboxes
      > are formed
      > from a ListValues parameter, which is actually an Array Variable.
      > Then I put
      > the items which were checked in another Array variable and save it an .ini
      > file. So far, no problem.
      >
      > The next time the clip is run, I want to use those previously checked and
      > saved values as defaults in the ListValues variable for the wizard. That
      > way, the boxes will be "pre-checked" just as they had been
      > checked the last
      > time. Note: the original ListValues has be the same items each
      > time, just
      > with some set as defaults.
      >
      > But I don't see an easy way to take my standard ListValues array variable,
      > and put an underscore in front of the items which appear in the
      > saved array
      > variable.
      >
      > Example:
      > The standard ListValues array variable contains 1|2|3|4|5 -- so
      > the wizard
      > will show 5 checkboxes.
      > If the user checks 1, 3 and 5, then the Set variable will contain 1|3|5.
      > That gets put into another SetArray variable, and saved in the .ini.
      >
      > The next time the clip is run, I want to pick up the 1|3|5 from the .ini,
      > and change the ListValues array variable to _1|2|_3|4|_5. Then the wizard
      > would check those three boxes. But what's the best way to get those
      > underscores inserted in the list?
      >
      > Has anyone already done something like that?
      >
      > Dick Gascoigne
      >
      >
      >
      >
      >
      >
      >
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      >
      >
    • Jody
      Hi Dick, I do not know if it will work the way you have your Clip now, but look in the SampleCode Library and the Remember default value . Perhaps you can
      Message 2 of 5 , Mar 5, 2002
        Hi Dick,

        I do not know if it will work the way you have your Clip now, but
        look in the "SampleCode" Library and the "Remember default
        value". Perhaps you can get something figured out from it.

        Another method would be to make an array for the checked values
        and then use ^!SaveValue to the place you would call it from when
        starting up the Clip each time.

        >I have a curly wizard with checkboxes. Of course the checkboxes
        >are formed from a ListValues parameter, which is actually an
        >Array Variable. Then I put the items which were checked in
        >another Array variable and save it an .ini file. So far, no
        >problem.
        >
        >The next time the clip is run, I want to use those previously
        >checked and saved values as defaults in the ListValues variable
        >for the wizard. That way, the boxes will be "pre-checked" just
        >as they had been checked the last time. Note: the original
        >ListValues has be the same items each time, just with some set as
        >defaults.


        Happy Clip'n!
        Jody

        http://www.notetab.net

        Subscribe, UnSubscribe, Options
        mailto:Ntb-Clips-Subscribe@yahoogroups.com
        mailto:Ntb-Clips-UnSubscribe@yahoogroups.com
        http://groups.yahoo.com/group/ntb-clips
      • ...Tyrell...
        Hi DickWell, I did do something with storing and re-using list selection settings, but ... uhmm, I can t find the right clip file :-(The basic idea I used,
        Message 3 of 5 , Mar 5, 2002
          Hi Dick

          Well, I did do something with storing and re-using list selection
          settings, but ... uhmm, I can't find the right clip file :-(

          The basic idea I used, was to store the selection list settings
          inside a array variable, in a binary form, like [0|1|0|1]

          The biggest problem is how to obtain/created that selection
          array. Restoring or applying those stored selection setting,
          One's you have them, is not that difficult.

          Here is one way to obtain and creating that selection array. make
          a copy of the current list array and append to all the array
          entry's the string [^=xx], where xx is the number of the current
          array entry. Now the wizzard will give back the numbers of the
          array entry's that where selected by the user [11|22|33], this
          makes it relative easy to create your selection array.

          To apply the selection list to the listvalue array, do the same
          as for the [^=xx], but now add a [_] in front of the array(copy)
          entry. ( it is possible to do both [_] + [^=xx] at the same time)

          note: if there is a chance that your list values might start with
          a [_] you might want to add a extra leading space in front of the
          values.

          Cheers
          ...Tyrell...

          >I have a curly wizard with checkboxes. Of course the checkboxes are formed
          >from a ListValues parameter, which is actually an Array Variable. Then I put
          >the items which were checked in another Array variable and save it an .ini
          >file. So far, no problem.
          >
          >The next time the clip is run, I want to use those previously checked and
          >saved values as defaults in the ListValues variable for the wizard. That
          >way, the boxes will be "pre-checked" just as they had been checked the last
          >time. Note: the original ListValues has be the same items each time, just
          >with some set as defaults.
          >
          >But I don't see an easy way to take my standard ListValues array variable,
          >and put an underscore in front of the items which appear in the saved array
          >variable.
          >
          >Example:
          >The standard ListValues array variable contains 1|2|3|4|5 -- so the wizard
          >will show 5 checkboxes.
          >If the user checks 1, 3 and 5, then the Set variable will contain 1|3|5.
          >That gets put into another SetArray variable, and saved in the .ini.
          >
          >The next time the clip is run, I want to pick up the 1|3|5 from the .ini,
          >and change the ListValues array variable to _1|2|_3|4|_5. Then the wizard
          >would check those three boxes. But what's the best way to get those
          >underscores inserted in the list?
          >
          >Has anyone already done something like that?
          >
          >Dick Gascoigne


          _________________________________________________________
          Do You Yahoo!?
          Get your free @... address at http://mail.yahoo.com
        • Dick Gascoigne
          Thanks to all who responded. I actually did something similar to Martyn s suggestion just before I got it. Used a Set instead of StrReplace. It all came
          Message 4 of 5 , Mar 6, 2002
            Thanks to all who responded. I actually did something similar to Martyn's suggestion just before I got it. Used a Set instead of StrReplace.

            It all came together nicely. Now we can take one huge print file with 1,000's of documents in it, and split it up to be sent to multiple printers simultaneously. With the capability to specify which printers are to be used via the checkboxes.

            Neat stuff. Not bad for a "text editor", Eric ;-)))

            Best Regards,

            Dick Gascoigne
            --
            Appic (S) Pte Ltd
            74A Amoy Street; Singapore 069893
            Tel: (+65) 6225-9908 Fax: (+65)6 225-9092
            Email: dick.gascoigne@...
            Web: www.appic.com




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