|
-
Jul 1st, 2004, 09:05 AM
#1
Thread Starter
Addicted Member
Pulling Data
How do I go about getting my strValue set up to get the value of my table (arrays)
VB Code:
' Declare 4 parallel arrays for zones from this table:
' Weight Zone A Zone B Zone C Zone D
' 1 1.00 1.50 1.65 1.85
' 3 1.58 2.00 2.40 3.05
' 5 1.71 2.52 3.10 4.00
' 10 2.04 3.12 4.00 5.01
' >10 2.52 3.75 5.10 7.25
' Calculate Click Event:
' 1. Based on weight selected get the rate associated from
' the correct parallel array
' 2. Display the results in a complete sentence in message box.
Private Sub btnRate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRate.Click
Dim intRow, intColumn As Integer
Dim dblArray1() As Double = {1.0, 1.58, 1.71, 2.04, 2.52}
Dim dblArray2() As Single = {1.5, 2.0, 2.52, 3.12, 3.75}
Dim dblArray3() As Double = {1.65, 2.4, 3.1, 4.0, 5.1}
Dim dblArray4() As Double = {1.85, 3.05, 4.0, 5.01, 7.25}
Dim strValue As String
MessageBox.Show("The shipping rate is " & strValue, "Cost to Ship")
End Sub
End Class
Last edited by twisted; Jul 1st, 2004 at 09:10 AM.
Twisted
-
Jul 3rd, 2004, 01:04 AM
#2
Fanatic Member
this?
VB Code:
option strict on
imports microsoft.visualbasic
imports system
imports system.drawing
imports system.windows.forms
public class pullingdata
inherits form
sub new()
mybase.new()
end sub
sub me_load(sender as object,e as eventargs) handles mybase.load
Dim dblArray1() As Double = {1.0, 1.58, 1.71, 2.04, 2.52}
Dim dblArray2() As Single = {1.5, 2.0, 2.52, 3.12, 3.75}
Dim dblArray3() As Double = {1.65, 2.4, 3.1, 4.0, 5.1}
Dim dblArray4() As Double = {1.85, 3.05, 4.0, 5.01, 7.25}
dim s as string="weight" & constants.vbtab & "zone a" & _
constants.vbtab & "zone b" & constants.vbtab & _
"zone c" & constants.vbtab & "zone d"
dim w() as string={"1","3","5","10",">10"}
s &= constants.vbcrlf
for j as integer=0 to 4
s &= w(j)
s &= constants.vbtab
s &= dblArray1(j).tostring()
s &= constants.vbtab
s &= dblArray2(j).tostring()
s &= constants.vbtab
s &= dblArray3(j).tostring()
s &= constants.vbtab
s &= dblArray4(j).tostring()
s &= constants.vbcrlf
next
messagebox.show(s)
me.close() ' please omit
end sub
shared sub main()
application.run(new pullingdata())
end sub
end class
got no vs.net.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|