PageRenderTime 24ms CodeModel.GetById 22ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

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