Jump to content

Check if any two variables are the same? [RESOLVED]


Minikori
 Share

Recommended Posts

Okay, so I don't really think I need to post code for this question, so I won't unless you ask.

I have a picture in my GUI and need to make it alternate between two pictures when I right click it. I got the right click part down, but I'm wondering how to get the current picture the control is using. I have a bunch of images like this, so I don't want to store a bunch of booleans. Thanks for any help.

New question. Can I check if any two variables out of a list of variables are the same? I'm making a battleship program, and each set ship's location is stored in one array like so: $Ship[shipID][coord] with 0 as the x coord and 1 as the y coord. Is there a way to check if two ships have the same x AND y?

Edited by Minikori

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

... I don't want to store a bunch of booleans.

This is the best and correct (I think) way. The only thing you can do is get a handle to the current bitmap. But what does it give you?

Alternatively, you can make an array.

Edited by Yashied
Link to comment
Share on other sites

This is the best and correct (I think) way. The only thing you can do is get a handle to the current bitmap. But what does it give you?

Alternatively, you can make an array.

I did end up making an array of booleans. Which led to a large amount of (Else)If...Thens, but I got it done. I have a new question now, I'll edit the title and the first post.

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

Link to comment
Share on other sites

I did end up making an array of booleans. Which led to a large amount of (Else)If...Thens, but I got it done. I have a new question now, I'll edit the title and the first post.

If you have a lot of "Else", your code is wrong.

It is not necessary to change the topic, it would be a good idea from you to start a new topic! :D

This forum NOT only for you.

Link to comment
Share on other sites

If you have a lot of "Else", your code is wrong.

It is not necessary to change the topic, it would be a good idea from you to start a new topic! :D

This forum NOT only for you.

I don't have any elses, I meant ElseIfs and Ifs. But I figured out what I could do, and it'd be hard you the forums to also even if I gave my entire code.

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...