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

ClearValue question

Expand Messages
  • John Shotsky
    I m trying to use the ^!ClearValue command to automatically remove some old variable names in notepro.ini when NoteTab starts. I have a list of items to clean
    Message 1 of 5 , Jun 26, 2010
      I'm trying to use the ^!ClearValue command to automatically remove some old variable names in
      notepro.ini when NoteTab starts. I have a list of items to clean up in an 'OnOpen' clip. I have set
      debug on and watched it go through all the steps, so it *looks* like it's doing what it is supposed
      to do, but when I look at the .ini file after closing NoteTab, (or even while it is running) those
      variables are still present. I have verified that the Notepro.ini file that it's looking at is the
      one that needs the work. (I have it display the .ini file path and name.)

      The help section says:
      ^!ClearValue [Section:]Key
      Deletes the specified key in NoteTab's INI file, or in the INI file defined by the ^!SetIniFile
      command. If a section name is not defined, the key entry is searched under the [ClipValues] section.
      Section names are only supported since version 4.51.

      The variables that I want deleted out of NotePro.ini exist in the [ClipValues] section. According to
      the help, if I don't list the section, they will be removed from that section. I have tried it both
      ways - listing the section and not, but those variables never go away.

      Here is a fragment. This does display the correct .ini file.
      ^!SetIniFile
      ^!Set %StartupIni%=^$GetIniFile$
      ^!InsertText ^PThe Current Ini file is ^%StartupIni%
      ^!ClearValue CB2TXT
      ^!ClearValue ClipValues:CB2TXT
      ^!ProgIniSave
      ^!ProgIniLoad

      My thought was that by deleting the values, then saving the .ini and reloading it, those variables
      would be removed.
      Has anyone used this command before? It appears to me that it is simply not working.
      Thanks,
      John



      [Non-text portions of this message have been removed]
    • Art Kocsis
      Hi John, My first thought is that you may be looking under the wrong lamp post. Have you double verified that the variable is not getting recreated somewhere
      Message 2 of 5 , Jun 26, 2010
        Hi John,

        My first thought is that you may be looking under the wrong lamp post. Have
        you double verified that the variable is not getting recreated somewhere
        else? Some other clip? If your clip libs are all localized do a mass file
        search for the variable name(s) in all your clip files. This would be
        trivial in Ztree or load them all in NTB and do a global search.

        Second thought is NTB does not actually write out changes to the INI file
        until it terminates. The Save & Load may only be an in memory operation. Do
        the values still exist immediately after the save & load operations?

        Rereading the ^!SetIniFile help info literally (sometimes necessary), it
        does not put "Name" within brackets to indicate that "Name" is optional and
        it says that the command without the "Name" operand RESETS the default ini
        to NTB's default. Try putting a ^!SetIniFile alt_ini_name command before
        your ^!SetIniFile command. [Yes, I know this is clutching at straws!]

        Try creating a dummy entry or two in your INI file (use a different editor)
        and see if the clear operation works for them. Or (again using a different
        editor), manually delete the offending items in the ini file and see if
        they reappear when you rerun NTB.

        Isolate the problem: is it the operation or the variable(s).

        Isn't debugging fun! Hope your hair is short and non-grabable<g>.

        Namaste', Art

        At 06-26-10 07:11, you wrote:
        >I'm trying to use the ^!ClearValue command to automatically remove some
        >old variable names in
        >notepro.ini when NoteTab starts. I have a list of items to clean up in an
        >'OnOpen' clip. I have set
        >debug on and watched it go through all the steps, so it *looks* like it's
        >doing what it is supposed
        >to do, but when I look at the .ini file after closing NoteTab, (or even
        >while it is running) those
        >variables are still present. I have verified that the Notepro.ini file
        >that it's looking at is the
        >one that needs the work. (I have it display the .ini file path and name.)
        >
        >The help section says:
        >^!ClearValue [Section:]Key
        >Deletes the specified key in NoteTab's INI file, or in the INI file
        >defined by the ^!SetIniFile
        >command. If a section name is not defined, the key entry is searched under
        >the [ClipValues] section.
        >Section names are only supported since version 4.51.
        >
        >The variables that I want deleted out of NotePro.ini exist in the
        >[ClipValues] section. According to
        >the help, if I don't list the section, they will be removed from that
        >section. I have tried it both
        >ways - listing the section and not, but those variables never go away.
        >
        >Here is a fragment. This does display the correct .ini file.
        >^!SetIniFile
        >^!Set %StartupIni%=^$GetIniFile$
        >^!InsertText ^PThe Current Ini file is ^%StartupIni%
        >^!ClearValue CB2TXT
        >^!ClearValue ClipValues:CB2TXT
        >^!ProgIniSave
        >^!ProgIniLoad
        >
        >My thought was that by deleting the values, then saving the .ini and
        >reloading it, those variables
        >would be removed.
        >Has anyone used this command before? It appears to me that it is simply
        >not working.
        >Thanks,
        >John

        ----------


        No virus found in this outgoing message.
        Checked by AVG - www.avg.com
        Version: 9.0.837 / Virus Database: 271.1.1/2958 - Release Date: 06/23/10 04:11:00


        [Non-text portions of this message have been removed]
      • John Shotsky
        Thanks, Art, I did find the problem. The shadow .ini file got me. I was not trying to use an alternate ini, it was the stock .ini that I wanted to clear
        Message 3 of 5 , Jun 26, 2010
          Thanks, Art, I did find the problem. The shadow .ini file got me. I was not trying to use an
          alternate ini, it was the stock .ini that I wanted to clear variables out of, so I could control
          them in an alternate .ini. I don't like them being in two places, in case the wrong .ini is somehow
          being used when my clips run. So, all is good now. My code was actually working, but not being
          reflected in the local NotePro.ini.

          My hair is non-grabble - I use the razor on my head.

          Regards,
          John

          From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of Art Kocsis
          Sent: Saturday, June 26, 2010 08:27
          To: NoteTab-Clips
          Subject: Re: [Clip] ClearValue question


          Hi John,

          My first thought is that you may be looking under the wrong lamp post. Have
          you double verified that the variable is not getting recreated somewhere
          else? Some other clip? If your clip libs are all localized do a mass file
          search for the variable name(s) in all your clip files. This would be
          trivial in Ztree or load them all in NTB and do a global search.

          Second thought is NTB does not actually write out changes to the INI file
          until it terminates. The Save & Load may only be an in memory operation. Do
          the values still exist immediately after the save & load operations?

          Rereading the ^!SetIniFile help info literally (sometimes necessary), it
          does not put "Name" within brackets to indicate that "Name" is optional and
          it says that the command without the "Name" operand RESETS the default ini
          to NTB's default. Try putting a ^!SetIniFile alt_ini_name command before
          your ^!SetIniFile command. [Yes, I know this is clutching at straws!]

          Try creating a dummy entry or two in your INI file (use a different editor)
          and see if the clear operation works for them. Or (again using a different
          editor), manually delete the offending items in the ini file and see if
          they reappear when you rerun NTB.

          Isolate the problem: is it the operation or the variable(s).

          Isn't debugging fun! Hope your hair is short and non-grabable<g>.

          Namaste', Art

          At 06-26-10 07:11, you wrote:
          >I'm trying to use the ^!ClearValue command to automatically remove some
          >old variable names in
          >notepro.ini when NoteTab starts. I have a list of items to clean up in an
          >'OnOpen' clip. I have set
          >debug on and watched it go through all the steps, so it *looks* like it's
          >doing what it is supposed
          >to do, but when I look at the .ini file after closing NoteTab, (or even
          >while it is running) those
          >variables are still present. I have verified that the Notepro.ini file
          >that it's looking at is the
          >one that needs the work. (I have it display the .ini file path and name.)
          >
          >The help section says:
          >^!ClearValue [Section:]Key
          >Deletes the specified key in NoteTab's INI file, or in the INI file
          >defined by the ^!SetIniFile
          >command. If a section name is not defined, the key entry is searched under
          >the [ClipValues] section.
          >Section names are only supported since version 4.51.
          >
          >The variables that I want deleted out of NotePro.ini exist in the
          >[ClipValues] section. According to
          >the help, if I don't list the section, they will be removed from that
          >section. I have tried it both
          >ways - listing the section and not, but those variables never go away.
          >
          >Here is a fragment. This does display the correct .ini file.
          >^!SetIniFile
          >^!Set %StartupIni%=^$GetIniFile$
          >^!InsertText ^PThe Current Ini file is ^%StartupIni%
          >^!ClearValue CB2TXT
          >^!ClearValue ClipValues:CB2TXT
          >^!ProgIniSave
          >^!ProgIniLoad
          >
          >My thought was that by deleting the values, then saving the .ini and
          >reloading it, those variables
          >would be removed.
          >Has anyone used this command before? It appears to me that it is simply
          >not working.
          >Thanks,
          >John

          ----------

          No virus found in this outgoing message.
          Checked by AVG - www.avg.com
          Version: 9.0.837 / Virus Database: 271.1.1/2958 - Release Date: 06/23/10 04:11:00

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



          [Non-text portions of this message have been removed]
        • hsavage
          ... what ... present. ... the one ... simply not working. ... John, If you modify your clip to incorporate the clip lines below you should have no trouble
          Message 4 of 5 , Jun 26, 2010
            John Shotsky wrote:
            > I'm trying to use the ^!ClearValue command to automatically remove
            > some old variable names in notepro.ini when NoteTab starts. I have a
            > list of items to clean up in an 'OnOpen' clip. I have set debug on and
            > watched it go through all the steps, so it *looks* like it's doing
            what
            > it is supposed to do, but when I look at the .ini file after closing
            > NoteTab, (or even while it is running) those variables are still
            present.
            > I have verified that the Notepro.ini file that it's looking at is
            the one
            > that needs the work. (I have it display the .ini file path and name.)

            > Here is a fragment. This does display the correct .ini file.
            > ^!SetIniFile
            > ^!Set %StartupIni%=^$GetIniFile$
            > ^!InsertText ^PThe Current Ini file is ^%StartupIni%
            > ^!ClearValue CB2TXT
            > ^!ClearValue ClipValues:CB2TXT
            > ^!ProgIniSave
            > ^!ProgIniLoad
            >
            > Has anyone used this command before? It appears to me that it is
            simply not working.
            > Thanks,
            > John

            John,

            If you modify your clip to incorporate the clip lines below you
            should have no trouble clearing values from NotePro.ini while NoteTab
            Pro is open or closed.


            H=ClearValue
            ^!SetIniFile
            ^!Open "^$GetAppPath$NotePro.ini"
            ;_
            ;_no brackets needed
            ;_no quotes needed unless names contains spaces
            ;_
            ;_'V'alue 'T'o 'C'lear
            ^!ClearValue "VTC"
            ;_^!ClearValue "section:VTC"
            ;_
            ^!Refresh
            ^!ProgIniLoad
            ^!Menu Edit/Reload


            The critical portion is;

            ^!ClearValue "VTC"
            ^!Refresh
            ^!ProgIniLoad

            Section not needed if value is in [ClipValues] section, otherwise
            [section] is needed.


            ·············································
            ºvº SL_day# 177 - created 2010.06.26_19.15.50

            Newspaper HeadLine...
            • Enfields Couple Slain; Police Suspect Homicide

            € hrs € hsavage € pobox € com
          • Art Kocsis
            Hi John, That s kinda what I thought. The most intractable debugging problems is when we know where the computer is looking. Your hair status is even mo
            Message 5 of 5 , Jun 28, 2010
              Hi John,

              That's kinda what I thought. The most intractable debugging problems is
              when we "know"
              where the computer is looking.<g>

              Your hair status is even mo' betta - doesn't show any grey!

              Namaste', Art


              At 06-26-10 08:46, you wrote:
              >Thanks, Art, I did find the problem. The shadow .ini file got me. I was
              >not trying to use an
              >alternate ini, it was the stock .ini that I wanted to clear variables out
              >of, so I could control
              >them in an alternate .ini. I don't like them being in two places, in case
              >the wrong .ini is somehow
              >being used when my clips run. So, all is good now. My code was actually
              >working, but not being
              >reflected in the local NotePro.ini.
              >
              >My hair is non-grabble - I use the razor on my head.
              >
              >Regards,
              >John
              >
              >From: <mailto:ntb-clips%40yahoogroups.com>ntb-clips@yahoogroups.com
              >[mailto:ntb-clips@yahoogroups.com] On Behalf Of Art Kocsis
              >Sent: Saturday, June 26, 2010 08:27
              >To: NoteTab-Clips
              >Subject: Re: [Clip] ClearValue question
              >
              >Hi John,
              >
              >My first thought is that you may be looking under the wrong lamp post. Have

              ----------


              No virus found in this outgoing message.
              Checked by AVG - www.avg.com
              Version: 9.0.837 / Virus Database: 271.1.1/2962 - Release Date: 06/24/10 23:35:00


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