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

Re: [Clip] Flushing .ini file to disk

Expand Messages
  • John Zeman
    ... The problem, as I understand it, is that Windows treats .ini files differently from others, buffering changes in memory for a while before actually writing
    Message 1 of 7 , May 9, 2005
      --- In ntb-clips@yahoogroups.com, "Jamal Mazrui" <Jamal.Mazrui@f...>
      wrote:
      > Thanks for your response. Those are the commands I've been using.
      The problem, as I understand it, is that Windows treats .ini files
      differently from others, buffering changes in memory for a while
      before actually writing them to disk.
      > Jamal
      >


      In addition to what the others have said, here is another way you can
      think about NoteTab ini files.

      Basically changing values in the NoteTab ini file involves a 3 step
      procedure.

      In a clip at the point where you are ready to do something with the
      ini file, the first step is to save the actual dynamic settings of
      the ini file (which is contained in Windows memory) to disk by file
      using

      ^!ProgIniSave

      Then write whatever changes you want to the ini file immediately
      after that. Finally, you'll want to reload the ini file back into
      Windows memory again by using

      ^!ProgIniLoad

      For example the following simple clip adjusts the NoteTab ini file
      (regardless of what it is at the moment in Windows memory) to set the
      widths of the Clipbook, Quicklist, and outline columns to 150 pixels.


      ^!ProgIniSave
      ^!SaveValue Clipbook:PanelWidth=150
      ^!SaveValue Quicklist:PanelWidth=150
      ^!SaveValue OutlineList:PanelWidth=150
      ^!ProgIniLoad

      John
    • hsavage
      ... John, You may be correct but I would like Eric or Jody to verify the above. It seems the sequence is a little off. Shouldn t the ^!ProgIniSave command be
      Message 2 of 7 , May 9, 2005
        John Zeman wrote:

        > In addition to what the others have said, here is another way you can
        > think about NoteTab ini files.
        >
        > In a clip at the point where you are ready to do something with the
        > ini file, the first step is to save the actual dynamic settings of
        > the ini file (which is contained in Windows memory) to disk by file
        > using
        >
        > ^!ProgIniSave
        >
        > Then write whatever changes you want to the ini file immediately
        > after that. Finally, you'll want to reload the ini file back into
        > Windows memory again by using
        >
        > ^!ProgIniLoad
        >
        > For example the following simple clip adjusts the NoteTab ini file
        > (regardless of what it is at the moment in Windows memory) to set the
        > widths of the Clipbook, Quicklist, and outline columns to 150 pixels.
        >
        >
        > ^!ProgIniSave
        > ^!SaveValue Clipbook:PanelWidth=150
        > ^!SaveValue Quicklist:PanelWidth=150
        > ^!SaveValue OutlineList:PanelWidth=150
        > ^!ProgIniLoad
        >
        > John

        John,

        You may be correct but I would like Eric or Jody to verify the above.
        It seems the sequence is a little off.

        Shouldn't the ^!ProgIniSave command be immediately after the ^!SaveValue
        commands to allow all the most current information entered or saved to
        be written to disk then followed by ^!ProgIniLoad to load the newly
        saved disk file back into memory with all its up to date changes intact?

        This is the command order I would use but I could be wrong, thus the
        call for clarification from 'above'.

        ^!SaveValue Clipbook:PanelWidth=150
        ^!SaveValue Quicklist:PanelWidth=150
        ^!SaveValue OutlineList:PanelWidth=150
        ^!ProgIniSave
        ^!ProgIniLoad

        One, also, may have some success using the ^!Setinifile command to close
        an ini file in use then re-use it to re-access the same ini file.

        ºvº
        05.05.09
        hrs > hsavage@...
      • John Zeman
        ... I don t think so Harvey as the ^!SaveValue command writes directly to the ini file as it exists on the disk at the time you invoke it. Normally the ini
        Message 3 of 7 , May 9, 2005
          --- In ntb-clips@yahoogroups.com, hsavage <hsavage@p...> wrote:
          > John Zeman wrote:
          >
          > Shouldn't the ^!ProgIniSave command be immediately after the ^!SaveValue
          > commands to allow all the most current information entered or saved to
          > be written to disk then followed by ^!ProgIniLoad to load the newly
          > saved disk file back into memory with all its up to date changes intact?



          I don't think so Harvey as the ^!SaveValue command writes directly to the ini file as it exists on the disk at the time you invoke it.

          Normally the ini file on disk is not updated by NoteTab until you actually close NoteTab or exit Windows.

          So if you write to the ini file using the ^!SaveValue command then later use the ^!ProgIniSave command (or just close NoteTab) you will overwrite the ini file changes you just made with whatever is current in the Windows memory for the ini file.

          John
        Your message has been successfully submitted and would be delivered to recipients shortly.