Results 1 to 2 of 2

Thread: Error Problem

  1. #1
    Engineerist is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Apr 2012
    Posts
    2
    Reputation
    0

    Error Problem

    Hi everybody,


    I have two form in my program. In Form1 I fill listview1 with code below,



    cap = Math.Sqrt((4 * Val(TextBox1.Text)) / (20 * Math.PI))
    cap = Math.Round(cap, 1)
    say = 0


    Do
    cap = cap - 0.05
    hiz = Val(TextBox1.Text) / ((Math.PI * cap ^ 2) / 4)
    kolon = (recine / 1000) / ((Math.PI * cap ^ 2) / 4)


    ListView1.Items.Add(Math.Round(cap, 2))


    ListView1.Items(say).SubItems.Add(Math.Round(hiz, 2))
    ListView1.Items(say).SubItems.Add(Math.Round(kolon, 2))
    say = say + 1
    Loop Until (hiz >= 50)


    But when i try to fill listview in form2, i recieve error. Code like this


    Do


    Vrecine = InputBox("Tank içine konulacak reçine miktarı ?" & Chr(13) & "Örneğin 2500 Litre", "Reçine Miktarınız ?")
    If Len(Vrecine) = 0 Then

    Exit Sub
    End If
    Loop While Not IsNumeric(Vrecine)


    Hrecine = 0.85
    Vrecine = Vrecine / 1000
    say2 = 0
    Form2.Show()


    Do


    Hrecine = Hrecine + 0.05
    cap2 = Math.Sqrt((4 * Vrecine) / (Math.PI * Hrecine))
    Alan = (Math.PI * cap2 ^ 2) / 4
    Form2.ListView1.Items.Add(Math.Round(cap2, 2))


    Form2.ListView1.Items(say2).SubItems.add(Math.Round(Alan, 2))
    Form2.ListView1.Items(say2).SubItems.add(Hrecine)


    say2 = say2 + 1


    Loop Until (Hrecine >= 1.8)


    THIS PART OF THE CODE RECIEVE ERROR


    Form2.ListView1.Items(say2).SubItems.add(Math.Round(Alan, 2))
    Form2.ListView1.Items(say2).SubItems.add(Hrecine)


    Can anyone know this?
    Last edited by jmcilhinney; 04-11-2012 at 11:05 PM. Reason: Added [xcode=vb.net] tags for readability

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    11,339
    Reputation
    1543
    I have formatted your code for readability. Please do so for us in future posts.

    If there's an error then there's an error message, which will tell you (and us) what to look for.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking