Announcement

Collapse
No announcement yet.

Serin() ASCII to string

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Serin() ASCII to string

    At the risk of rephrasing one or two questions I've already posted here. I have a serial input that will return the number 58 (this is a colon in ASCII) I notice that print([CHR]serin()) will print the colon. Is there any way that I can use something like:

    var stringOfSeveralAsciiCharacters;

    to stringOfSeveralAsciiCharacters
    print([CHR]serin());

    I want to build a string from these numeric ASCII inputs that I can then display in various parts of the screen. How do I do this? (the above code didn't seem to work).

  • #2
    Hello Mcgettrm,

    You can try using putch to input one character at a time to the string instead of using print.

    Code:
    var stringOfSeveralAsciiCharacters;
    var char;
    
    if (ch != -1) 
         char := serin();
         to (stringOfSeveralAsciiCharacters); putch(char);
    endif

    Comment


    • #3
      There are several app notes that might help http://www.4dsystems.com.au/appnotes

      http://www.4dsystems.com.au/appnote/4D-AN-00056/
      http://www.4dsystems.com.au/appnote/4D-AN-00193/
      http://www.4dsystems.com.au/appnote/4D-AN-00047/

      all add a bit of information, depending on what you are having trouble understanding
      Mark

      Comment

      Working...
      X