Patil Posted December 3, 2007 Share Posted December 3, 2007 What will be the return value if the if it (_IEFormElementOptionselect ) selected from the list. It is displaying 0 for both selecting and for invalid name also... how can i find out that whether it is success or fail... Thanks, Santosh Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 3, 2007 Share Posted December 3, 2007 What will be the return value if the if it (_IEFormElementOptionselect ) selected from the list.It is displaying 0 for both selecting and for invalid name also...how can i find out that whether it is success or fail...Thanks,SantoshWhat is displaying 0? You didn't show any code.If the function is returning 0, either you had an error (use the values of @error and @extended to isolate), or if you used $f_select = -1 then 0 is the selection state of the item. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Patil Posted December 4, 2007 Author Share Posted December 4, 2007 What is displaying 0? You didn't show any code.If the function is returning 0, either you had an error (use the values of @error and @extended to isolate), or if you used $f_select = -1 then 0 is the selection state of the item. Here i tried with the following code #include <IE.au3>$oIE = _IE_Example ("form")_IELoadWait($oIE)$oForm = _IEFormGetObjByName ($oIE, "ExampleForm")$oSelect = _IEFormElementGetObjByName ($oForm, "multipleSelectExample") _IEFormElementOptionselect ($oSelect, "03223", 1, "byText")MsgBox (0,"",@error)MsgBox (0,"",@extended)i am getting 0 whether if it select or not.....I want to know if it is not clicking what value i will get, like in the code i used "03223" used that is not exists in the list at this event what i have to get on @error? Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 4, 2007 Share Posted December 4, 2007 (edited) Here i tried with the following code #include <IE.au3> $oIE = _IE_Example ("form") _IELoadWait($oIE) $oForm = _IEFormGetObjByName ($oIE, "ExampleForm") $oSelect = _IEFormElementGetObjByName ($oForm, "multipleSelectExample") _IEFormElementOptionselect ($oSelect, "03223", 1, "byText") MsgBox (0,"",@error) MsgBox (0,"",@extended) i am getting 0 whether if it select or not..... I want to know if it is not clicking what value i will get, like in the code i used "03223" used that is not exists in the list at this event what i have to get on @error? That "03223" option doesn't exist in the example form, and you have to use a selection value of -1 to test selected state. So to test the selected state of all options, you have to loop through them. So the easiest way is to select "byText" and then read them "byIndex". Try this: expandcollapse popup#include <IE.au3> HotKeySet("{ESC}", "_Quit") ; Open IE to example form $oIE = _IE_Example("form") _IELoadWait($oIE) $oForm = _IEFormGetObjByName($oIE, "ExampleForm") $oSelect = _IEFormElementGetObjByName($oForm, "multipleSelectExample") ConsoleWrite("Debug: $oSelect.name = " & $oSelect.name & @LF) ; Select 3 options Global $avNames[3] = ["Bruce", "Denis", "Ed"] For $n = 0 To UBound($avNames) - 1 _IEFormElementOptionselect($oSelect, $avNames[$n], 1, "ByText") Next ; Read the options in a loop While 1 Sleep(3000) ; 3sec delay to change selections, if desired $n = 0 $sMsg = "" While 1 $RET = _IEFormElementOptionselect($oSelect, $n, -1, "ByIndex") If @error Then $sMsg = StringTrimRight($sMsg, 1) ExitLoop Else If $RET Then $sMsg &= $n & "|" $n += 1 EndIf WEnd If $sMsg <> "" Then MsgBox(64, "Results", "$sMsg = " & $sMsg) Else ConsoleWrite("Debug: No selections" & @LF) EndIf WEnd Func _Quit() _IEQuit($oIE) Exit EndFunc P.S. You can't read @error and @extended that way because they get reset by the MsgBox() function. Edited December 4, 2007 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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