забыл про это ветку чото. Victor, у меня все пашет, проверяю в экселе, а то вб6 не стоит:
- Public Function ConvertToRus(ByVal InputVal As String) As String
-
- Dim TypeOfConvert As Integer, ConvertionMassive(1 To 2) As String, x As Integer
- TypeOfConvert = 0
- x = 1
- While x < Len(InputVal) And TypeOfConvert = 0
- If Asc(Mid(InputVal, x, 1)) > 58 And Asc(Mid(InputVal, x, 1)) < 123 Then
- TypeOfConvert = 1
- temp = 2
- ElseIf Asc(Mid(InputVal, x, 1)) > 128 And Asc(Mid(InputVal, x, 1)) < 243 Then
- TypeOfConvert = 2
- temp = 1
- End If
- Wend
- If TypeOfConvert = 0 Then ConvertTorRus = InputVal
- ConvertionMassive(1) = "éöóêåí"
- ConvertionMassive(2) = "qwerty"
- For x = 1 To Len(InputVal)
- ConvertToRus = ConvertToRus & Mid(ConvertionMassive(TypeOfConvert), InStr(1, ConvertionMassive(temp), Mid(InputVal, x, 1)), 1)
- Next x
-
- End Function
-
- Sub main()
- MsgBox ConvertToRus("qwerty")
- End Sub
запускаем main - получаем йцукен
Ответить
|