Comparing values in control arrays 
Author Message
 Comparing values in control arrays

Hello folks,
    I have a control array of buttons and I need to compare the two
buttons to see if they have the same value.  The application that I am
creating is like the "Concentration" card game where the 2 cards are
compared.  If they are the same, you get rid of them, if different, flip
them back over again.  Anyway, I am really stuck on the comparison
part.  Any help you can provide would be appreciated.  I have also
included a bit of code here:

Private Sub cmdButton_Click(Index As Integer)
   'prints result out in the picturebox
   picDisplay.Print names(Index); ":"; Spc(1); "was selected"
   'Print the result onto the button
   cmdButton(Index).Caption = names(Index)
   'send results of button to function checkName

End Sub

Thanks,

Jason Davitsky



Fri, 24 Aug 2001 03:00:00 GMT  
 Comparing values in control arrays
Jason

You need a flag indicating whether this is the first or second button of the
pair. When it's the first just store the name (at module level) and when
it's the second just test it's name equal to the stored name (just test =
will do).

Incidentally, it's not a good idea to post to so many newsgroups. Just one
should do.

Regards
{*filter*}

Quote:

>Hello folks,
>    I have a control array of buttons and I need to compare the two
>buttons to see if they have the same value.  The application that I am
>creating is like the "Concentration" card game where the 2 cards are
>compared.  If they are the same, you get rid of them, if different, flip
>them back over again.  Anyway, I am really stuck on the comparison
>part.  Any help you can provide would be appreciated.  I have also
>included a bit of code here:

>Private Sub cmdButton_Click(Index As Integer)
>   'prints result out in the picturebox
>   picDisplay.Print names(Index); ":"; Spc(1); "was selected"
>   'Print the result onto the button
>   cmdButton(Index).Caption = names(Index)
>   'send results of button to function checkName

>End Sub

>Thanks,

>Jason Davitsky



Sat, 25 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Comparing values in control arrays

2. Comparing values in control arrays

3. Comparing Array Values

4. writing to text file, control array names and values

5. Control array can only go to Index value 32767

6. can't init radio button.value=true in control array

7. Control Array and loading values from database

8. Convert array of value type to array of reference type

9. comparing date values

10. Comparing two values which may be Null

11. Comparing an autonumber value to a variable

12. comparing values in 4 comboboxes

 

 
Powered by phpBB® Forum Software