{função retorna as iniciais de uma String. Ex: 'Saída por Consumo' vai retornar SPC}
function retornaIniciais(x: String): String; var
i:Integer;
aux:String;
iniciais:String; begin
iniciais:='';
aux:=Trim(x); if aux<>'' then begin
iniciais:=MidStr(aux,1,1);
i:=AnsiPos(' ',aux); while i>0 do begin
iniciais:=iniciais+MidStr(aux,i+1,1);
aux:=midstr(aux,1,i-1)+MidStr(aux,i+1,length(aux));
i:=AnsiPos(' ',aux); end;//while i>0 then end;//if aux<>'' then
Result:=UpperCase(iniciais); end;