Click here to Skip to main content
15,917,456 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Building a DNS server Pin
Dave Kreskowiak20-Apr-07 13:23
mveDave Kreskowiak20-Apr-07 13:23 
GeneralRe: Building a DNS server Pin
TomPanjer197421-Apr-07 2:01
TomPanjer197421-Apr-07 2:01 
GeneralRe: Building a DNS server Pin
Dave Kreskowiak21-Apr-07 6:54
mveDave Kreskowiak21-Apr-07 6:54 
GeneralRe: Building a DNS server Pin
TomPanjer197421-Apr-07 22:21
TomPanjer197421-Apr-07 22:21 
GeneralRe: Building a DNS server Pin
Dave Kreskowiak22-Apr-07 4:52
mveDave Kreskowiak22-Apr-07 4:52 
GeneralRe: Building a DNS server Pin
TomPanjer197422-Apr-07 21:56
TomPanjer197422-Apr-07 21:56 
QuestionPlease help - Parallel Arrays VB.NET Pin
laura h20-Apr-07 7:06
laura h20-Apr-07 7:06 
AnswerRe: Please help - Parallel Arrays VB.NET Pin
Dave Kreskowiak20-Apr-07 7:28
mveDave Kreskowiak20-Apr-07 7:28 
laura h wrote:
'While the index is in range compare an element in the array with the search text
While ((intIndex < strNames.GetUpperBound(0)) And (strGender(intGender) = "M"))
intIndex += 1
End While

If strGender(intGender) = "M" Then
lstNames.Items.Add(strNames)
End If


There's so many problem with this, I don't know where to start other than the trash can. So, scrap everything from intIndex = strNames.GetLowerBound(0) down to End Sub.

I'm going to write any code for you because this screams "homework". What would you learn if I just wrote the code for you??

You need to create a loop than goes from the LowerBound, which you already have, to the Upperbound, which you already know how to get. You already have the variable that's going to track where you are in the arrays you're looking at, intIndex.

Inside this loop is where you check one index for the gender in every array position. If you find an M in the strGender array at the position indexed by intIndex, you just need to add the name from the strNames array to the ListBox, which you already know how to do.

When you get to the end of the loop, you're done. Oh! You don't need the intGender variable - get rid of it.


Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: Please help - Parallel Arrays VB.NET Pin
Merinda Bratton17-Mar-10 11:25
Merinda Bratton17-Mar-10 11:25 
GeneralRe: Please help - Parallel Arrays VB.NET - Figured it out Pin
Merinda Bratton17-Mar-10 11:56
Merinda Bratton17-Mar-10 11:56 
AnswerRe: Please help - Parallel Arrays VB.NET Pin
Christian Graus20-Apr-07 20:18
protectorChristian Graus20-Apr-07 20:18 
QuestionDisplaying tables in vb.net using sqlDMO Pin
gavthegenius20-Apr-07 5:30
gavthegenius20-Apr-07 5:30 
QuestionQuestion regarding the keyword &quot;Using&quot; Pin
Marcus J. Smith20-Apr-07 5:03
professionalMarcus J. Smith20-Apr-07 5:03 
AnswerRe: Question regarding the keyword &quot;Using&quot; Pin
Dave Kreskowiak20-Apr-07 6:10
mveDave Kreskowiak20-Apr-07 6:10 
GeneralRe: Question regarding the keyword "Using" [modified] Pin
Marcus J. Smith20-Apr-07 6:11
professionalMarcus J. Smith20-Apr-07 6:11 
GeneralRe: Question regarding the keyword "Using" Pin
Dave Kreskowiak20-Apr-07 6:32
mveDave Kreskowiak20-Apr-07 6:32 
QuestionMax(rows) of msflexgrid Pin
Navneet Hegde20-Apr-07 1:45
Navneet Hegde20-Apr-07 1:45 
AnswerRe: Max(rows) of msflexgrid Pin
Tim Carmichael20-Apr-07 3:25
Tim Carmichael20-Apr-07 3:25 
AnswerRe: Max(rows) of msflexgrid Pin
Dave Kreskowiak20-Apr-07 4:30
mveDave Kreskowiak20-Apr-07 4:30 
QuestionGetting DOS output Pin
johnjsm20-Apr-07 1:43
johnjsm20-Apr-07 1:43 
AnswerRe: Getting DOS output Pin
kubben20-Apr-07 2:25
kubben20-Apr-07 2:25 
AnswerRe: Getting DOS output Pin
sthotakura20-Apr-07 7:58
sthotakura20-Apr-07 7:58 
GeneralRe: Getting DOS output Pin
johnjsm20-Apr-07 11:10
johnjsm20-Apr-07 11:10 
QuestionHow do you add code snippets Pin
directred20-Apr-07 1:25
directred20-Apr-07 1:25 
AnswerRe: How do you add code snippets Pin
Dave Kreskowiak20-Apr-07 4:28
mveDave Kreskowiak20-Apr-07 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.