home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 6 Unleashed…sional Reference Edition) / Visual_Basic_6_Unleashed_Professional_Reference_Edition_Sams_1999.iso / Source / CHAP29 / 309X3208.TXT < prev    next >
Encoding:
Text File  |  1998-05-05  |  465 b   |  20 lines

  1.  
  2. Private Function FixSectionName(sOldName As String) As String
  3.  
  4. Dim strNewName As String
  5.  
  6. ' Remove the [brackets] around the section name
  7. ' field. The Windows API functions add the brackets
  8. ' for you.
  9. If Left$(sOldName, 1) = "[" Then
  10.     strNewName = Mid$(sOldName, 2)
  11. Else
  12.     strNewName = sOldName
  13. End If
  14. If Right$(sOldName, 1) = "]" Then
  15.     strNewName = Left$(strNewName, Len(strNewName) - 1)
  16. End If
  17. FixSectionName = strNewName
  18.  
  19. End Function
  20.