Busti Posted July 21, 2006 Author Share Posted July 21, 2006 see post above^^ My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 21, 2006 Moderators Share Posted July 21, 2006 (edited) see post above^^I did, I'm still lost... not much on guessing Edit:I ASSumed you were saying that one or both of those 2 functions were causing the double semi colon issue... I just gave a solution for that. If this is something different, then you should start a new thread. Edited July 21, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Busti Posted July 21, 2006 Author Share Posted July 21, 2006 okay thank you cheff My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Developers Jos Posted July 21, 2006 Developers Share Posted July 21, 2006 this version wil handle ;; Func _DivDub($sText, $vDelim = ';') Local $aSplit = StringSplit($sText, $vDelim) Local $sNewString $sText = $vDelim & $sText & $vDelim For $iCount = 1 To UBound($aSplit) - 1 If $aSplit[$iCount] = "" Then ContinueLoop If StringInStr($sText, $vDelim & $aSplit[$iCount] & $vDelim) Then $sText = StringReplace($sText,$aSplit[$iCount] & $vDelim, '') $iExtended = @extended If $iExtended > 1 Then $sNewString &= $aSplit[$iCount] & '*' & $iExtended & $vDelim Else $sNewString &= $aSplit[$iCount] & $vDelim EndIf EndIf Next Return StringTrimRight($sNewString, 1) EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Busti Posted July 21, 2006 Author Share Posted July 21, 2006 but what is if there are ;;; or ;;;; or ;;;;;;;;;;;;;;;; ??? My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 21, 2006 Moderators Share Posted July 21, 2006 this version wil handle ;; Func _DivDub($sText, $vDelim = ';') Local $aSplit = StringSplit($sText, $vDelim) Local $sNewString $sText = $vDelim & $sText & $vDelim For $iCount = 1 To UBound($aSplit) - 1 If $aSplit[$iCount] = "" Then ContinueLoop If StringInStr($sText, $vDelim & $aSplit[$iCount] & $vDelim) Then $sText = StringReplace($sText,$aSplit[$iCount] & $vDelim, '') $iExtended = @extended If $iExtended > 1 Then $sNewString &= $aSplit[$iCount] & '*' & $iExtended & $vDelim Else $sNewString &= $aSplit[$iCount] & $vDelim EndIf EndIf Next Return StringTrimRight($sNewString, 1) EndFuncJdeb... wouldn't just be easier to do the double delim StringReplace before the stringsplit()? Or maybe not smarter incase there are 3+... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 21, 2006 Moderators Share Posted July 21, 2006 (edited) but what is if there are ;;; or ;;;; or ;;;;;;;;;;;;;;;; ???His example covers that Busti with the ContinueLoop, min wouldn't cover more than 2 delimeters. Edit: Proof of concept: Edited July 21, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Developers Jos Posted July 21, 2006 Developers Share Posted July 21, 2006 but what is if there are ;;; or ;;;; or ;;;;;;;;;;;;;;;; ???This implies you don't understand how it works..... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Busti Posted July 21, 2006 Author Share Posted July 21, 2006 (edited) im wired sry i cant understand anything now ... Original String : DivDubbed String: BackConvertet String: is return xD €dit : sorry was an error in my function Edited July 21, 2006 by Busti My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Busti Posted July 22, 2006 Author Share Posted July 22, 2006 sorry for my doubblepost, but i found the old version of my script, and i think its funny to see what i did before, the hell much code !: expandcollapse popupFunc __FormatMultiple($__StringOrArray, $mode = 1, $ret = 1, $delim = ";"); this func is for shorter Code Local $using = $__StringOrArray Local $__test Local $ATTACK = 0, $count = 0, $changetonextloop = 0, $ranthrough = 0, $gescount = 0, $string = "" If $mode = 1 Then $_split = StringSplit($using, $delim) For $_i = 1 To $_split[0] If $_i + 1 <> (UBound($_split)) Then MsgBox(0,"", $_split[$_i + 1] & @CRLF & $_split[$_i] &@CRLF & UBound($_split) ) If $_split[$_i + 1] == $_split[$_i]Then $ATTACK = 1 EndIf EndIf If $_i + 1 <> (UBound($_split)) Then dbg("ATTACK :" & $ATTACK & " --- " & $_split[$_i] & "->" & $_split[$_i + 1] & @LF) Else dbg("ATTACK :" & $ATTACK & " --- end of array" & @LF) EndIf If $ATTACK = 1 Then For $i = $_i To $_split[0] If $_split[$i] <> $_split[$_i]Then $changetonextloop = 1 dbg("ChangeToNextLoop :" & $changetonextloop & @LF) ExitLoop EndIf If $changetonextloop = 1 Then For $_iTest= ($_i) To ($_i + $count) - 3 dbg("current word :" & $_split[$_iTest] & " -> count: " & $_iTest & @LF) $_split[$_iTest] = "" $gescount += 1 Next $_split[$i - 1] = $_split[$i - 1] & "*" & $count ;$_i += $count $gescount = $count $count = 0 $changetonextloop = 0 EndIf $count += 1 Next $ATTACK = 0 EndIf For $_zu = 1 To $_split[0];-$gescount If $_split[$_zu] <> "" Then $string &= $_split[$_zu] & $delim EndIf Next dbg("current string :" & $string & " ||-->.SplitCount :" & $_split[0] & " ||-->.GesCount :" & $gescount & @LF) $gescount = 0 $_split = StringSplit($string, $delim) $string = "" Next Return $_split ElseIf $mode = 2 Then EndIf EndFunc ;==>__FormatMultiple func dbg($m) consolewrite($m&@LF) endfunc My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now