By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Distinguishment between T(red) and T(black)

cindy2
P: 35
Hi there,

In my VB project, I want to distinguish the character T from other characters. I also want to distinguish the character T (red) from T (black).

My code looks like this:

Expand|Select|Wrap|Line Numbers
  1. For i = 0 To k
  2.         If Array1(i) = Color.Red And Array2(i) = "T" Then
  3.                 Form2.Label15.Text = Array3(i)
  4.         End If
  5. Next i
  6.  
Now the strange thing that happens is, is that Form2.Label15.Text is always filled when T is present, nomatter what color T is.

What's going on here? It seems like the ''And''-statement isn''t working!?

Cindy
Sep 21 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
This is where the debugging facilities built into VB will help you. Interrupt execution at that point, and examine the following values...
  • array1(i)
  • Color.Red
  • array1(i) = Color.Red
Additionally, try running with line 3 commented out, just to ensure you aren't looking for an effect that was actually caused somewhere else.
Sep 21 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.