I'm very new to VB and a student of about a month. I've created the below code and it just doesn't work. Having already spent 2 days on this and tried many, many variations of code, I'm just lost. I need to have the array populated by a range of values (amount ordered) and then be able to input an amount ordered and get the shipping charge as output. The searching through the array works fine, and I didn't include that part of the code.. However, the range of values are not working. I'm having trouble even comprehending how to get a ranges of values stuffed into an array. TIA - Sharon
Dim intAmtOrdered As Integer
Dim intCharges As Integer
Dim I As Integer
Dim strChargesList(,) As String = {{"1", "10", "15"},
{"11", "50", "10"},
{"51", "100", "5"},
{"101", "intMax.Value", "0"}}
For I = 0 To 3
If intAmtOrdered >= strChargesList(I, 0) AndAlso intAmtOrdered <= strChargesList(I, 1) Then
intCharges = strChargesList(I, 2)
End If
Next
Dim intAmtOrdered As Integer
Dim intCharges As Integer
Dim I As Integer
Dim strChargesList(,) As String = {{"1", "10", "15"},
{"11", "50", "10"},
{"51", "100", "5"},
{"101", "intMax.Value", "0"}}
For I = 0 To 3
If intAmtOrdered >= strChargesList(I, 0) AndAlso intAmtOrdered <= strChargesList(I, 1) Then
intCharges = strChargesList(I, 2)
End If
Next