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

[Clip] Re[2]: Get decimal value of asci characters

Expand Messages
  • Alan Williams
    Hi Jody, ... Thanks Jody, These suggestions gave me the kickstart to get going, and bear with me as I post my progress so far (perhaps some of you could offer
    Message 1 of 3 , Apr 29, 1999
      Hi Jody,

      Thursday, 29 April 1999, you wrote:

      > Have you look at these functions:
      > GetSelSize
      > ^$GetSelSize$
      > GetWord
      > ... snipped for brevity ...

      Thanks Jody, These suggestions gave me the kickstart to get going, and
      bear with me as I post my progress so far (perhaps some of you could
      offer neater ways of getting there)

      I have done the easy bit, capturing input and devising a loop to
      iterate it character by character:

      H=";"

      H=";Getword"

      H="Getword test
      ^!Toolbar New Document
      ^!Set %addy%=^?[Type in email address=eg.me@...]
      ^!Set %size%=^$StrSize(^%addy%)$
      ^!KeyBoard ENTER
      You typed in "^%addy%"
      Which is ^%size% characters long
      ^!Set %lim%=1
      ^!Set %nim%=1
      :Loop
      ^!Set %Jo1%=^$StrCopy(^%addy%;^%lim%;1)$
      ^!KeyBoard ENTER
      Char ^%nim% is ^%Jo1%
      :Endloop
      ^!If ^%lim% < ^%size% :Conloop ELSE END
      :Conloop
      ^!Inc %lim%
      ^!Inc %nim%
      ^!GoTo :Loop

      Some questions: I initially tried to use the ^%NL% to put each
      iteration on its own line, but each new line began at the point where
      the previous one left off, producing a terraced text effect.

      Hopefully once testing is complete Ill be able to dispense with the
      new document and return the final result as a prompt message.

      Is this a bug, expected behaviour, or is there another trick (besides
      keyboard ENTER) I'm, missing?

      My next obstacle is matching each character in some way to a list of
      ascii char codes and substituting the code for the char, but Im on it!


      Best regards,
      Alan

      mailto:alwilli@...



      ------------------------------------------------------------------------
      eGroup home: http://www.eGroups.com/group/ntb-clips
      http://www.eGroups.com - Simplifying group communications
    • Jody
      Hi Alan, ... Try adding it after these lines: Which is ^%size% characters long^%nl% ^!Set %Jo1%=^$StrCopy(^%addy%;^%lim%;1)$^%nl% ... Try ^$GetSelection$,
      Message 2 of 3 , Apr 29, 1999
        Hi Alan,

        >H="Getword test

        > Some questions: I initially tried to use the ^%NL% to put each
        > iteration on its own line, but each new line began at the point
        >where the previous one left off, producing a terraced text effect.

        Try adding it after these lines:

        Which is ^%size% characters long^%nl%
        ^!Set %Jo1%=^$StrCopy(^%addy%;^%lim%;1)$^%nl%

        > My next obstacle is matching each character in some way to a
        > list of ascii char codes and substituting the code for the char,
        > but Im on it!

        Try ^$GetSelection$, ^$GetSelSize$, and ^$StrPos(...)$ I sent and
        your looooong list of characters to check against.

        Später,
        Jody Adair

        I can only please one person a day.
        Today is obviously not your day.
        Tomorrow does not look good either. :-)
        http://www.sureword.com/sojourner/

        ------------------------------------------------------------------------
        eGroup home: http://www.eGroups.com/group/ntb-clips
        http://www.eGroups.com - Simplifying group communications
      • Jody
        Hi Alan, ... Try ^$GetSelection$, ^$GetSelSize$, and ^$StrPos(...)$ I sent and your looooong list of characters to check against. What I was thinking you could
        Message 3 of 3 , Apr 29, 1999
          Hi Alan,

          >H="Getword test

          > My next obstacle is matching each character in some way to a
          > list of ascii char codes and substituting the code for the char,
          > but Im on it!

          Try ^$GetSelection$, ^$GetSelSize$, and ^$StrPos(...)$ I sent
          and your looooong list of characters to check against.

          What I was thinking you could do with that is get each character
          one at a time and the check it with ^!IfSame "" "" DoThis else
          Next.

          However, I think this is a faster approach. If you look in my
          Note Page Maker under Extra Stuff there is a web form converter
          that you could just replace with the code you need.

          Make a copy of it and see the section of the clip that looks like
          this (I believe it is hex <g> changing with your codes:

          ^!Replace "%2C" >> "," WAST
          ^!Replace "%2F" >> "/" WAST
          ^!Replace "%3A" >> ":" WAST
          ^!Replace "%3B" >> ";" WAST

          You will have to add your printed comments in after and also
          reverse the find & replace above have it find the text first and
          replace with the ascii code.

          Eric also has one in his Utility or SampleCode; I forget which.
          He uses a different method. One is a tad bit faster than the
          other.


          Später,
          Jody Adair

          I can only please one person a day.
          Today is obviously not your day.
          Tomorrow does not look good either. :-)
          http://www.sureword.com/sojourner/

          ------------------------------------------------------------------------
          eGroup home: http://www.eGroups.com/group/ntb-clips
          http://www.eGroups.com - Simplifying group communications
        Your message has been successfully submitted and would be delivered to recipients shortly.