diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-06-21 13:47:44 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-06-21 13:47:44 +0000 |
commit | 7a47e72c044da7d3a41148cbb721936ca5940f06 (patch) | |
tree | babfe1af633f4971959817ec1a23ce12f55229f4 /wizards/source/tools/Strings.xba | |
parent | 9a8be587090efc901c43108091dcaa72007eba38 (diff) |
#88615# New Listbox methods inserted
Diffstat (limited to 'wizards/source/tools/Strings.xba')
-rw-r--r-- | wizards/source/tools/Strings.xba | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/wizards/source/tools/Strings.xba b/wizards/source/tools/Strings.xba index 0cedb611e23e..d43d36ec5ed7 100644 --- a/wizards/source/tools/Strings.xba +++ b/wizards/source/tools/Strings.xba @@ -42,7 +42,7 @@ Dim BigLen%, PreLen%, PostLen% BigLen = Len(BigString) PostLen = Len(PostString) FindPartString = Mid(BigString,StartPos + PreLen, EndPos - (StartPos + PreLen)) - ' Da diese Funktion daf?r programmiert wurde, in einer Schleife abgearbeitet zu werden + ' Da diese Funktion dafür programmiert wurde, in einer Schleife abgearbeitet zu werden ' muss die initiale Suchposition hinter die Position des gefundenen Teilstrings gesetzt werden. SearchPos = EndPos + PostLen Else @@ -55,6 +55,22 @@ Dim BigLen%, PreLen%, PostLen% End Function +' Note iCompare = 0 (Binary comparison) +' iCompare = 1 (Text comparison) +Function PartStringInArray(BigArray(), SearchString as String, iCompare as Integer) as Integer +Dim MaxIndex as Integer +Dim i as Integer + MaxIndex = Ubound(BigArray()) + For i = 0 To MaxIndex + If Instr(1, BigArray(i), SearchString, iCompare) <> 0 Then + PartStringInArray() = i + Exit Function + End If + Next i + PartStringInArray() = -1 +End Function + + ' Deletes the String 'SmallString' out of the String 'BigString' ' in case SmallString's Position in BigString is right at the end Function RTrimStr(ByVal BigString, SmallString as String) as String @@ -118,7 +134,11 @@ Dim StartUbound as Integer If Not IsMissing(Maxindex) Then MaxIndex = i End If - ReDim Preserve LocList(i) as String + If i <> -1 Then + ReDim Preserve LocList(i) as String + Else + ReDim LocList() as String + End If ArrayOutofString = LocList() End Function |