home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
ICNDRW_1
/
SOURCE
/
TESTICON.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1991-08-16
|
2KB
|
80 lines
{---------------------------------------------------------------------
Test Icon
Copyright (c) 1991 - SofDesign Technology
All Rights Reserved
This program display a bunch of icons. To use, type
TESTICON <libname> iconname
if you don't specify a libname, then an iconname is assumed.
note: you must use the extensions like such:
TESTICON icon.lib test.icn
----------------------------------------------------------------------}
Program Test_Icon;
{$X+}
{$G+}
{$R-}
{$S-}
uses crt,bgidriv,graph,icontool;
const
maxicons=255; { we'll load 400 of them. Change this for more. }
var
anicon : array[1..maxicons] of icon;
{$I grafinit.pas}
procedure main;
var i:integer;
begin
randomize;
if paramcount=0 then
begin
writeln('Well, what should I do?');
halt(255);
end;
if paramcount=1 then
anicon[1].init('',paramstr(1),1,1)
else
if paramcount>1 then
anicon[1].init(paramstr(1),paramstr(2),1,1);
if anicon[1].initerror then
begin
writeln('Oops, an error!');
halt(1);
end;
anicon[1].setput(copyput);
anicon[1].icontitle(false);
for i:=2 to maxicons do
anicon[i]:=anicon[1];
for i:=1 to maxicons do
begin
anicon[i].setxy(random(getmaxx)+1,random(getmaxy)+1);
anicon[i].showicon;
end;
repeat
for i:= maxicons downto 1 do
anicon[i].hideicon;
for i:=1 to maxicons do
begin
anicon[i].setxy(random(getmaxx)+1,random(getmaxy)+1);
anicon[i].showicon;
end;
delay(100); { slight delay so you can view the icons }
until keypressed;
anicon[1].disposeicon;
closegraph;
restorecrtmode;
end;
begin
grafinit; {initialize graphics adapter}
main;
end.