• Lucid Dreaming - Dream Views




    Results 1 to 11 of 11

    Hybrid View

    1. #1
      Member Achievements:
      1 year registered Created Dream Journal Tagger Second Class Veteran First Class 5000 Hall Points
      Tavasion's Avatar
      Join Date
      Jun 2006
      LD Count
      a vivid few
      Gender
      Location
      Earth
      Posts
      283
      Likes
      67
      DJ Entries
      3

      Need help with Visual Basic, NOW!!!

      ive attached the example of the program.

      i cant get William & Keeper to show up. i select it, then hit caluclate, and it wont show up. Debug says it cant find the file, although i have it in the Debug folder. everything wlse works fine, just William and Keeper. here is the code. and i have to submit this by 12 tonight. it is now....7:47 pm.

      Code:
      Private Sub btncalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalc.Click
      
              Dim file, customer, status As String
              Dim sr As IO.StreamReader
      
              If (cboCustomer.Text = "William & Keeper") Then
                  file = "org1.txt"
              ElseIf (cboCustomer.Text = "Joshemine Company") Then
                  file = "org2.txt"
              ElseIf (cboCustomer.Text = "McColling Foundation") Then
                  file = "org3.txt"
              Else
                  file = "org1.txt"
                  MsgBox("No customer selected. Option A will be used.", MsgBoxStyle.Exclamation, "Caution")
              End If
      
      
              sr = IO.File.OpenText(file)
              customer = sr.ReadLine
              status = sr.ReadLine
              sr.Close()
      
              Dim hours As Double
              hours = CDbl(txtHours.Text)
      
              Dim total, base, overage As Double
      
      
              If rad1.Checked Then
                  base = (9.95)
                  overage = ((hours - 10) * 2)
                  total = base + overage
              ElseIf rad2.Checked Then
                  base = (14.95)
                  overage = (hours - 20)
                  total = base + overage
              ElseIf rad3.Checked Then
                  base = (19.95)
                  total = base
              End If
      
      
              If (cboCustomer.Text = "McColling Foundation") Then
                  total = total - (total * 0.2)
              End If
      
      
              Dim fmtStr As String = "{0,-20}{1,7}{2,7}{3,12}"
              lstDisplay.Items.Add(String.Format(fmtStr, "Name", "Hours", "Status", "Bill"))
      
      
              If (cboCustomer.Text = "William & Keeper") Then
                  lstDisplay.Items.Add(String.Format(fmtStr, "William & Keeper", hours, status, FormatCurrency(total)))
              ElseIf (cboCustomer.Text = "Joshemine Company") Then
                  lstDisplay.Items.Add(String.Format(fmtStr, "Joshemine Company", hours, status, FormatCurrency(total)))
              ElseIf (cboCustomer.Text = "McColling Foundation") Then
                  lstDisplay.Items.Add(String.Format(fmtStr, "McColling Foundation", hours, status, FormatCurrency(total)))
              End If
      
      
      
          End Sub
      
      End Class
      Attached Files
      Last edited by Tavasion; 09-30-2009 at 01:47 AM.


      The evening hangs beneath the moon, a silver thread on darkened dune.
      With closing eyes and resting head; I know that sleep is coming soon.

      Upon my pillow, safe in bed,
      A thousand pictures fill my head,

      I cannot sleep , my mids aflight;
      and yet my limbs seems made of lead.
      ---Whitacre's Sleep---

    2. #2
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Mind posting it again usign the [code][/code] tags so that we can see the indentation.

    3. #3
      Member Achievements:
      1 year registered Created Dream Journal Tagger Second Class Veteran First Class 5000 Hall Points
      Tavasion's Avatar
      Join Date
      Jun 2006
      LD Count
      a vivid few
      Gender
      Location
      Earth
      Posts
      283
      Likes
      67
      DJ Entries
      3
      done.
      Last edited by Tavasion; 09-30-2009 at 01:53 AM.


      The evening hangs beneath the moon, a silver thread on darkened dune.
      With closing eyes and resting head; I know that sleep is coming soon.

      Upon my pillow, safe in bed,
      A thousand pictures fill my head,

      I cannot sleep , my mids aflight;
      and yet my limbs seems made of lead.
      ---Whitacre's Sleep---

    4. #4
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Been a very long time since I did any form of basic but I'm missing something. Where is cboCustomer defined?

    5. #5
      Member Achievements:
      1 year registered Created Dream Journal Tagger Second Class Veteran First Class 5000 Hall Points
      Tavasion's Avatar
      Join Date
      Jun 2006
      LD Count
      a vivid few
      Gender
      Location
      Earth
      Posts
      283
      Likes
      67
      DJ Entries
      3
      i dont think it needs to be.
      Last edited by Tavasion; 09-30-2009 at 02:25 AM.


      The evening hangs beneath the moon, a silver thread on darkened dune.
      With closing eyes and resting head; I know that sleep is coming soon.

      Upon my pillow, safe in bed,
      A thousand pictures fill my head,

      I cannot sleep , my mids aflight;
      and yet my limbs seems made of lead.
      ---Whitacre's Sleep---

    6. #6
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      It has to be defined somewhere.

    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
    •