Bom dia, pessoal.
Eu tenho um problema, gostaria de ler arquivo texto, contido em um diretorio específico, neste arquivo texto consta preposições (DE, DOS, DA...) e depois abrevia-las dentro da rotina.
Vejam a função que verifico e gravo o novo nome com estas preposições:
Private Function verificar_preposicao(p_str_nome As String, p_str_tipo_pessoa As String) As Boolean
On Error GoTo ErrorHandler
Dim int_contador As Integer
verificar_preposicao = False
For int_contador = 0 To UBound(preposicaoX)
If UCase(p_str_nome) = UCase(preposicaoX(int_contador)) Then
verificar_preposicao = True
If p_str_tipo_pessoa = "F" Then
p_str_nome = UCase(preposicaoX(int_contador))
Else
p_str_nome = ""
End If
Exit Function
End If
Next
Exit Function
ErrorHandler:
MsgBox Err.Description
End Function
==========================
Private Function gravar_novo_nome(p_str_novo_nome() As String, p_int_num_nomes As Integer) As String
On Error GoTo ErrorHandler
Dim int_contador As Integer
For int_contador = 0 To p_int_num_nomes
If int_contador = 0 Then
gravar_novo_nome = Trim((p_str_novo_nome(int_contador)))
Else
gravar_novo_nome = Trim(gravar_novo_nome) & " " & Trim((p_str_novo_nome(int_contador)))
End If
Next
gravar_novo_nome = Trim(gravar_novo_nome)
Exit Function
ErrorHandler:
MsgBox Err.Description
End Function
Abreviação De Preposições
Started By eninho, 01/09/2011, 09:42
Nenhuma resposta neste tópico
0 user(s) are reading this topic
0 membro(s), 0 visitante(s) e 0 membros anônimo(s)