???? ID: 168799 - ????? ???????: 03 ?????? 2010 - ??????: 4.0

?????? ??????? ??? ?? ??????? ?? ??? ?? ????? ???? ?? ??? ???? ????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

?? ???? 6 ?? ????? ??? ?? ??????? ?? ??? ?? ?????? ?? ?? ????? ???? ?? ??? ?? ????????? ?????? ???? ??:
   Title                (Mr., Ms., etc.)
   First Name
   Middle Initial(s)
   Last Name
   Pedigree             (Jr., Sr., III, etc.)
   Degree(s)            (B.S., PhD, etc.)
				

???? ???????

???????: ???? ?? ????? ?? ?? ?? ???? ??? ??? ?? ???/?????? ?? ???? ????? ??? Microsoft ???? ?? ??????, ?? ?? ?????? ?? ???????, ?????? ?? ?????? ??/?? ???? ????? ???????? ?? ??? ????????? ???? ?? ??? ????? ???? ????? ???? ?? ?????? ?? ???? ?? ???/?????? "???? ??" ?????? ????? ???

????? ???:, ????? ????? ??? ??? ??? ?????? ?? ??? ??? ?? ????????? (_) ????? ??? ?? ?? ???? ?? ?????? ?? ???????? ?? ??? ???? ?? ????????? ?? ??? ?????? ???? ?? ???????? ?????? ?? ?????? ? ???? ????, ??????? ????????? ????? ?????? ?? ??? ???? ?? ?????? ?? ??? ?? ?? ?? ??? re-creating.

????? ????? ??? ?? ????? ???? ??? ??? ?? ????? ???? ??:
??????-(??? ????? ???? ?? ???? ?????? ?? ???? ?? ??? ???? ??)
???-(anything ??? ???? ?????????)
Pedigree-(??? ????? ???? ???? pedigrees ?? ???? ?? ??? ???? ??)
??? ?? ?????-(?????? ???? ???? ?????, ????? hyphenated ?? ???? ???)
????? ???-(???? ???? ????? ?????????)
???? Initial(s)-(???)

Step-by-Step ??????

  1. ????? ??? ???? ????:
          Function CutLastWord (ByVal S As String, Remainder As String) _
              As String
          ' CutLastWord: returns the last word in S.
          ' Remainder: returns the rest.
          '
          ' Words are separated by spaces
          '
          Dim  I As Integer, P As Integer
            S = Trim$(S)
            P = 1
            For I = Len(S) To 1 Step -1
              If Mid$(S, I, 1) = " " Then
                P = I + 1
                Exit For
              End If
            Next I
            If P = 1 Then
              CutLastWord = S
              Remainder = ""
            Else
              CutLastWord = Mid$(S, P)
              Remainder = Trim$(Left$(S, P - 1))
            End If
          End Function
    
          Function CutWord (ByVal S As String, Remainder As String) As String
          '
          ' CutWord: returns the first word in S.
          ' Remainder: returns the rest.
          '
          Dim P As Integer
            S = Trim$(S)
            P = InStr(S, " ")
            If P = 0 Then P = Len(S) + 1
            CutWord = Left$(S, P - 1)
            Remainder = Trim$(Mid$(S, P + 1))
          End Function
    
          Sub ParseName (ByVal S As String, Title As String, FName As String, _
                         MName As String, LName As String, _
                         Pedigree As String, Degree As String)
          Dim Word As String, P As Integer, Found As Integer
          Const Titles = "Mr.Mrs.Ms.Dr.Miss,Sir,Madam,Mayor,President"
          Const Pedigrees = "Jr.Sr.III,IV,VIII,IX,XIII"
            Title = ""
            FName = ""
            MName = ""
            LName = ""
            Pedigree = ""
            Degree = ""
          '
          ' Get Title
          '
            Word = CutWord(S, S)
            If InStr(Titles, Word) Then
              Title = Word
            Else
              S = Word & " " & S
            End If
          '
          ' Get Degree
          '
            P = InStr(S, ",")
            If P > 0 Then
              Degree = Trim$(Mid$(S, P + 1))
              S = Trim$(Left$(S, P - 1))
            End If
          '
          ' Get Pedigree
          '
            Word = CutLastWord(S, S)
            If InStr(Pedigrees, Word) Then
              Pedigree = Word
            Else
              S = S & " " & Word
            End If
          '
          ' Get the rest
          '
            LName = CutLastWord(S, S)   ' Last Name
            FName = CutWord(S, S)       ' First Name
            MName = Trim(S)             ' Initials/Middle Name(s)
          End Sub
    						
  2. ???????, ?? ??? ??????? (txtName txtTitle, txtFirstName, txtMI, txtLastName, txtPedigree, txtDegree) ??? ??? ????? ???, ?? ??? ???? ??? ?????? ????? ??? ??????:
          Sub Command1_Click()
          Dim Title As String, FName As String, MI As String
          Dim LName As String, Pedigree As String, Degree As String
            ParseName txtName, Title, FName, MI, LName, Pedigree, Degree
            txtTitle = Title
            txtFirstName = FName
            txtMI = MI
            txtLastName = LName
            txtPedigree = Pedigree
            txtDegree = Degree
          End Sub
    						
  3. ??????? ?????????, txtName ??? ?? ??? ???? ????, ?? ???? ??? ????? ????? ???? ?? ????? ??? ??? parsed ??? ???? ??????

