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

Re: [Clip] Re: Saving last used values

Expand Messages
  • Jody
    Hi jdfmike, ... I didn t know exactly what you meant by saving last used values. There s a few different reuses (methods) of values for a lack of better
    Message 1 of 14 , Mar 1, 2004
      Hi jdfmike,

      >This is the solution! Thank you very much! [speaking to John Zeman]

      I didn't know exactly what you meant by "saving last used
      values." There's a few different "reuses" (methods) of values for
      a lack of better terms. You are basically just reusing a value
      already set in the Clipbook session if I understand what you are
      doing. It will not be saved/remembered if used in another
      Library.

      If you use "^%p_YOUR-VARIABLE%" it can be used again in any
      Library that calls the variable so long as you are still in the
      same NoteTab session. That is, NoteTab has not been restarted. It
      is the special code "p_" without the quotes that tells NoteTab to
      remember it.

      I presented a method the other day that stores the value in an
      INI file and can be called from any Library even after your
      computer has been restarted. I wasn't very complete though. I did
      not mention/explain precisely how to call/see the stored value
      again. I'll shorten the Clip to show what it does.

      This line makes the "NtbUsers" INI file active. It creates the
      INI file if it does not exist (I think -haha). It is where your
      values are stored just like a settings in a regular INI file like
      NotePro.ini.

      ^!SetIniFile NtbUsers

      There are a few things going on here. You are settings the
      value/contents of the variable %WinZip%. (In the Clip it is the
      location of WinZip's executable file FWIW.) The "(T=O)" makes the
      browse button with the three dots on it to browse to the file so
      that no path has to be typed in. ^$GetValue is the function used
      to get the value that was stored by the command ^!SaveValue in a
      previous use of the Clip - it is/was remembered. The section and
      key are the terms used in the function to name the parts of it.
      "Section" is optional denoted by the [brackets]
      ^$GetValue("[Section:]Key")$. I used both the section and a key
      in the section. You name them what you want. Generally this setting
      will stay the same, but don't think about that. :)

      ^!Set %WinZip%=^?{(T=O)Full path of WinZip=^$GetValue("WinZip:WinZip")$}
      ^!Set %SaveZip%=^?{(T=D)Enter default path to save zip files=^$GetValue("WinZip:SaveZip")$}

      This is what makes the entry in the INI file. NoteTab contents of
      the variable %WinZip% set above are used. ^!SaveValue has the
      section|key in it. WinZip is the section of the INI file that
      these two particular keys are stored in.

      ^!SaveValue WinZip:WinZip=^%WinZip%
      ^!SaveValue WinZip:SaveZip=^%SaveZip%

      This is what it looks link inside the INI file (NtbUsers). [WinZip]
      is the section, then there are two keys: WinZip and SaveZip with
      their contents.

      [WinZip]
      WinZip="G:\WinZip\WINZIP32.EXE"
      SaveZip="F:\NoteTab Pro\Libraries\"

      So, it is the ^!SaveValue that is used to set the values stored in the
      INI file and ^$GetValue that can be used at anytime form any Library.
      If no INI file is specified, then NoteTab's INI file is used to store
      the settings. You'll probably want to look back at the original post I
      made to see it all to maybe get a better understanding.

      If you open the SampleCode Library and look under "Wizard Fields"
      you'll see two Clips, one of which I mentioned above with the
      "p_" code in it. There is another called "Remember default value"
      that would fall under this discussion.

      Also, if you download my DirStuff Library there are two working
      examples of using the SaveValue and GetValue method. Near the
      bottom of the Library you'll see "Setup" and under it "Setup
      Directory" and "Setup WinZip." Two of the Clips that use the
      stored information are "Open Directory..." and "Checkbox
      Open...," but it is also used in other Libraries I have like
      FtpZip which has the same Setup WinZip (that only needs to be
      done from any of my Libraries that has it) and also "Setup
      NtbWsFtp" which is used for uploading files to web sites using
      Ws_Ftp.

      http://www.notetab.net/html/library.htm
      http://www.notetab.net/zip/dirstuff.zip
      http://www.notetab.net/zip/ftpzip.zip

      No for the sales pitch. :-)

      My affiliate links and CD information.

      Download Trials and Freeware, Information...
      ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
      http://www.fookes.com/regnow.html?2448&item=home
      Really neat ordering system with discounts -
      Live PHP document showing instant cost/discounts
      Buy Now!, but check it out without buying!
      http://www.fookes.com/regnow.html?2448

      ** I can accept PayPal too! **
      http://www.fookes.us/paypal.htm
      (Write me: jody@...)

      CD-ROMs Loaded With MB and Are Very Useful

      Ordering Information: Price, CD build type...
      http://www.notetab.net/html/cd-info.htm
      Programs, Utilities, Helps, Clip Tutorial...
      http://www.notetab.net/html/onthiscd.htm
      Third Party Products: Freeware and Shareware...
      http://www.notetab.net/html/tpp-readthis.htm
      Order Fookes Software through me (on/off CD)...
      http://www.fookes.com/regnow.html?2448

      bcnu,
      jody

      I can only please one person a day.
      Today is obviously not your day.
      Tomorrow doesn't look good either. 8D
      http://www.clean-funnies.com
      http://www.notetab.net
    • Larry Thomas
      Hi Jody and others, ... I have discovered a situation where you must use something other than a variable to pass your data. There was a question sometime back
      Message 2 of 14 , Mar 1, 2004
        Hi Jody and others,

        At 12:06 PM 3/1/04 -0600, you wrote:
        >Hi jdfmike,
        >
        >>This is the solution! Thank you very much! [speaking to John Zeman]
        >
        >I didn't know exactly what you meant by "saving last used
        >values." There's a few different "reuses" (methods) of values for
        >a lack of better terms. You are basically just reusing a value
        >already set in the Clipbook session if I understand what you are
        >doing. It will not be saved/remembered if used in another
        >Library.
        >
        >If you use "^%p_YOUR-VARIABLE%" it can be used again in any
        >Library that calls the variable so long as you are still in the
        >same NoteTab session. That is, NoteTab has not been restarted. It
        >is the special code "p_" without the quotes that tells NoteTab to
        >remember it.

        I have discovered a situation where you must use something other than a
        variable to pass your data. There was a question sometime back from Manuel
        asking about why he could not set a variable in one clip and use it in a
        second one. That is, he was having a problem. He would run clip one and
        it would set a variable and then he would run clip two which would use the
        variable and it did not work. I told him about the ^%p_Global Variables%
        that you mentioned above. Then I came accross a situation on one of my own
        clips where the second clip could not get the contents of the variable.

        It appears that it fails if you run the clips from a clipbar. If you run
        them from the clipbook itself, then they work fine but if you run them from
        the clipbar the variable does not get passed. My understanding of the
        clipbar is that clips are loaded into RAM before being run. When this
        happens, it appears that the second clip deletes/clears the variables from
        RAM when it is loaded and run and the variable is lost. If you run the
        clip from the clipbook panel or the In-Context box, the clip is read and
        run from the library one instruction at a time and when you run the second
        clip, the variable is still in RAM and available for the second clip to
        use. I thought that you might be interested in this as it caught me off
        guard when I was writting my clip. I may have even given Manuel bad advise
        without realizing it. If so, I apologize.

        Regards,

        Larry
        lrt@... e¿ê
      • Jody
        Hi Larry, ... Yes, there are a few things that do not work (not programmed to) from the Clipbar and have to be run from Library to Library. FarClip does not
        Message 3 of 14 , Mar 2, 2004
          Hi Larry,

          >It appears that it [^%p_variable%] fails if you run the clips
          >from a clipbar. If you run them from the clipbook itself, then
          >they work fine but if you run them from the clipbar the variable
          >does not get passed.

          Yes, there are a few things that do not work (not programmed to)
          from the Clipbar and have to be run from Library to Library.
          FarClip does not work from the if I am not mistaken; wouldn't be
          the first time I am wrong though. <g>

          Take care,
          Jody Adair

          The whole world doth err save you and me,
          and even thou doest err some!
          http://clean-funnies.com
          http://notetab.net, http://fookes.us
        Your message has been successfully submitted and would be delivered to recipients shortly.