1 Program ModeList;
2 
3 
4 { ***********************************************************************
5   * This is example shows how to use p96AllocModeListTagList()
6   *
7   * tabt (Sat Dec 28 03:44:35 1996)
8   *********************************************************************** }
9 
10 {
11     Translated to fpc pascal.
12     2 Mars 2001.
13 
14     Updated for fpc 1.0.7
15     08 Jan 2003.
16 
17     nils.sjoholm@mailbox.swipnet.se
18 }
19 
20 uses exec, amigados, picasso96api, utility;
21 Const
22     template    :   pchar  =   'Width=W/N,Height=H/N,Depth=D/N';
23     vecarray    :   Array[0..2] of long = (0,0,0);
24 
25 Var
26     ml          :   pList;
27     width,
28     height,
29     depth       :   longint;
30     rda         :   pRDArgs;
31     mn          :   pP96Mode;
32 
33 Begin
34   if not Assigned(P96Base) then
35   begin
36     writeln('Cannot open ', PICASSO96APINAME);
37     Halt(5);
38   end;
39   width:=640;
40   height:=480;
41   depth:=8;
42 
43   rda:=ReadArgs (template,@vecarray,Nil);
44   If rda<>Nil Then Begin
45       If vecarray[0] <> 0 then width := long(@vecarray[0]);
46       If vecarray[1] <> 0 then height := long(@vecarray[1]);
47       If vecarray[2] <> 0 then depth := long(@vecarray[2]);
48       FreeArgs(rda);
49   End;
50 
51   ml:=p96AllocModeListTags([P96MA_MinWidth, width,
52                             P96MA_MinHeight, height,
53                             P96MA_MinDepth, depth,
54                             TAG_DONE]);
55 
56   If ml<>Nil Then Begin
57      mn := pointer(ml^.lh_Head);
58      If mn <> Nil Then Begin
59         While mn^.Node.ln_Succ <> Nil Do Begin
60             Writeln (mn^.Description);
61             mn := pointer(mn^.Node.ln_Succ);
62         End;
63      End;
64      p96FreeModeList(ml);
65   End Else
66      Writeln ('Unable to allocate list.');
67 End.
68