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

  1. program DemoList5;
  2. {demls5 - selecting all tagged items}
  3.  
  4. Uses DOS, CRT,
  5.      totFAST, totLINK, totLIST;
  6.  
  7. Var
  8.    ListWin:  ListLinkObj;
  9.    ItemList: StrDLLOBJ;
  10.    FileOK: boolean;
  11.    L,Total: longint;
  12.  
  13. procedure LoadLinkedList;
  14. {}
  15. var 
  16.   F: text;
  17.   Line:string;
  18.   Result: integer;
  19. begin
  20.    with ItemList do
  21.    begin
  22.       Init;
  23.       {$I-}
  24.       Assign(F,'demls4.txt');
  25.       Reset(F);
  26.       {$I+}
  27.       FileOK := (IOResult = 0);
  28.       if not FileOK then
  29.          Result := Add('File not found')
  30.       else
  31.       begin
  32.          while not eof(F) do
  33.          begin
  34.             Readln(F,Line);
  35.             Result := Add(Line);
  36.          end;
  37.          close(F);
  38.       end;
  39.    end;
  40. end; {LoadLinkedList}
  41.  
  42. begin
  43.    Screen.Clear(white,'░'); {paint the screen}
  44.    LoadLinkedList;
  45.    with ListWin do
  46.    begin
  47.       Init;
  48.       AssignList(ItemList);
  49.       SetColWidth(15);
  50.       Win^.SetTitle(' Items from file DEMLS4.TXT ');
  51.       Win^.SetSize(20,5,60,20,1);
  52.       if not FileOk then
  53.          SetTagging(false);
  54.       Go;
  55.       Remove;
  56.       Total := ItemList.TotalNodes;
  57.       clrscr;
  58.       for L := 1 to Total do
  59.          if GetStatus(L,0) then
  60.             Writeln('Selected: ',GetString(L,0,0));
  61.       Done;
  62.    end;
  63.    ItemList.Done;
  64. end.
  65.  
  66.  
  67.