
25/01/2005, 12:27
|
 | | | Fecha de Ingreso: mayo-2004 Ubicación: Lucentum
Mensajes: 6.192
Antigüedad: 21 años Puntos: 74 | |
Bueno, este codigo debe tener como un lustro pero funciona y supongo que te servira para guiarte:
Código:
Function UltimaSilaba(Data As String) As String
On Error Resume Next
For a = 1 To Len(Data)
If EsVocal(Mid(Data, Len(Data) - a, 1)) = True And EsVocal(Mid(Data, Len(Data) - a - 1, 1)) = True Then
If Debil(Mid(Data, Len(Data) - a, 1)) = False And Debil(Mid(Data, Len(Data) - a - 1, 1)) = False Then
UltimaSilaba = Right(Data, a + 1)
Exit Function
End If
End If
If EsVocal(Mid(Data, Len(Data) - a, 1)) = False And EsVocal(Mid(Data, Len(Data) - a - 1, 1)) = True Then
UltimaSilaba = Right(Data, a + 1)
Exit Function
End If
Next
End Function
Function UltimaVocal(Data As String) As String
On Error Resume Next
Dim TempA As Integer
For a = 0 To Len(Data) - 1
If EsVocal(Mid(Data, Len(Data) - a, 1)) = True And EsVocal(Mid(Data, Len(Data) - a + 1, 1)) = False Then
TempA = a + 1
End If
Next
UltimaVocal = Right(Data, TempA)
End Function
Function EsVocal(Letra As String) As Boolean
On Error Resume Next
If LCase(Letra) = "a" Then EsVocal = True
If LCase(Letra) = "e" Then EsVocal = True
If LCase(Letra) = "i" Then EsVocal = True
If LCase(Letra) = "o" Then EsVocal = True
If LCase(Letra) = "u" Then EsVocal = True
If LCase(Letra) = "á" Then EsVocal = True
If LCase(Letra) = "é" Then EsVocal = True
If LCase(Letra) = "í" Then EsVocal = True
If LCase(Letra) = "ó" Then EsVocal = True
If LCase(Letra) = "ú" Then EsVocal = True
End Function
Function EsVocalAcentuada(Letra As String) As Boolean
On Error Resume Next
If LCase(Letra) = "á" Then EsVocalAcentuada = True
If LCase(Letra) = "é" Then EsVocalAcentuada = True
If LCase(Letra) = "í" Then EsVocalAcentuada = True
If LCase(Letra) = "ó" Then EsVocalAcentuada = True
If LCase(Letra) = "ú" Then EsVocalAcentuada = True
End Function
Function Debil(Letra As String) As Boolean
On Error Resume Next
If LCase(Letra) = "u" Then Debil = True
If LCase(Letra) = "i" Then Debil = True
If LCase(Letra) = "ú" Then Debil = True
If LCase(Letra) = "í" Then Debil = True
End Function
__________________ ¡Peron cumple, Evita dignifica! VIVA PERON CARAJO
Última edición por Eternal Idol; 25/01/2005 a las 12:31 |