A funcao abaixo, logo no uso da variavel result no case, no delphi 2007, com o plugin da DDevExtension, acusa que a função nao tem retorno. Realmente, existe um teste da variavel result no case, mas comentaram o codigo onde a mesma estava sendo inicializada.
A verificar:
function TInfEvento.getcOrgao: integer;
// (AC,AL,AP,AM,BA,CE,DF,ES,GO,MA,MT,MS,MG,PA,PB,PR,PE,PI,RJ,RN,RS,RO,RR,SC,SP,SE,TO);
// (12,27,16,13,29,23,53,32,52,21,51,50,31,15,25,41,26,22,33,24,43,11,14,42,35,28,17);
begin
// Result := StrToInt(copy(FChave, 1, 2));
if FTpEvento = teEPEC then
begin
case Result of
11, // Rondônia
12, // Acre
13, // Amazonas
14, // Roraima
15, // Pará
16, // Amapá
17, // Tocantins
21, // Maranhão
22, // Piauí
23, // Ceará
24, // Rio Grande do Norte
25, // Paraibá
27, // Alagoas
28, // Sergipe
29, // Bahia
31, // Minas Gerais
32, // Espirito Santo
33, // Rio de Janeiro
41, // Paraná
42, // Santa Catarina
43, // Rio Grande do Sul
52, // Goiás
53: // Distrito Federal
Result := 35;
26, // Pernanbuco
35, // São Paulo
50, // Mato Grosso do Sul
51: // Mato Grosso
Result := 43;
end;
end
else begin
// Alterado por Italo em 03/10/2013
if FcOrgao <> 0 then
Result := FcOrgao
else
Result := StrToIntDef(copy(FChave, 1, 2), 0);
if Result = 0 then
raise EventoException.Create('Campo cOrgao não informado.');
// Estados que utilizam a SVAN: ES, MA, PA, PI, RN Devem utilizar 91
// if Result in [32, 21, 15, 22, 24] then
// Result := 91;
end;
end;