/packages/amunits/examples/getmultifiles.pas

https://github.com/slibre/freepascal · Pascal · 47 lines · 30 code · 8 blank · 9 comment · 1 complexity · d83b71a59afef3b8dbd661a0c80d831c MD5 · raw file

  1. program asltest;
  2. uses exec,easyasl, linklist, strings, amigautils;
  3. {
  4. How to get more files than one with easyasl.
  5. Just remeber that you have to use linklist and
  6. not an ordinary list.
  7. 24 Jan 2000.
  8. nils.sjoholm@mailbox.swipnet.se
  9. }
  10. VAR
  11. pdummy : array [0..108] of char;
  12. path : PChar;
  13. dummy : boolean;
  14. mylist : pList;
  15. mynode : pFPCNode;
  16. temp : Longint;
  17. begin
  18. path := @pdummy;
  19. CreateList(mylist);
  20. StrpCopy(path,'sys:');
  21. dummy := GetMultiAsl('test of getmulti',path,mylist,nil,nil);
  22. If dummy then begin
  23. writeln;
  24. writeln('Number of files picked ',NodesInList(mylist));
  25. writeln('And the winner are:');
  26. PrintList(mylist);
  27. writeln(chr(10) + 'Press Return' + chr(10));
  28. readln;
  29. writeln('And now path plus file');
  30. mynode := GetFirstNode(mylist);
  31. FOR temp := 1 TO NodesInList(mylist) DO BEGIN
  32. writeln(PathAndFile(path,GetNodeData(mynode)));
  33. mynode := GetNextNode(mynode);
  34. END;
  35. end else writeln('You didn''t pick any files');
  36. DestroyList(mylist);
  37. END.