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

Re: [Clip] Replacing characters in a variable

Expand Messages
  • Ray Shapp
    Harvey and Alan: When I ask, What does a true value for wholeword accomplish in string functions? , it is because I don t follow the example Alan gave.
    Message 1 of 10 , Oct 3, 2001
    • 0 Attachment
      Harvey and Alan:

      When I ask, "What does a "true" value for "wholeword" accomplish in string
      functions?", it is because I don't follow the example Alan gave. Also, I'm
      not asking about the various synonyms for Boolean "True" or "False".

      Please make up a clearer example of the use of the "strreplace" function
      which shows how the result differs when the value of "wholeword" is "1"
      versus "0".

      Thanks for your help,

      Ray Shapp
      Watchung, NJ
    • Harvey R. Savage
      ... Hi Ray, I can t answer the query, I don t know what is criteria used, in NoteTab, for determining between wholewords and strings within words. It surely
      Message 2 of 10 , Oct 3, 2001
      • 0 Attachment
        Ray Shapp wrote:
        >
        > Harvey and Alan:
        >
        > When I ask, "What does a "true" value for "wholeword" accomplish in string
        > functions?", it is because I don't follow the example Alan gave. Also, I'm
        > not asking about the various synonyms for Boolean "True" or "False".
        >
        > Please make up a clearer example of the use of the "strreplace" function
        > which shows how the result differs when the value of "wholeword" is "1"
        > versus "0".
        >
        > Thanks for your help,
        >
        > Ray Shapp
        > Watchung, NJ
        >
        Hi Ray,

        I can't answer the query, I don't know what is criteria used, in
        NoteTab, for determining between wholewords and strings within
        words. It surely is more complex than it sounds.

        Most of the searching I do is not for discrete words, but parts
        of other strings.

        I generally make it a practice to always make that setting False,
        0, no, regardless of what I'm searching for.

        hrs
      • Alan C.
        Hi Ray, (apologies for no greeting last time, accidental) ... couple demo clips, would that help. Each of the two clips has identical (same) string which
        Message 3 of 10 , Oct 3, 2001
        • 0 Attachment
          Hi Ray,

          (apologies for no greeting last time, accidental)

          >Please make up a clearer example of the use of the "strreplace" function
          >which shows how the result differs when the value of "wholeword" is "1"
          >versus "0".

          couple demo clips, would that help. Each of the two clips has identical
          (same) string which contains a total of six words. In particular, theater
          is just one of those six words. Also, notice that "the" is replaced with
          "cre". And, most importantly of all, is the difference in outcome between
          the two clips: Each clip has the same identical string, but notice in the
          output what either happens or does not happen to the word "theater".

          To answer your question above: as in 1st clip, when value of wholeword is 1
          it is then that, only certain words, only those words in the string that
          stand independently are modified.

          And, as in 2nd clip, when the value of wholeword is 0 it is then that both
          independently standing words AND ALSO any occurrences from within any
          larger, longer words that are also modified.

          So, the difference has to do with whether or not any occurrence that comes
          from within a larger/longer word gets modified or not.

          H="streplc_wh_word"
          ; Last edited:Wednesday, 03 October 2001
          ^!Set %string%=the theater is near the movies
          ^!SetWizardTitle Before strreplace task
          ^!Info ^%string%
          ^!SetWizardTitle After strreplace task
          ; ^!Info ^$StrReplace("the";"cre";"^%string%";False;True)$
          ^!Info ^$StrReplace("the";"cre";"^%string%";False;1)$

          H="streplc_not_wh_word"
          ; Last edited:Wednesday, 03 October 2001
          ^!Set %string%=the theater is near the movies
          ^!SetWizardTitle Before strreplace task
          ^!Info ^%string%
          ^!SetWizardTitle After strreplace task
          ; ^!Info ^$StrReplace("the";"cre";"^%string%";False;False)$
          ^!Info ^$StrReplace("the";"cre";"^%string%";False;0)$
          ; -----<end of clips<<

          Regards. Alan.
        • David McIntosh
          hI I think you just half to set it again eg. set %test% ThX hXavXns dXclarX the variable will change because you reset it. THANKYOU DAVE
          Message 4 of 10 , Oct 4, 2001
          • 0 Attachment
            hI
            I think you just half to set it again eg.
            set %test% ThX hXavXns dXclarX
            the variable will change because you reset it.
            THANKYOU DAVE

            Mark Halsall wrote:
            >
            > Is there a simple way to replace characters within a variable? I
            > guess this is either very easy or very difficult, but I can't think
            > how to do it.
            >
            > For example, if
            > %test% contains "The heavens declare"
            >
            > I want to change it so
            > %test% contains "ThX hXavXns dXclarX"
            >
            > Regards,
            > Mark
            >
            >
            >
            >
            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          • Jody
            Hi Elizabeth, ... 1, as a matter of fact, there is. ;) Yes|No, True|False, 1|0 (True|False respectively) I find the one and zero the easiest. ;) Happy Clip n!
            Message 5 of 10 , Oct 6, 2001
            • 0 Attachment
              Hi Elizabeth,

              >^!Set %test%="The heavens declare"
              >^!Set %test%=^$StrReplace("e";"X";"^%test%";False;false)$

              >Come to think of it, I have question. Is it possible to do
              >shorthand for the case sensitive and whole word (T or F/1 or
              >0/etc)?

              1, as a matter of fact, there is. ;)

              Yes|No, True|False, 1|0 (True|False respectively) I find the one
              and zero the easiest. ;)

              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
            Your message has been successfully submitted and would be delivered to recipients shortly.