|
-
May 31st, 2000, 02:57 AM
#1
Thread Starter
transcendental analytic
(as i have vb5 and not vb6)
Split
Join
Rinstr (the opposite to instr)
Replace
Thanks
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 31st, 2000, 03:01 AM
#2
Hyperactive Member
Ooh come on man! Those functions are cake to implement.
-
May 31st, 2000, 03:03 AM
#3
Addicted Member
go to the msdn site and do a search on vb 6 string functions.
they have replacements for them there.
-
May 31st, 2000, 03:23 AM
#4
Thread Starter
transcendental analytic
i hate searching in big sites, can anyone give me a link
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 31st, 2000, 03:32 AM
#5
What's Rinstr? I thought the opposite was called InstrRev
-
May 31st, 2000, 03:36 AM
#6
I went looking for a link and found one. They are pretty easy to find.
http://support.microsoft.com/support.../Q188/0/07.ASP
-
May 31st, 2000, 03:47 AM
#7
Thread Starter
transcendental analytic
yeah yeah yeah, meg, i wasn't sure, I though it was like "Right instr", ok, thanks for the link meg
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 31st, 2000, 03:58 AM
#8
Now you can add it to your template directory. That's what I did. I just saved the module as VB6 Functions and put it in the module template directory.
-
May 31st, 2000, 04:10 AM
#9
Try these, I think I got them all:
Code:
Public Function Split(Expression As String, Optional Delimiter) As Variant
Dim aSections() As String
Dim sTemp As String
Dim nPos As Long
sTemp = Expression
ReDim aSections(0)
nPos = InStr(sTemp, Delimiter)
Do
nPos = InStr(sTemp, Delimiter)
If nPos Then
aSections(UBound(aSections)) = Left(sTemp, nPos - 1)
Else
aSections(UBound(aSections)) = sTemp
End If
ReDim Preserve aSections(UBound(aSections) + 1)
sTemp = Mid(sTemp, nPos + Len(Delimiter))
Loop While nPos
If UBound(aSections) Then
ReDim Preserve aSections(UBound(aSections) - 1)
Split = aSections
Else
Split = Array()
End If
End Function
Public Function Join(SourceArray, Optional Delimiter) As String
If IsMissing(Delimiter) Then Delimiter = ""
Dim sTemp As String
Dim nIndex As Long
If InStr(LCase(TypeName(SourceArray)), "()") Then
For nIndex = LBound(SourceArray) To UBound(SourceArray)
sTemp = sTemp & SourceArray(nIndex) & Delimiter
Next
End If
Join = Left(sTemp, Len(sTemp) - Len(Delimiter))
End Function
Public Function InStrRev(StringCheck As String, StringMatch As String, Optional Start As Long = -1) As Long
Dim sTemp As String
Dim nChar As Long
Dim nPos As Long
sTemp = Space(Len(StringCheck))
For nChar = 0 To Len(StringCheck) - 1
Mid(sTemp, nChar + 1, 1) = Mid(StringCheck, Len(StringCheck) - nChar, 1)
Next
If Start <= Len(StringCheck) Then
nPos = InStr(IIf(Start = -1, 1, Len(StringCheck) + 1 - Start), sTemp, StringMatch)
End If
InStrRev = IIf(nPos, (Len(StringCheck) + 1) - nPos, 0)
End Function
Public Function Replace(Expression As String, Find As String, ReplaceWith As String, Optional Start As Long = 1, Optional Count As Long = -1) As String
Dim sTemp As String
Dim sNew As String
Dim nChar As Long
Dim nPos As Long
Dim nBegPos As Long
Dim nCount As Long
sTemp = Mid(Expression, Start)
sNew = Left(Expression, Start - 1)
nPos = Start - 1
Do
nPos = InStr(sTemp, Find)
If nPos Then
nCount = nCount + 1
sNew = sNew & Left(sTemp, nPos - 1) & ReplaceWith
sTemp = Mid(sTemp, nPos + Len(Find))
End If
Loop While nPos <> 0 And (nCount < Count And Count > 0)
Replace = sNew & sTemp
End Function
-
May 31st, 2000, 07:03 AM
#10
Thread Starter
transcendental analytic
Thanks, Aaron, but that link worked too. Hey, you seem to able to answer me on my qwestions about file types:
http://forums.vb-world.net/showthrea...threadid=18078
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
May 31st, 2000, 07:06 AM
#11
In my 1.11 years here, I have never seen him ask a question, only answer questions (with great detail too).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|