decoding control characters from serial port

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
tcbcats
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 27
Joined: Tue May 06, 2008 5:33 am
Contact:

decoding control characters from serial port

Post by tcbcats » Fri Feb 10, 2012 5:39 pm

I need to receive and transmit control chrs (01,04 03 etc. In Hex). Are there any examples on how to detect or parse out or add these non printable chrs to my received or transmit strings?
The text message windows seem to show these but they are just little squares. I need to use these characters in my application to do terminal emulation.
The only control chr I see is the EOF but this is not using the EOF real control character.

Thanks,
tcbcats
tcbcats

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: decoding control characters from serial port

Post by mwieder » Fri Feb 10, 2012 6:38 pm

Something like

Code: Select all

switch chartonum(tChar)
   case 1
      -- do something with char 0x01 here
      break
   case 3
      -- do something with char 0x03 here
      break
   case 4
      -- do something with char 0x04 here
      break
   default
end switch
seems like it oughta do the trick...

Post Reply