Results 1 to 4 of 4

Thread: arrays

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    13

    arrays

    i have a txt file that contains this data:

    200 5
    400 10
    600 15
    1000 20

    i have to put them into 2 arrays.
    how do i make it so that it checks if the data is increasing?

  2. #2
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    could you be a little more specific? what do you mean by the data increasing?

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    13
    200 5
    400 10
    600 15
    1000 20
    the first column is the dollar values the second is the discount if the values are >= to the it's counterpart.
    It should check that the dollar and discount entries in the discount file are increasing. if it's not, a message should be displayed and the program should terminate.

  4. #4
    PowerPoster SuperSparks's Avatar
    Join Date
    May 2003
    Location
    London, England
    Posts
    265
    Something like this should do it:

    VB Code:
    1. For i As Integer = 0 To Arr.GetUpperBound(0) - 1
    2.             If Arr(i) >= Arr(i + 1) Then
    3.                 MessageBox.Show("Array not increasing", "yada,yada, yada")
    4.                 End                             ' Exit app
    5.             End If
    6.         Next
    Nick.

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