AndreyS

Please explain the strange result

6 posts in this topic

#1 ·  Posted (edited)

...

Edited by AndreyS

Share this post


Link to post
Share on other sites



Sorry! Already I understood.
Remove the topic please.

Share this post


Link to post
Share on other sites

Please explain why the $ y in the first case is equal to 3 and the second 2?  :blink:

How to make the code to work correctly?

Thanks you!

$x = 10.1

Switch $x
    Case 0 To 10
        $y = 1
    Case 11 To 60
        $y = 2
    Case Else
        $y = 3
EndSwitch

MsgBox(0,"false",$y)

$x = 11.1

Switch $x
    Case 0 To 1
        $y = 1
    Case 11 To 60
        $y = 2
    Case Else
        $y = 3
EndSwitch

MsgBox(0,"true",$y)

 

 


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

@AndreyS, in the future, rather than deleting your topic, how about posting your solution? Then someone can benefit from your understanding in the future ;)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Understood, JLogan3o13!
Simply, it was a topic that is talked about a simple mistake.
I immediately noticed the obvious. Probably due to the fact that I lost my attention for a long time programming. :D
I would not want to clutter up the forum such errors.

In general, users can delete topics?

Share this post


Link to post
Share on other sites

No, but we tend to leave topics out there for others who may be searching. We've all had the a-HA moment as soon as we post something, but you never know when someone else is going to learn from your post :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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