LISTWRIT.MOD 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. IMPLEMENTATION MODULE ListWrite;
  2. (*
  3. * REPERTOIRE
  4. * Release 1.6
  5. * By Charles Bradford and Cole Brecheen
  6. * (c) Copyright 1985-1992 PMI
  7. * Green Bay, Wisconsin
  8. * All rights reserved
  9. * (414) 468-6040
  10. *
  11. * $Header: D:/logfiles/mods/listwrit.mov 1.5 10 Mar 1991 15:29:04 coleb $
  12. *
  13. *)
  14. IMPORT Editor;
  15. IMPORT GenLists;
  16. IMPORT Numbers;
  17. IMPORT ScrnTypes;
  18. IMPORT StrConv;
  19. IMPORT SYSTEM;
  20. IMPORT WindowPrims;
  21. VAR
  22. Initialized : BOOLEAN;
  23. PROCEDURE Init();
  24. BEGIN
  25. IF Initialized THEN
  26. RETURN;
  27. ELSE
  28. Initialized := TRUE;
  29. END;
  30. Editor.Init();
  31. GenLists.Init();
  32. Numbers.Init();
  33. ScrnTypes.Init();
  34. StrConv.Init();
  35. WindowPrims.Init();
  36. END Init;
  37. PROCEDURE ShowList(TheList : GenLists.GenList);
  38. CONST
  39. col1 = 40;
  40. row1 = 2;
  41. VAR
  42. SavedScreen : WindowPrims.ScreenType;
  43. LineSize, dumtype, maxlength, BottomEdRow, TextRow1, CursorCol,
  44. CursorRow : CARDINAL;
  45. dumint : INTEGER;
  46. dumadr : SYSTEM.ADDRESS;
  47. TmpList : GenLists.GenList;
  48. ChangeMade, OldDoCounting : BOOLEAN;
  49. DummyFrame: ScrnTypes.DisplayFrame;
  50. BEGIN
  51. DummyFrame := NIL;
  52. OldDoCounting := Editor.DoCounting;
  53. Editor.DoCounting := FALSE;
  54. maxlength := 10;
  55. BottomEdRow := 1;
  56. WHILE BottomEdRow<=GenLists.ListLength(TheList) DO
  57. GenLists.GetElmtAdr(TheList, BottomEdRow, dumadr, LineSize, dumtype);
  58. IF LineSize>maxlength THEN
  59. maxlength := LineSize;
  60. END;
  61. INC(BottomEdRow);
  62. END;
  63. BottomEdRow := Numbers.Between(5,BottomEdRow,15);
  64. maxlength := Numbers.Between(10,maxlength,35);
  65. WindowPrims.ScreenSave(SavedScreen, col1, row1, maxlength+col1, BottomEdRow+
  66. row1);
  67. GenLists.CopyList(TheList, TmpList);
  68. TextRow1 := 1;
  69. CursorCol := 1;
  70. CursorRow := 1;
  71. dumint := Editor.ScrnEdit(col1,row1,maxlength,BottomEdRow,TmpList,
  72. TextRow1,CursorCol,CursorRow, ChangeMade, TRUE,
  73. DummyFrame);
  74. GenLists.DisposeList(TmpList);
  75. WindowPrims.ScreenRestore(SavedScreen, col1, row1);
  76. Editor.DoCounting := OldDoCounting;
  77. END ShowList;
  78. BEGIN
  79. Initialized := FALSE;
  80. Init();
  81. END ListWrite.