Press Posted July 16, 2020 Posted July 16, 2020 (edited) Hi i am new to Autoit. i wrote the below code and tried executing it. Script moves to first switch case as expected and the If condition is satisfied. Hence the return value for $test is set as "EditPosAccountManagementCenter 'Accept Cash' is not set" but still the code continues to execute inside the case and the $parameterFieldValue "99998" is set in the text box in application. Can anyone help why this happens? expandcollapse popupFunc EditPosAccountManagementCenter($parameterFieldName, $parameterFieldValue, $parameterFieldValueTwo) $Result = 1 Switch $parameterFieldName Case "Disable Bill collector when bills collected reaches" If ControlGetHandle("BBTSMain", "Accept Cash", "[CLASS:TCheckBox; INSTANCE:2]") <> 1 Then Return "EditPosAccountManagementCenter 'Accept Cash' is not set" EndIf Sleep($SleepSmall) ControlClick("BBTSMain", "", "[CLASS:TbbDBEdit; INSTANCE:1]") Sleep($SleepSmall) Send("^a") Sleep($SleepSmall) Send($parameterFieldValue) Case "Account Management Center Configuration" If $parameterFieldValue = "Default" Or $parameterFieldValue == "Default" Then ControlClick("BBTSMain", "Use default settings", "[CLASS:TRadioButton; INSTANCE:4]") Else If $parameterFieldValue = "Custom" Or $parameterFieldValue == "Custom" Then ControlClick("BBTSMain", "Use custom settings", "[CLASS:TRadioButton; INSTANCE:3]") Else $Result = "EditPosAccountManagementCenter Unknown option of Account Management Center Configuratin " EndIf EndIf Case Else Return "-EditPosAccountManagementCenter Field for changing not found" EndSwitch Return $Result EndFunc ;==>EditPosAccountManagementCenter $test = EditPosAccountManagementCenter("Disable Bill collector when bills collected reaches",99998,"") ConsoleWrite($test) Edited July 16, 2020 by Press
Press Posted July 16, 2020 Author Posted July 16, 2020 Hi i am new to Autoit. i wrote the below code and tried executing it. Script moves to first switch case as expected and the If condition is satisfied. Hence the return value for $test is set as "EditPosAccountManagementCenter 'Accept Cash' is not set" but still the code continues to execute inside the case and the $parameterFieldValue "99998" is set in the text box in application. Can anyone help why this happens? expandcollapse popupFunc EditPosAccountManagementCenter($parameterFieldName, $parameterFieldValue, $parameterFieldValueTwo) $Result = 1 Switch $parameterFieldName Case "Disable Bill collector when bills collected reaches" If ControlGetHandle("BBTSMain", "Accept Cash", "[CLASS:TCheckBox; INSTANCE:2]") <> 1 Then Return "EditPosAccountManagementCenter 'Accept Cash' is not set" EndIf Sleep($SleepSmall) ControlClick("BBTSMain", "", "[CLASS:TbbDBEdit; INSTANCE:1]") Sleep($SleepSmall) Send("^a") Sleep($SleepSmall) Send($parameterFieldValue) Case "Account Management Center Configuration" If $parameterFieldValue = "Default" Or $parameterFieldValue == "Default" Then ControlClick("BBTSMain", "Use default settings", "[CLASS:TRadioButton; INSTANCE:4]") Else If $parameterFieldValue = "Custom" Or $parameterFieldValue == "Custom" Then ControlClick("BBTSMain", "Use custom settings", "[CLASS:TRadioButton; INSTANCE:3]") Else $Result = "EditPosAccountManagementCenter Unknown option of Account Management Center Configuratin " EndIf EndIf Case Else Return "-EditPosAccountManagementCenter Field for changing not found" EndSwitch Return $Result EndFunc ;==>EditPosAccountManagementCenter $test = EditPosAccountManagementCenter("Disable Bill collector when bills collected reaches",99998,"") ConsoleWrite($test)
Press Posted July 16, 2020 Author Posted July 16, 2020 This is reposted in AutoIT General Help & Support Forum. This post can be deleted. Apologize for the inconvenience.
Danp2 Posted July 16, 2020 Posted July 16, 2020 Next time, just use the forum's Report Post feature and request that it be moved. Latest Webdriver UDF Release Webdriver Wiki FAQs
jchd Posted July 16, 2020 Posted July 16, 2020 ControlGetHandle() returns a handle, not the content of a control. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
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