Ram Posted March 13, 2007 Posted March 13, 2007 (edited) Hi, I have Text box that can't be copied by mouse or tab. So I was looking at AutoIT Active Window Info. I placed the mouse on the text box of the application found these. >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 416 Y: 167 W: 80 H: 20 Control ID: 18102 ClassNameNN: Static15 Text: $13,668.40 Style: 0x50000002 ExStyle: 0x00000204 Now I would like to get the text value ("Text:$13,668.40) and divide that value by 10 and give out an answer. Is this possible? if so how do I go about doing that? How do I get this text value? Please let me know...!! Thanks! Edited March 13, 2007 by Ram
Ram Posted March 13, 2007 Author Posted March 13, 2007 Alright.. I tried this... >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 416 Y: 167 W: 80 H: 20 Control ID: 18102 ClassNameNN: Static15 Text: $13,668.40 Style: 0x50000002 ExStyle: 0x00000204 $var = ControlGetText("Edit", "", "Static15") $OutPut = StringRight($var, StringInStr($var, "$") + 1) Msgbox (0, "test", $OutPut) I get value after the decimal. "40" in the message box. All I want to trim is "$" how do I go about doing that - and get only the numbers "13,668.40".. How can I get it?
Shevilie Posted March 13, 2007 Posted March 13, 2007 StringTrimLeft ??? Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
Ram Posted March 13, 2007 Author Posted March 13, 2007 StringTrimLeft ???StringTrimLeft can't be used as the number of digits cannot be judged. As it can be more than 8 digits or can be lesser too...!! so need some other solution..!!
Moderators SmOke_N Posted March 13, 2007 Moderators Posted March 13, 2007 StringTrimLeft can't be used as the number of digits cannot be judged. As it can be more than 8 digits or can be lesser too...!! so need some other solution..!!StringReplace()... but seriously, you asked to remove the $ sign (P.S. no need for the incognito on what your doing, think we all get it), so why wouldn't StringTrimLeft(ControlGetText($hPSite, '', $hPControl), 1) not work? Or did you even read what StringTrimLeft did? 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.
Shevilie Posted March 13, 2007 Posted March 13, 2007 Thx Smoke Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
Ram Posted March 14, 2007 Author Posted March 14, 2007 StringReplace()... but seriously, you asked to remove the $ sign (P.S. no need for the incognito on what your doing, think we all get it), so why wouldn't StringTrimLeft(ControlGetText($hPSite, '', $hPControl), 1) not work? Or did you even read what StringTrimLeft did?Alright Cool it...!! I didn't put the count value for StringTrinLeft correctly hence it didn't work.... I gave it a try again now.. with the correct count value. It's working fine. The first time. I thought the logic was to trim the text that are from left. i.e if I have value 12345 - trimleft start from 1 then I thought it should give an answer as 1234 triming 5. I think it's the other way round..so I was confused...!!Now everything is all set.. Thanks Guys!!
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