Jump to content

[Solved]Select statement with true/false return value always returns false


Go to solution Solved by Exit,

Recommended Posts

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 working

Func 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 well

Func 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 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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...