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

replace across line breaks in a Str?

Expand Messages
  • sgilbert92
    Thanks Alan C and Abair for ideas on dynamic wizards...I m experimenting much more wildly now. Now I m trying to make a wizard where you paste in a block of
    Message 1 of 2 , Mar 31, 2005
    • 0 Attachment
      Thanks Alan C and Abair for ideas on dynamic wizards...I'm
      experimenting much more wildly now.

      Now I'm trying to make a wizard where you paste in a block of text
      from, say, Word, and then click various flags, and NoteTab spits out
      HTML according to the flags.

      It's working, except that I'd like to search/replace in the original
      block of text (stored in a variable) for things like smart quotes from
      Word and emdashes. I could use StrToHTML, I know, but actually I
      don't want the entities for smart quotes, I want just & quot ;. And
      there are some other examples like this.

      But when I try to use StrReplace on the text block, the line breaks
      boggle it. Any suggestion besides the not-so-elegant approach of
      replacing all line breaks with QQQ or something, doing StrReplace on
      the offending special characters, and then converting the QQQ's back
      to line breaks?

      I'm good with ^!Replace, but that only works on active docs, right,
      not vars?

      Stephen
    • Hugo Paulissen
      Hi sgilbert92, ... That is correct - you could send your variable to a file and then do the ^!Replace on that, but that may not be necessary... I am not sure
      Message 2 of 2 , Apr 1, 2005
      • 0 Attachment
        Hi sgilbert92,

        > But when I try to use StrReplace on the text block, the line breaks
        > boggle it. Any suggestion besides the not-so-elegant approach of
        > replacing all line breaks with QQQ or something, doing StrReplace on
        > the offending special characters, and then converting the QQQ's back
        > to line breaks?
        >
        > I'm good with ^!Replace, but that only works on active docs, right,
        > not vars?

        That is correct - you could send your variable to a file and then do
        the ^!Replace on that, but that may not be necessary...

        I am not sure what you mean with "the line breaks boggle it". Could
        you send an example of your code?

        If I run this clip on your mail I get a block of text without line-
        breaks...

        ^!Set %Temp1%=^$strReplace("this";"that";"^$getClipboard$";0;0)$
        ^!Set %Temp2%=^$strReplace("Word";"MS WORD";"^%Temp1%";0;0)$
        ^!Set %Temp3%=^$strReplace("^P";" ";"^%Temp2%;0;0)$
        ^!INFO ^%Temp3%

        Regards,

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