Andre Posted June 16, 2004 Posted June 16, 2004 Hi does someone already developed an between function ? I need it badly For example : Between("this is my very long text string","my","long") should return " very ") Thnx. What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
ezzetabi Posted June 16, 2004 Posted June 16, 2004 (edited) Func _Between($input,$before,$after) Local $where_before, $where_after $where_before = StringInStr($input,$before) $where_after = StringInStr($input,$after) If $where_after <> 0 AND $where_before <> 0 Then Return StringMid($input,$where_before + 1 + StringLen($Where_before), _ Where_after - 1 - $Where_before - StringLen($Where_before)) Else Return 0 EndIf EndFunc Try that! Edited June 16, 2004 by ezzetabi
Andre Posted June 16, 2004 Author Posted June 16, 2004 my humble thnx it works What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel!
ezzetabi Posted June 16, 2004 Posted June 16, 2004 I hope that you understand what I did and that will help you with yours next scripts. I apreciate your gratitude. /me bows
ezzetabi Posted June 16, 2004 Posted June 16, 2004 (edited) Func _Between($input,$before,$after) Local $where_before, $where_after $where_before = StringInStr($input,$before) $where_after = StringInStr($input,$after) If $where_after <> 0 AND $where_before <> 0 Then If $where_before => $where_after Then SetError ( -1 ) Return 0 EndIf Return StringMid($input,$where_before + 1 + StringLen($Where_before), _ Where_after - 1 - $Where_before - StringLen($Where_before)) Else SetError ( 1 ) Return 0 EndIf EndFunc Solved... Still it was not intended as a challenge, I was just joking. Edited June 17, 2004 by ezzetabi
emmanuel Posted June 16, 2004 Posted June 16, 2004 I have that all impotent ERROR handling.*snicker*sorry. now that that's out of my system... error handling rocks. "I'm not even supposed to be here today!" -Dante (Hicks)
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