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

18146Re: [Clip] String Split

Expand Messages
  • Don - HtmlFixIt.com
    Aug 1, 2008
    • 0 Attachment
      Okay, I tested this now on some text.

      If I use FALSE at the end, all lines are hard wrapped/split at 70 or
      less and there is a trailing space on the line ... if it is wrapped.
      FALSE stops it from removing the trailing space that caused the split,
      in other words.

      Lines that end short of 70 do not have a space inserted after them
      because they were the natural ends and aren't wrapped by the function.

      If I use TRUE at the end of the function, then all lines are hard
      wrapped at 70 or less, but there is no trailing space. This makes it
      remove the delimiting space at the end of each line as it wraps.

      It seems to work as I would expect.

      Test Block:
      ^$StrEncrypt("Text";[Key])$ (added in v4.84)

      Provides stronger text encryption than ROT13. Use the optional "Key"
      parameter to define an encryption password (maximum 255 characters and
      case sensitive). Make sure you don't forget the key you used with this
      function, otherwise you may never be able to retrieve your encrypted
      text. Note that although the encryption algorithm is very good, there is
      no guarantee that it can't be cracked. You should not rely on it to
      protect very sensitive data. Example:

      ^$StrEncrypt("^$GetSelection$";"^?[key=My secret password]")$



      ^$StrFill("Str";Amount)$

      Returns a string entirely composed of the defined character or text
      repeated Amount times. Examples:

      ^$StrFill(+;4)$ -> ++++

      ^$StrFill("<>";4)$ -> <><><><>



      ^$StrFixLines("Str")$ (added in v4.51)

      Corrects carriage returns in text criteria (Unix and Mac-formatted text
      is converted to Dos/Windows format).



      ^$StrFormat("Str";LeftMargin;TextWidth;Justify)$

      Returns the "Str" string in specified format. LeftMargin determines the
      number of blank spaces to insert between the left margin and the text;
      TextWidth defines the maximum width of the text in each line; Justify is
      either True or False and determines if the text is left and right
      justified. Prior to version 4.8, this command was only available in the
      commercial and trial versions of NoteTab.


      With FALSE (set to 20 instead of 70 to make it easier and avoid wrap in
      email and replacing spaces with # to make it easier to see):
      ^$StrEncrypt("Text"
      ;[Key])$#(added#in#
      v4.84)

      Provides#stronger#
      text#encryption#than#
      ROT13.#Use#the#
      optional#"Key"#
      parameter#to#define#
      an#encryption#
      password#(maximum#
      255#characters#and#
      case#sensitive).#
      Make#sure#you#don't#
      forget#the#key#you#
      used#with#this#
      function,#otherwise#
      you#may#never#be#
      able#to#retrieve#
      your#encrypted#text.#
      Note#that#although#
      the#encryption#
      algorithm#is#very#
      good,#there#is#no#
      guarantee#that#it#
      can't#be#cracked.#
      You#should#not#rely#
      on#it#to#protect#
      very#sensitive#data.#
      Example:

      ##
      ^$StrEncrypt("
      ^$GetSelection$";"^
      ?[key=My#secret#
      password]")$

      #

      ^$StrFill("Str"
      ;Amount)$

      Returns#a#string#
      entirely#composed#of#
      the#defined#
      character#or#text#
      repeated#Amount#
      times.#Examples:

      ^$StrFill(+;4)$##->##
      ++++

      ^$StrFill("<>";4)$##
      ->##<><><><>

      #

      ^$StrFixLines("Str"
      )$#(added#in#v4.51)

      Corrects#carriage#
      returns#in#text#
      criteria#(Unix#and#
      Mac-formatted#text#
      is#converted#to#
      Dos/Windows#format).

      #

      ^$StrFormat("Str"
      ;LeftMargin
      ;TextWidth;Justify)$

      Returns#the#"Str"#
      string#in#specified#
      format.#LeftMargin#
      determines#the#
      number#of#blank#
      spaces#to#insert#
      between#the#left#
      margin#and#the#text;#
      TextWidth#defines#
      the#maximum#width#of#
      the#text#in#each#
      line;#Justify#is#
      either#True#or#False#
      and#determines#if#
      the#text#is#left#and#
      right#justified.#
      Prior#to#version#
      4.8,#this#command#
      was#only#available#
      in#the#commercial#
      and#trial#versions#
      of#NoteTab.

      #

      So there is a space LEFT at the end of each line where the line was
      split if you do it with FALSE. There is not a line inserted if the
      remaining piece of the line does not need to be split or if the line was
      less than the character length to begin with.

      And with it set to TRUE you get no trailing space because it is removed
      as part of the wrapping:
      ^$StrEncrypt("Text"
      ;[Key])$#(added#in
      v4.84)

      Provides#stronger
      text#encryption#than
      ROT13.#Use#the
      optional#"Key"
      parameter#to#define
      an#encryption
      password#(maximum
      255#characters#and
      case#sensitive).
      Make#sure#you#don't
      forget#the#key#you
      used#with#this
      function,#otherwise
      you#may#never#be
      able#to#retrieve
      your#encrypted#text.
      Note#that#although
      the#encryption
      algorithm#is#very
      good,#there#is#no
      guarantee#that#it
      can't#be#cracked.
      You#should#not#rely
      on#it#to#protect
      very#sensitive#data.
      Example:


      ^$StrEncrypt("
      ^$GetSelection$";"^
      ?[key=My#secret
      password]")$

      #

      ^$StrFill("Str"
      ;Amount)$

      Returns#a#string
      entirely#composed#of
      the#defined
      character#or#text
      repeated#Amount
      times.#Examples:

      ^$StrFill(+;4)$##->#
      ++++

      ^$StrFill("<>";4)$
      ->##<><><><>

      #

      ^$StrFixLines("Str"
      )$#(added#in#v4.51)

      Corrects#carriage
      returns#in#text
      criteria#(Unix#and
      Mac-formatted#text
      is#converted#to
      Dos/Windows#format).

      #

      ^$StrFormat("Str"
      ;LeftMargin
      ;TextWidth;Justify)$

      Returns#the#"Str"
      string#in#specified
      format.#LeftMargin
      determines#the
      number#of#blank
      spaces#to#insert
      between#the#left
      margin#and#the#text;
      TextWidth#defines
      the#maximum#width#of
      the#text#in#each
      line;#Justify#is
      either#True#or#False
      and#determines#if
      the#text#is#left#and
      right#justified.
      Prior#to#version
      4.8,#this#command
      was#only#available
      in#the#commercial
      and#trial#versions
      of#NoteTab.

      #


      Note that there are no trailing spaces on lines after the split.
    • Show all 11 messages in this topic