{
Initialize and check device.
typ=0:Silent, 1:Print, 2:Check.
}
procedure InitDevice(var ref:Integer; name:String; typ:Integer);
begin
 ref:=RefFind('Device '+Name);
 if (typ>0) and (ref <> 0) then Success('Initialized device: '+name);
 if (typ>1) and (ref =  0) then Trouble('Could not init device: '+name);
end;
