home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tot5.zip / DEMLS6.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  1KB  |  70 lines

  1. program DemoList6;
  2. {demls6 - displaying a list message}
  3.  
  4. Uses DOS, CRT,
  5.      totFAST, totLINK, totLIST, totSTR, totMSG;
  6.  
  7. Var
  8.    ListWin:  ListLinkObj;
  9.    ItemList: StrDLLOBJ;
  10.    FileOK: boolean;
  11.  
  12. {$F+}
  13. function MsgHook(HiPick:longint):string;
  14. {}
  15. begin
  16.    MsgHook := 'The Hi Pick is '+IntToStr(HiPick);
  17. end; {MsgHook}
  18. {$F-}
  19.  
  20. procedure LoadLinkedList;
  21. {}
  22. var 
  23.   F: text;
  24.   Line:string;
  25.   Result: integer;
  26. begin
  27.    with ItemList do
  28.    begin
  29.       Init;
  30.       {$I-}
  31.       Assign(F,'demls4.txt');
  32.       Reset(F);
  33.       {$I+}
  34.       FileOK := (IOResult = 0);
  35.       if not FileOK then
  36.          Result := Add('File not found')
  37.       else
  38.       begin
  39.          while not eof(F) do
  40.          begin
  41.             Readln(F,Line);
  42.             Result := Add(Line);
  43.          end;
  44.          close(F);
  45.       end;
  46.    end;
  47. end; {LoadLinkedList}
  48.  
  49. begin
  50.    Screen.Clear(white,'░'); {paint the screen}
  51.    LoadLinkedList;
  52.    with ListWin do
  53.    begin
  54.       Init;
  55.       AssignList(ItemList);
  56.       SetColWidth(15);
  57.       SetMsgHook(MsgHook);
  58.       Win^.SetTitle(' A List With Messages ');
  59.       Win^.SetSize(20,5,60,20,2);
  60.       Win^.SetMinSize(20,7);
  61.       if not FileOk then
  62.          SetTagging(false);
  63.       Go;
  64.       Done;
  65.    end;
  66.    ItemList.Done;
  67. end.
  68.  
  69.  
  70.