Computing.Net > Forums > Programming > Array of Structures

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Array of Structures

Reply to Message Icon

Name: VBNOVICE
Date: April 29, 2003 at 19:26:19 Pacific
OS: Windows XP
CPU/Ram: Pentium 4 512 MB
Comment:

Can someone help me how I can search a one dimensional array of structures? This is what I have so far...but I can not figure out how to display the appropriate grade.

Structure GradeStruc
Public strGrade As String
Public intPoints As Integer
End Structure
'Declare Array of Structure
Dim udtGradeScale(4) As GradeStruc
'Declare Variables
Dim intX As Integer, intSearchfor As Integer
'Code Display Button Click
Private Sub DisplayButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DisplayButton.Click
'populate array
udtGradeScale(0).strGrade = "F"
udtGradeScale(0).intPoints = 0
udtGradeScale(1).strGrade = "D"
udtGradeScale(1).intPoints = 300
udtGradeScale(2).strGrade = "C"
udtGradeScale(2).intPoints = 350
udtGradeScale(3).strGrade = "B"
udtGradeScale(3).intPoints = 400
udtGradeScale(4).strGrade = "A"
udtGradeScale(4).intPoints = 450
intSearchfor = Val(Me.PointsTextBox.Text)

'Search Array


'Display Grade
Me.GradeLabel.Text = udtGradeScale(intX).strGrade



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Read Image to Matrix in C Waht is Stack & Heap



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Array of Structures

BUBBLE sort in array of Structures www.computing.net/answers/programming/bubble-sort-in-array-of-structures/8607.html

Array of pointers to Structures www.computing.net/answers/programming/array-of-pointers-to-structures/1579.html

C arrays of strings from a file www.computing.net/answers/programming/c-arrays-of-strings-from-a-file/14025.html