FIRST.MOD 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. MODULE first;
  2. FROM Sounds IMPORT Sound, NoSound;
  3. FROM Delay IMPORT Delay;
  4. FROM TTextIO
  5. IMPORT ReadInt, ReadCard, ReadChar, ReadString, ReadLn, ReadBuffer,
  6. WriteInt, WriteCard, WriteChar, WriteString, WriteBool, WriteLn,
  7. Eoln, SeekEof, SeekEoln;
  8. FROM TKernelIO
  9. IMPORT File, FileType, OptionMode,
  10. StatusProc, ReadProc, WriteProc, ErrorProc,
  11. stdinout, input, output, con, trm, kbd, lst, aux, usr,
  12. conStPtr, conInPtr, auxInPtr, usrInPtr, conOutPtr, lstOutPtr,
  13. auxOutPtr, usrOutPtr, errorPtr, IOresult, KeyPressed, IOBuffer,
  14. IOCheck, DeviceCheck, CtrlC, InputFileBuffer, OutputFileBuffer;
  15. (* Program to demonstrate simple constant translation *)
  16. CONST
  17. Version = 1;
  18. SubVersion = 0;
  19. Product = 'Turbo Translator';
  20. Bell = 7C; (* Bell hex code *)
  21. PROCEDURE Siren;
  22. VAR
  23. Frequency: INTEGER;
  24. BEGIN
  25. FOR Frequency := 500 TO 2000 DO
  26. Delay(1);
  27. Sound(Frequency);
  28. END;
  29. FOR Frequency := 2000 TO 500 BY -1 DO
  30. Delay(1);
  31. Sound(Frequency);
  32. END;
  33. NoSound;
  34. END Siren;
  35. BEGIN
  36. WriteLn(stdinout);
  37. WriteLn(stdinout);
  38. WriteString(stdinout, 'Welcome to ', 0);
  39. WriteString(stdinout, Product, 0);
  40. WriteString(stdinout, ' version ', 0);
  41. WriteInt(stdinout, Version, 0);
  42. WriteChar(stdinout, '.', 0);
  43. WriteInt(stdinout, SubVersion, 0);
  44. WriteLn(stdinout);
  45. WriteString(stdinout, Bell, 0);
  46. WriteString(stdinout, Bell, 0);
  47. WriteString(stdinout, Bell, 0);
  48. WriteString(stdinout, Bell, 0);
  49. WriteLn(stdinout);
  50. WriteString(stdinout, "The Programmers' time saver", 0);
  51. WriteLn(stdinout);
  52. Siren;
  53. END first.