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

13625Re: [Clip] Parsing INI operations

Expand Messages
  • hsavage
    May 10, 2005
    • 0 Attachment
      John Zeman wrote:

      > I need to correct something I said last time about the ini file.
      >
      > Here are my revised conclusions:
      >
      > 1. The only time the ini file is actually changed on disk is when the
      > ^!ProgIniSave command is used (and of course when exiting the NoteTab
      > program).
      >
      > 2. The ^!SaveValue command does not write to the ini file on disk as
      > I'd stated earlier, instead it changes the dynamic value of a setting
      > in the ini memory.
      >
      > 3. Here's another thing it seems I was wrong about. Once the dynamic
      > value of the ini file is changed in memory, it's NOT used in the
      > current NoteTab session UNLESS the ^!ProgIniLoad command is run.
      >
      > 4. It seems that when you run the ^!ProgIniSave command, NoteTab does
      > NOT save any recently made changes that were made to the ini via the
      > ^!SaveValue command. Rather it seems to save what NoteTab had last
      > read from the ini when the program was launched or refreshed by using
      > the ^!ProgIniLoad command.
      >
      > So to sum it up it appears the following might be a basic template to
      > use when processing the NoteTab ini file.
      >
      > ; Update NoteTab to any recent changes
      > ^!ProgIniLoad
      >
      > ; Save current ini config to disk
      > ^!ProgIniSave
      >
      > ; Read or write new ini values
      > ^!SaveValue [Section:]Key=Value
      >
      > ; Update NoteTab again
      > ^!ProgIniLoad
      >
      > It's been an interesting exercise. Any thoughts out there?
      >
      > John

      Hey John,

      Frankly, after writing the short test clip, included below, I'm less
      sure where ^!ProgIniLoad and ^!ProgIniSave fit into the scheme of things.

      Judging from the results of this clip ^!SaveValue writes to disk and,
      maybe, dynamic memory.

      At least, after using ^!SaveValue, the data written is available using
      ^$GetValue(":")$ before the file or, changes to the ini file appear on disk.

      The ^!SaveValue writes the value, the ^$GetValue(":")$ accesses that
      value within nano-seconds in the command that follows, which is pretty
      quick.

      The loop prevents the clip from ending until you press the ctrlkey or
      the abort sequence, Ctrl+Alt.

      —————————————————————————————————————————————
      h=savevalue test
      ; creates or accesses ini in Ntb Libraries folder
      ^!SetIniFile Ntb-TEST
      ; saves value to disk file and dynamic memory
      ^!SaveValue SAVEVALUE TEST:SAVEVALUE TEST 1=SAVEVALUE TEST 2
      ; gets value written by test
      ^!StatusShow ^$GetValue("SAVEVALUE TEST:SAVEVALUE TEST 1")$
      :LOOP
      ^!Delay 1
      ^!IfFalse ^$IsCtrlKeyDown$ LOOP
      —————————————————————————————————————————————

      Help file excerpts.
      —————————————————————————————————————————————
      ^!SaveValue [Section:]Key=Value
      Saves the key and its value in NoteTab's INI file, or in the INI file
      defined by the ^!SetIniFile command.
      —————————————————————————————————————————————
      ^$GetValue("[Section:]Key")$
      Reads the specified key in NoteTab's INI file, or in the INI file
      defined by the ^!SetIniFile command.
      —————————————————————————————————————————————
      ^!ProgIniSave [IniName] (added in v4.6)
      Saves the current program settings into the NoteTab ini file or registry.
      —————————————————————————————————————————————
      ^!ProgIniLoad [IniName] (added in v4.6)
      Loads options from the NoteTab ini file or registry.
      —————————————————————————————————————————————

      ºvº
      05.05.10
      hrs > hsavage@...
    • Show all 6 messages in this topic