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

22275Re: Finding gaps in a sequence

Expand Messages
  • flo.gehrke
    Nov 30, 2011
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, "Eb" <ebbtidalflats@...> wrote:
      >
      > Hi Flo,
      >
      > I pulled the translation code from my memory, didn't test it, and added typos. I know it worked where I used it before, but do not remember where I used it :=( .
      >
      > I'll get back to you when I find it.
      >
      > Sorry to waste your time like this.
      >
      > Cheers,
      >
      > Eb

      Eb,

      I'm still racking my brains over that line because I think there's an interesting issue in here.

      I suspect your intention is to create a string like '^%a%^%y%^%z%' with...

      ^!Set %a%=61; %y%=79; %z%=7A
      ^!Set %Code%=^%^$StrReplace("^%NL%";"%^%";"^$StrSplit("ayz";1;True)$";0;0)$%
      ^!Info ^%Code%

      In detail, 'ayz' is split into...

      a
      y
      z

      Next, the CRNL in this are replaced with '%^%' providing 'a%^%y%^%z'. Adding a preceding '^%' and a trailing '%' you try to get '^%a%^%y%^%z%'.

      I found out that we could achieve that string by replacing the caret with its preset variable:

      ^!Set %a%=61; %y%=79; %z%=7A
      ^!Set %Code%=^%CARET%%^$StrReplace("^%NL%";"%^%CARET%%";"^$StrSplit("ayz";1;True)$";0;0)$%
      ^!Info ^%Code%

      Now the problem is that NT provides that string of variables but, surprisingly, not their contents, that is, the hex values: '61797A'. Why this?

      Regards,
      Flo


      P.S. In case that line would provide the hex values, it would be another question how to convert that string into integers with '^$HexToInt(^%codes^%i%%)$'. Anyway, first of all I would be happy to understand why the above mentioned line doesn't provide the hex values...
    • Show all 29 messages in this topic