Results 1 to 2 of 2

Thread: students(i).teacher results into listbox

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2009
    Posts
    21

    students(i).teacher results into listbox

    Hi, I'm working on a program that organizes students and their information (from a textfile) for a school of disabled children. This is a project for my intro to vb course. I can't work my head around how to output each class they are in, so any help would be greatly appreciated

    The textfile has the student structure:
    firstName
    lastName
    sex
    age
    diagnosis
    wheelchair
    verbal [score]
    hyper [score]
    emotion [score]
    total [score]
    motor
    teacher
    teacherFloor

    Currently all I have the form do is bubble sort the list based on students(i).teacher and output all the information in a formatted string..

    However it would be much better if I could have it output in the following way:
    Teacher1 -- Floor #
    Student...
    Student...
    Student...

    Teacher 2 -- Floor #
    Student...
    Student...
    etc

    etc
    you get the idea

    So I'm not really sure how to go about organizing and outputting based on teacher...specifically where to have the loop. Right now it seems to loop infinitely

    My current code is
    Code:
            For i = 0 To students.GetUpperBound(0)
                Do While students(i).teacher = "Bob"
                    lstResults.Items.Add(students(i).lastName)
                Loop
    Next

    Thank you

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Mar 2009
    Posts
    21

    Re: students(i).teacher results into listbox

    err... fugettaboutit. I figured it out by creating a new array 'TeacherXYZ' based on the criteria

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width