MINITERM.MOD 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. (* Release 3.10 *)
  2. (*-------------------------------------------------------------------------*
  3. * *
  4. * MINITERM.MOD - COMMS Toolkit demonstration program *
  5. * *
  6. * COPYRIGHT (C) 1988..1992 Clarion Software Corporation. *
  7. * All Rights Reserved *
  8. * *
  9. *--------------------------------------------------------------------------*)
  10. MODULE MiniTerm;
  11. IMPORT RS232,Window,IO;
  12. CONST
  13. Port = 2;
  14. Baud = 2400;
  15. Bits = 8;
  16. Stops = 1;
  17. Parity = RS232.None;
  18. VAR
  19. c : CHAR;
  20. BEGIN
  21. Window.Clear;
  22. RS232.SelectPort(Port);
  23. RS232.InitPort(Baud,Bits,Stops,Parity);
  24. RS232.Install;
  25. LOOP
  26. WHILE RS232.SerialRead(c,0) DO (* test remote *)
  27. IO.WrChar(c);
  28. END;
  29. IF IO.KeyPressed() THEN
  30. c := IO.RdKey();
  31. IF c=0C THEN (* special key? *)
  32. c := IO.RdKey();
  33. IF c=CHR(68) THEN (* function key 10 *)
  34. EXIT;
  35. END;
  36. ELSE
  37. RS232.SerialWrite(c,1);
  38. END;
  39. END;
  40. END;
  41. RS232.UnInstall;
  42. END MiniTerm.
  43.