TestVT100Erase.mod 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. MODULE TestVT100Erase;
  2. (* Erase: line right/left/all, screen down/up/all *)
  3. IMPORT VT100;
  4. FROM STextIO IMPORT WriteString, WriteLn;
  5. FROM Delay IMPORT Delay;
  6. BEGIN
  7. VT100.ClearScreen;
  8. VT100.CursorHome;
  9. WriteString("--- VT100 Erase test ---"); WriteLn;
  10. WriteString("Line with ClearLineRight -> garbage garbage");
  11. VT100.CursorPosition(2, 20);
  12. VT100.ClearLineRight;
  13. WriteLn;
  14. WriteString("garbage garbage <- ClearLineLeft");
  15. VT100.CursorPosition(3, 20);
  16. VT100.ClearLineLeft;
  17. WriteLn;
  18. WriteString("This line will be cleared");
  19. VT100.CursorPosition(4, 1);
  20. VT100.ClearLine;
  21. VT100.CursorPosition(4, 1);
  22. WriteString("ClearLine done");
  23. WriteLn;
  24. Delay(500);
  25. VT100.CursorPosition(10, 1);
  26. WriteString("filler below");
  27. VT100.CursorPosition(8, 1);
  28. VT100.ClearScreenDown;
  29. VT100.CursorPosition(8, 1);
  30. WriteString("ClearScreenDown done");
  31. WriteLn;
  32. VT100.CursorPosition(12, 1);
  33. WriteString("filler");
  34. VT100.CursorPosition(12, 1);
  35. VT100.ClearScreenUp;
  36. VT100.CursorPosition(12, 1);
  37. WriteString("ClearScreenUp done");
  38. WriteLn;
  39. Delay(500);
  40. VT100.ClearScreen;
  41. VT100.CursorHome;
  42. WriteString("ClearScreen done"); WriteLn;
  43. WriteString("--- end Erase ---"); WriteLn;
  44. END TestVT100Erase.