Newb Posted June 5, 2015 Share Posted June 5, 2015 (edited) I'm a bit ashamed of asking this but....I can't figure out why a simple select statement which checks a variable which contains mouse coordinates doesn't work while used with a Select Statement, while it works with an If-Else conditional statement. Select statements always returns false or 0.This isn't workingFunc StartIt() If CanIStart() Then MsgBox(0, "jj", "Start " & CanIStart()) Else MsgBox(0, "Kk", "NoStart" & CanIStart()) EndIf EndFunc ;==>StartIt Func CanIStart() Select Case UBound($M1Pos)<1 Return False Case UBound($M2Pos)<1 Return False Case UBound($M3Pos)<1 Return False Case UBound($M4Pos)<1 Return False EndSelect EndFunc ;==>CanIStart While this does the job pretty wellFunc StartIt() If CanIStart() Then MsgBox(0, "jj", "Start " & CanIStart()) Else MsgBox(0, "Kk", "NoStart" & CanIStart()) EndIf EndFunc ;==>StartIt Func CanIStart() If UBound($M1Pos)<1 Then Return False ElseIf UBound($M2Pos)<1 Then Return False ElseIf UBound($M3Pos)<1 Then Return False ElseIf UBound($M4Pos)<1 Then Return False Else Return True EndIf EndFunc ;==>CanIStart Thanks Edited June 9, 2015 by Newb I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. Link to comment Share on other sites More sharing options...
Solution Exit Posted June 5, 2015 Solution Share Posted June 5, 2015 There is the case else missing.case else return true Newb 1 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Newb Posted June 6, 2015 Author Share Posted June 6, 2015 Ok shame on me for not noticing. Sorry and thank you I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. Link to comment Share on other sites More sharing options...
Exit Posted June 6, 2015 Share Posted June 6, 2015 @Newb glad to help. Please mark the thread as solved, ... and perhaps a 'like this' to my answer. Newb 1 App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
Newb Posted June 9, 2015 Author Share Posted June 9, 2015 Done. Thanks Exit and argumentum 2 I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. 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