-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherro.pas
More file actions
76 lines (67 loc) · 2.21 KB
/
erro.pas
File metadata and controls
76 lines (67 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
unit Erro;
{$mode objfpc}{$H+}{$codepage utf8}
interface
uses
Classes, SysUtils;
const
PARAM_REQUER_M = 1;
PARAM_INVALIDO_M = 2;
PARAM_REQUER_I = 3;
PARAM_INVALIDO_I = 4;
PARAM_INVALIDO_U = 5;
PARAM_INVALIDOS = 6;
function DLL(
codigo: integer;
silent: Boolean = False
) : UTF8String;
function code(
codigo: integer;
silent: Boolean = False
) : UTF8String;
implementation
function DLL(codigo: integer; silent: Boolean = False) : UTF8String;
var
msg: UTF8String;
begin
result := '';
if silent then Exit();
case codigo of
-1: msg := 'Não foi possível estabelecer comunicação com o relógio.';
0: Exit();
1: msg := 'BCC recebido não confere com BCC calculado.';
2: msg := 'Hora desejada (enviada pelo PC) não constitui uma hora válida.';
3: msg := 'Parâmetro e/ou Tamanho e/ou Flag/Error não suportados.';
4: msg := 'O Comando enviado não é suportado ou é desconhecido.';
5: msg := 'Erro não especificado.';
8: msg := 'Não foi encontrado um funcionário com o PIS solicitado.';
10: msg:= 'Identificador (cpf/cnpj/pis) inconsistente.';
11: msg:= 'Identificador (cpf/cnpj/pis) recusado.';
12: msg:= 'Código recusado.';
13: msg:= 'Espaço insuficiente.';
96: msg:= 'O Frame recebido contém erro.';
end;
if msg <> '' then result := msg else result := 'Desconhecido';
end;
function code(codigo: integer; silent: Boolean = False) : UTF8String;
var
msg: UTF8String;
begin
result := '';
if silent then Exit();
case codigo of
PARAM_REQUER_M: msg :=
'Falta parametro modelo -m ou --modelo=';
PARAM_INVALIDO_M: msg :=
'Modelo invalido';
PARAM_REQUER_I: msg :=
'Falta parametro IP -i ou --ip=';
PARAM_INVALIDO_I: msg :=
'IP invalido';
PARAM_INVALIDO_U: msg :=
'Parametro "ultimo" invalido';
PARAM_INVALIDOS: msg :=
'Parametros incorretos detectados, leia a ajuda usando -h ou --help."';
end;
result := msg + '\r\n';
end;
end.