Queener Posted February 19, 2015 Share Posted February 19, 2015 (edited) -------------------------EDIT----------------------- I think I know the work around, but I'm not sure how to rephrase it... Say we have [John] ID=123 [James] ID=234 [Jack] ID=543 How do I code so msgbox return the number of element that display in $inputsearch2? so if James was input in $inputsearch2, msgbox would return 2 or Jack in $inputsearch2 then msgbox return 3. Edited February 19, 2015 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
Solution SadBunny Posted February 20, 2015 Solution Share Posted February 20, 2015 (edited) #include <Array.au3> $searchThisSection = "James" $array = IniReadSectionNames("c:\temp\test.ini") msgbox(0,0,_ArraySearch($array, $searchThisSection)) Something like that? ... if I paste your data in my ini file and run it, I get a msgbox stating "2". That is what you mean, I guess? If not, please post more example code. Merely mentioning a variable called "$inputsearch2" doesn't tell us a whole lot about the situation in question Edited February 20, 2015 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
kylomas Posted February 20, 2015 Share Posted February 20, 2015 asianqueen, You changed the title and the text to something quite different from the origional, probably because you did not get a reply. The reason you did not get a reply was because your question was not clear and what you posted was not runnable, nor was there any discernable flow, just fragments. As you have seen, the forum members are very helpfull but we need something to go on. Please post runnable code and/or define what you expect and what is going wrong. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Queener Posted February 20, 2015 Author Share Posted February 20, 2015 asianqueen, You changed the title and the text to something quite different from the origional, probably because you did not get a reply. The reason you did not get a reply was because your question was not clear and what you posted was not runnable, nor was there any discernable flow, just fragments. As you have seen, the forum members are very helpfull but we need something to go on. Please post runnable code and/or define what you expect and what is going wrong. kylomas Yes I have changed the title to rephrase it so it's easier to understand of what I'm aiming for. Will test the code and see if it works... Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
SadBunny Posted February 21, 2015 Share Posted February 21, 2015 Yes I have changed the title to rephrase it so it's easier to understand of what I'm aiming for. Will test the code and see if it works... I don't know what it was before, but it is quite hard to understand now. Was my code enough (you accepted it as an answer) or was there anything else? Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Queener Posted February 21, 2015 Author Share Posted February 21, 2015 (edited) I don't know what it was before, but it is quite hard to understand now. Was my code enough (you accepted it as an answer) or was there anything else? quite hard? hahaha you answer my question right on the point. I have another question base on array, but will create a new topic since it's different question. Edited February 21, 2015 by asianqueen Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.") Link to comment Share on other sites More sharing options...
SadBunny Posted February 21, 2015 Share Posted February 21, 2015 quite hard? hahaha you answer my question right on the point. I have another question base on array, but will create a new topic since it's different question. Lol, just a lucky guess then Well, glad it helped. Roses are FF0000, violets are 0000FF... All my base are belong to you. 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