' Standard IO functions ' ' eBASIC Example program ' www.compubotics.com ' #include "rc40.inc" ' store chars ch var byte ' standard console chars CH_LF CON 11 CH_CR CON 13 CH_ESC CON 27 Main: debug "Press ESC to end", CR ' if using the RC40 and host is expecting flow control, ' tell host we are receiving. delete next two lines if ' not using flow control. Our RTS is his CTS, and vice-versa ' for out "echo" program, we don't need anything since I can't ' type fast enough to overrun the buffer, so just tell host "OK" trisrts = 0 rts = 0 while (1) ' get next char if (inchar) then getchar ch else continue endif ' if ESC, exit if (ch = CH_ESC) then break ' echo char back to sender putchar ch ' if CR, send LF also if (ch = CH_CR) then putchar CH_LF endif wend debug CR, "Done!", cr end