Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21210

working with arrays

$
0
0
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

Viewing all articles
Browse latest Browse all 21210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>