Re: FindFirstFile and underscore
From: Donald Lessau (don.snip_at_xbeat.snip.net)
Date: 08/10/04
- Next message: Ulrich Korndoerfer: "Re: Form scroll bar"
- Previous message: Tim Baur: "Re: Treeview searching"
- In reply to: Ulrich Korndoerfer: "Re: FindFirstFile and underscore"
- Next in thread: Ulrich Korndoerfer: "Re: FindFirstFile and underscore"
- Reply: Ulrich Korndoerfer: "Re: FindFirstFile and underscore"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 10 Aug 2004 19:43:05 +0200
"Ulrich Korndoerfer" <ulrich_wants_nospam@prosource.de> :
> > rather than test for the ASC code for the dot.
>
> BTW, this is slower (if used with VB strings) than doing a simple
> comparison using the equal operator ;-).
Sure? IsDot03 is clearly the fastest on all inputs:
Public Function IsDot01(sFile As String) As Boolean
IsDot01 = InStr("..", sFile) > 0
End Function
Public Function IsDot02(sFile As String) As Boolean
IsDot02 = Asc(sFile) = vbDot
End Function
Public Function IsDot03(sFile As String) As Boolean
IsDot03 = AscW(sFile) = vbDot
End Function
Public Function IsDot04(sFile As String) As Boolean
IsDot04 = (sFile = ".") Or (sFile = "..")
End Function
Public Function IsDot05(sFile As String) As Boolean
If LenB(sFile) < 6 Then
IsDot05 = (sFile = ".") Or (sFile = "..")
End If
End Function
Donald
- Next message: Ulrich Korndoerfer: "Re: Form scroll bar"
- Previous message: Tim Baur: "Re: Treeview searching"
- In reply to: Ulrich Korndoerfer: "Re: FindFirstFile and underscore"
- Next in thread: Ulrich Korndoerfer: "Re: FindFirstFile and underscore"
- Reply: Ulrich Korndoerfer: "Re: FindFirstFile and underscore"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|