ezzetabi 4 Posted September 5, 2004 Share Posted September 5, 2004 Who needs ExpandEnvString? Func _ReplaceWinSets($INPUT) Local $INPUT, $BETWEEN, $C = 2, $N = 2, $C2 = 0 If StringInStr($INPUT, '%', 0, 2) Then ;If there are less than 2 % it While 1 ;is useless to bother. $C = $C + 1 If StringInStr($INPUT, '%', 0, $C) <> 0 Then $N = $N + 1 ;count how many % are present. Else ExitLoop EndIf Wend $C = 1 For $C2 = 1 To $N ;check the strings between % $BETWEEN = StringTrimLeft($INPUT, StringInStr($INPUT, '%', 0, $C)) $BETWEEN = StringLeft($BETWEEN, StringInStr($BETWEEN, '%', 0, $C) - 1) If Not StringInStr($BETWEEN, ' ') And EnvGet($BETWEEN) <> '' Then $INPUT = StringReplace($INPUT, '%' & $BETWEEN & '%', EnvGet($BETWEEN)) Else ;replace OR look in the next one $C = $C + 1 EndIf Next EndIf Return $INPUT ;Return the new string EndFunc ;==>_ReplaceWinsets Link to post Share on other sites
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