Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2013
    Posts
    9

    Unanswered: Transliterate numbers and letters from Text1 to Text2

    Hi ! !
    I would kindly ask for your help in the following expression problem:
    I need your help in valuable working code that I could not to manage. Can you help me someone member . Thank you very much.
    In the example attached in form there are two text boxes . In a text box, write letters or numbers and in the other text box i transliterate in Characters . My problem is that:
    1) How do I show in front of each number index number # . For example in date
    11/05/2014 I want to appear me like that: # 11 / # 05 / # 2014 .

    2 ) How can I show capital indicator in front of each word when all letters are capitalized. For example Capital indicator for English ","
    I WANT TO GO TO SCHOOL I want to appear me like that
    , I WANT ,TO ,GO ,TO ,SCHOOL In front of each word entering the Capital indicator for English ","

    *Sorry about my bad English
    Thank you
    Alexander
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    495
    Provided Answers: 24
    All characters have an ascii value
    the CAPS start at 62 (A) and end at 90 (Z)

    use this function to get the value
    asc("R") = 82

    For i = 1 to len(txtBox1)
    sLtr = mid(txtBox1,i,1)

    if asc(sLtr) >=62 and asc(sLtr) <= 90 then
    ' Its a CAPITAL
    End if
    next
    Last edited by ranman256; 05-12-14 at 11:14. Reason: format

  3. #3
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Quote Originally Posted by ranman256 View Post
    All characters have an ascii value
    the CAPS start at 62 (A) and end at 90 (Z)
    No: Asc("A") = 65 and Chr(62) = ">"

    Another (probably faster) solution would be:
    Code:
    Select Case Asc(sLtr)
        Case 65 to 90
            ' Capital letter.
        Case Else
            ' Not a capital letter.
    End Select
    Have a nice day!

  4. #4
    Join Date
    Mar 2013
    Posts
    9
    Ηι!!
    Thank you very much both of you for the quick reply . I'll try and with 2 modes although I believe that Sinndho's solution is simpler. Did someone looked second case with the indexes entering in front of each number the index (#)?
    With the code below the number (0) displays the index number starts normally but when the first number is (1) No enters in front of the number (1) the index (#) .what changes should I do in code?

    Code:
    Public Function Transliterate(strChars As String) As String
        Dim intChar As Integer, strTemp As String, lngLen As Long, x As Integer
        Dim i As Long
        lngLen = Len(strChars)
        For i = 1 To lngLen
            x = 0
            intChar = AscW(Mid(strChars, i, 1))
    
            Select Case intChar
     Case 48     'Number (0)
                    If i = lngLen Then
                    strTemp = strTemp & N_0
                   i = i + 1
                    Else
                    Select Case AscW(Mid(strChars, i + 1, 1))
                    Case 49, 50, 51, 52, 53, 54, 55, 56, 57
                    strTemp = strTemp & ΑRITHMODIKTIS & "#"
                    End Select
                   If x = 0 Then strTemp = strTemp & N_0
                    End If
                    '''''''''''''''''''''''''''''''''''''''''''
                    Case 49     'Number (1)
                    If i = lngLen Then
                    strTemp = strTemp & N_1
                   i = i + 1
                    Else
                    Select Case AscW(Mid(strChars, i + 1, 1))
                    Case 48, 50, 51, 52, 53, 54, 55, 56, 57
                    strTemp = strTemp & "#"
                    End Select
                   If x = 0 Then strTemp = strTemp & N_1
                    End If
    Thanks in advance
    Alexander

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •