testmeout Posted June 21, 2006 Share Posted June 21, 2006 Guys, I am able to get my function to work in a new document but within my program selectstring does not work. The function is idential, the only difference is where the variable is coming from. I know it is being caused by my variable but when I debug the variable appears right. If I use just the text instead of a variable in my program then it works, thus proving it is an error with the variable somehow. Is there a way to report exactly what selectstring is seeing with the variable so I can compare? In my program I have a log file to debug and I have this code inserted Info("The Current Variable is: " & $variable) And the results say The Current Variable is: 109 Which as far as I am concerned should work but doesn't I'm stumped Here is my function if it helps at all expandcollapse popup$variable = "109" Func SetupBeta() WinActivate("Beta") Select Case (ControlGetText("Beta", "", "Static23") = "") ControlClick("Beta", "", "Button1") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button4") Case (ControlGetText("Beta", "", "Static37") = "") ControlClick("Beta", "", "Button5") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button6") Case (ControlGetText("Beta", "", "Static51") = "") ControlClick("Beta", "", "Button7") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button8") Case (ControlGetText("Beta", "", "Static65") = "") ControlClick("Beta", "", "Button9") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button10") Case (ControlGetText("Beta", "", "Static79") = "") ControlClick("Beta", "", "Button11") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button12") Case (ControlGetText("Beta", "", "Static93") = "") ControlClick("Beta", "", "Button13") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button14") Case (ControlGetText("Beta", "", "Static107") = "") ControlClick("Beta", "", "Button15") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button16") Case (ControlGetText("Beta", "", "Static121") = "") ControlClick("Beta", "", "Button17") WinActivate("Select Table", "") ControlCommand("Select Table", "", "ListBox1", "SelectString", 'Window - ' & $variable) ControlClick("Beta", "", "Button18") EndSelect EndFunc Thanks 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