???????? ???????

???? ???, ?????? ?? (???? ?????? ?? ??? ????) ??????? ?? ??? ?????:

  1. ???????? ????? Pedigree ???? ?? ???? ???? ????? ??? ???? ?? ???? ?? ????????? ????? ??? Pedigree ???? ?? ???? ?? ????????? ??, ??? ?? Degree(s) ?? ????? ??? ?? ??? ??? ???? ?????? ??? ?? ?? ????????? ?? ???? ?? ??? Pedigree ?? ?????? ???? ????? ???, ??? ?? ????? ???? (????????? ???) ???? Pedigrees ?? ???? ??? ??? ?? ?? ????? ?? ??? ?? ???????? ??? ???? ???? ???
  2. ????? ?? ????? ??? ?????? ???? ???? ?? ??? assumed ?? ??? ???? ??? ?? (??????, ???? Beth ???? ????), (???? Beth ????) ??? ?? ?? ??? ?????? ?? ????? ??? ???? ?????????/???? ??? ????? ???? ???????????, ?? ????? ?? ???? variability, ?? ???? ?? ???????? ????????? ?? ????? ??? ????? ???????
  3. ???????? ????? ????????/??????? ????? ?? ??? ??????? ???? ??? ??? ???? ?????? ???????? ??? ?? ??? ??????? ?? ???????? ?? ???? ?? ?? ????? conventions ?? ???? ???
  4. ???? ?????? ?? Pedigrees ?? ???? ParseName ??? ?? Const declarations ???????????? ?????? ?????? ????? ?? ????????? ???? ?? ???? ???
  5. ?????? ?? ??? ???? ??? ???? ?? ??????? ??? ?? ???? ?? ?? ???? ??? ???? ?? ???? ?????? ?? ????? ???? ?? ??? ??? ?? ???? ?? ??? ??? ???

???? ???? ???? ??:
  • Microsoft Visual Basic 5.0 Control Creation Edition
  • Microsoft Visual Basic 5.0 Learning Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic 4.0 Standard Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 2.0 Standard Edition
  • Microsoft Visual Basic 3.0 Professional Edition
  • Microsoft Visual Basic 2.0 Professional Edition
  • Microsoft Access 1.0 Standard Edition
  • Microsoft Access 1.1 Standard Edition
  • Microsoft Access 2.0 Standard Edition
  • Microsoft Access 97 Standard Edition
  • Microsoft Excel 97 Standard Edition
  • Microsoft Word 97 Standard Edition
  • Microsoft PowerPoint 97 Standard Edition
??????: 
kbhowto kbprogramming kbmt KB168799 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:168799  (http://support.microsoft.com/kb/168799/en-us/ )