Results 1 to 2 of 2

Thread: Pulling Data

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2004
    Posts
    131

    Pulling Data

    How do I go about getting my strValue set up to get the value of my table (arrays)

    VB Code:
    1. ' Declare 4 parallel arrays for zones from this table:
    2.  
    3.     '   Weight  Zone A  Zone B  Zone C  Zone D
    4.     '   1       1.00    1.50    1.65    1.85
    5.     '   3       1.58    2.00    2.40    3.05
    6.     '   5       1.71    2.52    3.10    4.00
    7.     '   10      2.04    3.12    4.00    5.01
    8.     '   >10     2.52    3.75    5.10    7.25
    9.  
    10.     ' Calculate Click Event:
    11.     ' 1. Based on weight selected get the rate associated from
    12.     '       the correct parallel array
    13.     ' 2. Display the results in a complete sentence in message box.
    14.  
    15. Private Sub btnRate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRate.Click
    16.  
    17.         Dim intRow, intColumn As Integer
    18.  
    19.         Dim dblArray1() As Double = {1.0, 1.58, 1.71, 2.04, 2.52}
    20.         Dim dblArray2() As Single = {1.5, 2.0, 2.52, 3.12, 3.75}
    21.         Dim dblArray3() As Double = {1.65, 2.4, 3.1, 4.0, 5.1}
    22.         Dim dblArray4() As Double = {1.85, 3.05, 4.0, 5.01, 7.25}
    23.  
    24.        
    25.  
    26.         Dim strValue As String
    27.  
    28.         MessageBox.Show("The shipping rate is " & strValue, "Cost to Ship")
    29.        
    30.  
    31.     End Sub
    32. End Class
    Last edited by twisted; Jul 1st, 2004 at 09:10 AM.
    Twisted

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    this?
    VB Code:
    1. option strict on
    2. imports microsoft.visualbasic
    3. imports system
    4. imports system.drawing
    5. imports system.windows.forms
    6. public class pullingdata
    7.    inherits form
    8.    
    9.    sub new()
    10.       mybase.new()      
    11.    end sub
    12.    
    13.    sub me_load(sender as object,e as eventargs) handles mybase.load
    14.       Dim dblArray1() As Double = {1.0, 1.58, 1.71, 2.04, 2.52}
    15.       Dim dblArray2() As Single = {1.5, 2.0, 2.52, 3.12, 3.75}
    16.       Dim dblArray3() As Double = {1.65, 2.4, 3.1, 4.0, 5.1}
    17.       Dim dblArray4() As Double = {1.85, 3.05, 4.0, 5.01, 7.25}
    18.      
    19.       dim s as string="weight" & constants.vbtab & "zone a" & _
    20.          constants.vbtab & "zone b" & constants.vbtab & _
    21.          "zone c" & constants.vbtab & "zone d"
    22.      
    23.       dim w() as string={"1","3","5","10",">10"}
    24.      
    25.       s &= constants.vbcrlf
    26.       for j as integer=0 to 4
    27.          s &= w(j)
    28.          s &= constants.vbtab
    29.          s &= dblArray1(j).tostring()
    30.          s &= constants.vbtab
    31.          s &= dblArray2(j).tostring()
    32.          s &= constants.vbtab
    33.          s &= dblArray3(j).tostring()
    34.          s &= constants.vbtab
    35.          s &= dblArray4(j).tostring()
    36.          s &= constants.vbcrlf
    37.       next
    38.      
    39.       messagebox.show(s)
    40.      
    41.       me.close() ' please omit
    42.    end sub
    43.    
    44.    shared sub main()
    45.       application.run(new pullingdata())
    46.    end sub
    47. 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
  •  



Click Here to Expand Forum to Full Width