unit imprime; interface uses DOS,crt,variavel,graph,inicial; procedure imprimir_j; procedure verifica_imp; procedure erro_imp; var valor:integer; implementation {****************************************************************************} {****************************************************************************} {***************************verifica_imp*************************************} {****************************************************************************} {****************************************************************************} procedure verifica_imp; var regs : Registers; begin regs.ah := 2; regs.dx := 0; Intr($17,regs); valor:=regs.ah; if valor=16 then valor:=0 else if valor=24 then valor:=4 else if valor=48 then valor:=2 else if valor=56 then valor:=1 else if valor=144 then valor:=0 else if valor=216 then valor:=2; end; {****************************************************************************} {****************************************************************************} {**************************imprimir_j****************************************} {****************************************************************************} {****************************************************************************} procedure imprimir_j; var imp,fich: text; t_lido:string; i:integer; result:word; begin verifica_imp; if valor=0 then begin assign(fich,'jogador.dat'); reset(fich); assign(imp,'prn'); rewrite(imp); i:=1; end; verifica_imp; if valor=0 then begin writeln(imp,''); end; verifica_imp; if valor=0 then begin writeln(imp,''); end; if valor=0 then begin while not Eof(fich) do begin verifica_imp; if valor=0 then begin writeln(imp,'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'); verifica_imp; if valor=0 then begin writeln(imp,'º º'); verifica_imp; if valor=0 then begin writeln(imp,'º º'); verifica_imp; if valor=0 then begin writeln(imp,' Ficha de Incri‡ao N§',i); verifica_imp; if valor=0 then begin writeln(imp,''); readln(fich,t_lido); verifica_imp; if valor=0 then begin write(imp,' Nr.§ : ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin write(imp,' Clube: ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin writeln(imp,' Categoria : ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin writeln(imp,' Nome : ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin writeln(imp,' Morada: ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin writeln(imp,' Cod. Postal : ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin writeln(imp,' Localidade : ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin writeln(imp,' Nr.§ Telef. : ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin write(imp,' Profiss„o : ',t_lido,' '); readln(fich,t_lido); verifica_imp; if valor=0 then begin writeln(imp,' Telef.Emp. : ',t_lido,' '); verifica_imp; if valor=0 then begin writeln(imp,'º º'); verifica_imp; if valor=0 then begin writeln(imp,'º Federa‡Æo Portuguesa de Minigolf JPRS º'); verifica_imp; if valor=0 then begin writeln(imp,'ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ'); verifica_imp; if valor=0 then begin writeln(imp,''); verifica_imp; if valor=0 then begin writeln(imp,''); verifica_imp; if valor=0 then begin writeln(imp,'- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -'); verifica_imp; if valor=0 then begin writeln(imp,''); verifica_imp; if valor=0 then begin writeln(imp,''); i:=i+1; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; end; verifica_imp; if valor<>0 then begin erro_imp; end else if valor=0 then begin close(imp); close(fich); end; end; {****************************************************************************} {****************************************************************************} {****************************erro_imp****************************************} {****************************************************************************} {****************************************************************************} procedure erro_imp; begin Size1 := ImageSize(400, 25, 600, 200); GetMem(P1, Size1); GetImage(400, 25, 600, 200,P1^); botao(401, 26, 599, 99,4); setcolor(15); if valor=1 then outtextxy(420,40,' Falta de papel') else if valor=2 then outtextxy(415,40,'Impressora desligada') else if valor=3 then outtextxy(412,40,'A preparar impressora') else if valor=4 then outtextxy(420,40,' NÆo est  preparada'); setcolor(14); outtextxy(405,70,'Prima a barra de espa‡os'); outtextxy(405,80,' para continuar '); repeat if keypressed then begin tecl1:=readkey; end; until tecl1=space; Putimage(400, 25,P1^,0); FreeMem(P1, Size1); end; end.