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

23891Re: [Clip] Re: alphanumeric character transcoding, by ones and pairs

Expand Messages
  • Ian NTnerd
    Jun 19, 2013
    • 0 Attachment
      Richard,

      Part of the idea is for you to learn how clips go together. If we give
      you all you don't learn as much. :-)

      I changed the tab list delimiter so email does not mess up the tab. Now
      it is space greater than, greater than space.
      With
      ^!SetListDelimiter " >> "

      Here is my working code with start and end samples.

      If you are using it to go the other way Normal to Standard then the [
      character needs to be escaped with a \[ in the list.

      H="Karen Standard to Normal"
      ^!SetListDelimiter ^p
      ^!SetArray %Charpair%=^$GetClipText("list")$
      ^!Set %i%=0

      :Loop
      ^!Inc %i%
      ^!If ^%i% > ^%Charpair0% Out
      ^!SetListDelimiter " >> "
      ^!SetArray %pair%=^%Charpair^%i%%
      ^!Set %Search%=^%pair1%
      ^!Set %ReplaceWith%=^%pair2%
      ^!SetDebug Off
      ^!If ^$StrSize("^%ReplaceWith%")$ = 2 addchar ELSE noadd
      :addchar
      ^!Set
      %ReplaceWith%=^$StrCopyLeft("^%ReplaceWith%";1)$|^$StrCopyRight("^%ReplaceWith%";1)$
      :noadd
      ^!Replace "(?<!\|)^%Search%" >> "|^%ReplaceWith%" WARS
      ^!Goto Loop

      :Out
      ^!Replace "|" >> "" WATS

      H=";List follows has the form character1 space greater_than greater_than
      space character2"


      H="_list"
      bJ >> bS
      dD >> 'f
      kY >> uF
      KY >> cF
      mD >> rf
      mJ >> rS
      pJ >> yS
      PJ >> zS
      SJ >> pS
      sJ >> qS
      a >> g
      A >> H
      b >> b
      B >> R
      c >> C
      d >> '
      E >> h
      e >> J
      F >> .
      f >> m
      g >> i
      h >> [
      H >> o
      I >> >
      i >> X
      j >> *
      J >> S
      K >> c
      k >> u
      L >> s
      l >> v
      m >> r
      n >> E
      o >> D
      O >> d
      p >> y
      P >> z
      q >> n
      r >> &
      S >> p
      s >> q
      t >> w
      T >> x
      u >> k
      U >> K
      v >> l
      w >> 0
      W >> G
      X >> {
      x >> t
      y >> ,
      Y >> F
      z >> ±S
      : >> ;
      \\ >> -



      H="Karen Standard"
      lABTAkvFHWAkolaKELdAFqalanWElacO:laKv:sE:muIsE:sFlanolapLUB

      H="Karen Normal"
      vhRxhul.oGhuDvgcHs'h.ngvgEGHvgCd;vgcl;qH;rk>qH;q.vgeDvgysKR


      On 19/06/2013 11:13 PM, rickah wrote:
      >
      >
      >
      > Vielen Danke, Flo. Most excellent.
      >
      > I had to update to NTB v7 (for the %RepWith%), and I had trouble with
      > this one line relating to the list.txt, for obvious reasons:
      >
      > ^!SetListDelimiter »
      >
      > instead of:
      >
      > ^!SetListDelimiter >>
      > --
      >
      > And a gold star for catching the "... n >> E, > U >> K" ...
      >
      > This will help tremendously since there are more than those two font
      > variations to work with. Only recently does that language have a
      > Unicode font with a standard keyboard layout. Working toward gradually
      > changing the various older texts into the new font set will be so much
      > easier now.
      >
      > Thanks again, Flo and Ian,
      > Richard
      >
      > --
      >
      > --
      >
      >



      [Non-text portions of this message have been removed]
    • Show all 19 messages in this topic