Results 1 to 18 of 18

Thread: Anyone know Visual Basic??

  1. #1
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default Anyone know Visual Basic??

    I am taking a VB class and have 3 assignments left. I am VERY lost and need some help...The teacher is no help what-so-ever.

    So VB experts out there?
    There's no trim like a 50 trim....oh wait!

  2. #2
    VDUB BiH1320's Avatar
    Join Date
    Feb 2006
    Location
    Lawrenceville
    Age
    36
    Posts
    3,199
    Rep Power
    24

    Default

    nop sorry

  3. #3
    The One and Only Nemesis's Avatar
    Join Date
    Apr 2005
    Location
    Buckhead
    Age
    42
    Posts
    25,171
    Rep Power
    62

    Default

    What do you need help with exactly, PM me if you want, but Ill try to answer it tommorrow while im at work..

  4. #4
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default

    Thanks man, PM sent

    If you can solve the problems, I'll buy you a 12 pack of beer! Or Coke (if your a non drinker)
    There's no trim like a 50 trim....oh wait!

  5. #5
    When negotiations fail... Ruiner's Avatar
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Age
    49
    Posts
    4,631
    Rep Power
    28

    Default

    Quote Originally Posted by superfox1
    I am taking a VB class and have 3 assignments left. I am VERY lost and need some help...The teacher is no help what-so-ever.

    So VB experts out there?
    Back in '98, I took a midterm VB test drunk as shit in college. It was Cinco De Mayo and I had forgotten that I had a test. I had 2 or 3 hours between classes, so my buddy and I hit the bars and pounded a few (too many). I showed up to the class (it was in Athens, so the bars are 100 yds from the North Campus Business classes).

    I still got a 97 or 98, booyaaa!
    Last edited by Ruiner; 08-29-2007 at 06:59 AM.
    AIM: RuinerTT
    2005 Nissan Pathfinder LE

  6. #6
    ⎝⏠⏝⏠⎠ RandomGuy's Avatar
    Join Date
    Jan 2004
    Location
    GA
    Posts
    18,981
    Rep Power
    150

    Default

    yeah

    <pm me if no one else comes thru

    senior year in high school i placed 2nd place in the state in VB6 - out of 500 competitors (never messed with .net but i'm sure I could pick it up with ease) at some youth leadership conference (fbla bullshit) they flew me in to denver to compete at nationals.

  7. #7
    I miss Atlanta. Sol-Badguy's Avatar
    Join Date
    Dec 2006
    Location
    No
    Age
    38
    Posts
    9,232
    Rep Power
    31

    Default

    I did back in High School.

    I forgot it now. I haven't touched it in a few years.

  8. #8
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default

    Quote Originally Posted by RandomGuy
    yeah

    <pm me if no one else comes thru

    senior year in high school i placed 2nd place in the state in VB6 - out of 500 competitors (never messed with .net but i'm sure I could pick it up with ease) at some youth leadership conference (fbla bullshit) they flew me in to denver to compete at nationals.
    sweet! Hell, in High School, I did the BASIC language...thats how old I am. I can do HTML all day long and I work with Linux boxes for a living, but can't figure this out...I got someone workingon it now, but I'll let you know
    There's no trim like a 50 trim....oh wait!

  9. #9
    When negotiations fail... Ruiner's Avatar
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Age
    49
    Posts
    4,631
    Rep Power
    28

    Default

    Quote Originally Posted by superfox1
    sweet! Hell, in High School, I did the BASIC language...thats how old I am. I can do HTML all day long and I work with Linux boxes for a living, but can't figure this out...I got someone workingon it now, but I'll let you know
    I remember using BASIC back in high school as well. Shit we ARE old. :rofl:

    Hell, I remember back when I had TYPING class that were on actual type-writers.
    AIM: RuinerTT
    2005 Nissan Pathfinder LE

  10. #10
    IA KING
    Join Date
    Nov 2002
    Location
    Atlanta
    Posts
    14,745
    Rep Power
    150

    Default

    i work w/ .net daily but i'm slammed man

  11. #11
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default

    Quote Originally Posted by Ruiner
    I remember using BASIC back in high school as well. Shit we ARE old. :rofl:

    Hell, I remember back when I had TYPING class that were on actual type-writers.

    I remember that! During typing class, we would get to hop on the old 386's and play Oregon Trail on Fridays.

    I learned to type from those classes..and will always remember "asdfghjkl;"
    There's no trim like a 50 trim....oh wait!

  12. #12
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default

    Quote Originally Posted by admin
    i work w/ .net daily but i'm slammed man
    np!

    This isn't .net...not sure what the difference is...hehe shows how much I know about it!
    There's no trim like a 50 trim....oh wait!

  13. #13
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default

    The first problem is I have written a program that will allow users to enter any number of rainfall amounts. I need it to calculate and display the total rainfall amount and the average rainfall amount. I have to break it down into 2 seperate functions.

    This is what I have so far:

    Option Explicit On
    Option Strict On

    Public Class MainForm

    Private Function CalcAverage(ByRef raincounter As Integer, ByRef rainAccum As Integer, ByVal avgRain As Integer)
    ' Calculates average rainfall amount
    avgRain = (rainAccum + raincounter) / 2

    Return avgRain
    Call CalcAverage(rainAccum, raincounter)
    End Function


    Private Function CalcTotal(ByVal rainCounter As Decimal, ByVal rainAccum As Decimal) As Decimal
    ' calculates the total
    rainAccum = rainCounter + rainAccum



    Return rainAccum

    Call CalcTotal(rainCounter, rainAccum)

    End Function



    Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
    Me.Close()
    End Sub


    Private Sub xMonthlyTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles xMonthlyTextBox.KeyPress
    ' accept numbers, the period, and the Backspace

    If (e.KeyChar < "0" OrElse e.KeyChar > "9") _
    AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then
    e.Handled = True
    End If
    End Sub

    Private Sub xMonthlyTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles xMonthlyTextBox.TextChanged
    Me.xTotalLabel.Text = String.Empty
    Me.xAverageLabel.Text = String.Empty
    End Sub

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub xCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalcButton.Click
    Dim rainAccum As Decimal
    Dim avgRain As Decimal

    Me.xTotalLabel.Text = rainAccum.ToString("n2")
    Me.xAverageLabel.Text = avgRain.ToString("n2")
    End Sub
    End Class






    The next one I have to write a program that will allow users to enter in a 5 digit number with the 5th digit being the check digit. What needs to happen is the user enters in the 5 digit code...every other number is multiplied by 2...then add the numbers together, take the last digit and add it to the end of the first number set to check if it is the correct number...then I need it to display if it is correct or incorrect.

    I know it sounds confusing..here is an example

    Original number: 1357
    multiply every other number by 2: 1 3 5 7
    *2 *2
    Results: 1 6 5 14

    Add the numbers together: 1+6+5+14 = 26

    new number: 13576
    six would be my check digit.




    Here is what I have so far:


    Option Explicit On
    Option Strict On

    Public Class MainForm

    Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
    Me.Close()
    End Sub

    Private Sub xNumberTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles xNumberTextBox.Enter
    Me.xNumberTextBox.SelectAll()
    End Sub

    Private Sub xNumberTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles xNumberTextBox.KeyPress
    If (e.KeyChar < "0" OrElse e.KeyChar > "9") _
    AndAlso e.KeyChar <> ControlChars.Back Then
    e.Handled = True
    End If
    End Sub

    Private Sub xNumberTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles xNumberTextBox.TextChanged
    Me.xMessageLabel.Text = String.Empty
    End Sub

    End Class
    There's no trim like a 50 trim....oh wait!

  14. #14
    IA's Blonde Guy Jecht's Avatar
    Join Date
    May 2006
    Location
    Smyrna
    Age
    38
    Posts
    7,182
    Rep Power
    30

    Default

    If you can't do anything with Visual Basic, I suggest you don't pursue a career related to computers.

  15. #15
    ⎝⏠⏝⏠⎠ RandomGuy's Avatar
    Join Date
    Jan 2004
    Location
    GA
    Posts
    18,981
    Rep Power
    150

    Default

    Quote Originally Posted by superfox1
    The first problem is I have written a program that will allow users to enter any number of rainfall amounts. I need it to calculate and display the total rainfall amount and the average rainfall amount. I have to break it down into 2 seperate functions.

    This is what I have so far:

    Option Explicit On
    Option Strict On

    Public Class MainForm

    Private Function CalcAverage(ByRef raincounter As Integer, ByRef rainAccum As Integer, ByVal avgRain As Integer)
    ' Calculates average rainfall amount
    avgRain = (rainAccum + raincounter) / 2

    Return avgRain
    Call CalcAverage(rainAccum, raincounter)
    End Function


    Private Function CalcTotal(ByVal rainCounter As Decimal, ByVal rainAccum As Decimal) As Decimal
    ' calculates the total
    rainAccum = rainCounter + rainAccum



    Return rainAccum

    Call CalcTotal(rainCounter, rainAccum)

    End Function



    Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
    Me.Close()
    End Sub


    Private Sub xMonthlyTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles xMonthlyTextBox.KeyPress
    ' accept numbers, the period, and the Backspace

    If (e.KeyChar < "0" OrElse e.KeyChar > "9") _
    AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then
    e.Handled = True
    End If
    End Sub

    Private Sub xMonthlyTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles xMonthlyTextBox.TextChanged
    Me.xTotalLabel.Text = String.Empty
    Me.xAverageLabel.Text = String.Empty
    End Sub

    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub xCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalcButton.Click
    Dim rainAccum As Decimal
    Dim avgRain As Decimal

    Me.xTotalLabel.Text = rainAccum.ToString("n2")
    Me.xAverageLabel.Text = avgRain.ToString("n2")
    End Sub
    End Class






    The next one I have to write a program that will allow users to enter in a 5 digit number with the 5th digit being the check digit. What needs to happen is the user enters in the 5 digit code...every other number is multiplied by 2...then add the numbers together, take the last digit and add it to the end of the first number set to check if it is the correct number...then I need it to display if it is correct or incorrect.

    I know it sounds confusing..here is an example

    Original number: 1357
    multiply every other number by 2: 1 3 5 7
    *2 *2
    Results: 1 6 5 14

    Add the numbers together: 1+6+5+14 = 26

    new number: 13576
    six would be my check digit.




    Here is what I have so far:


    Option Explicit On
    Option Strict On

    Public Class MainForm

    Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
    Me.Close()
    End Sub

    Private Sub xNumberTextBox_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles xNumberTextBox.Enter
    Me.xNumberTextBox.SelectAll()
    End Sub

    Private Sub xNumberTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles xNumberTextBox.KeyPress
    If (e.KeyChar < "0" OrElse e.KeyChar > "9") _
    AndAlso e.KeyChar <> ControlChars.Back Then
    e.Handled = True
    End If
    End Sub

    Private Sub xNumberTextBox_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles xNumberTextBox.TextChanged
    Me.xMessageLabel.Text = String.Empty
    End Sub

    End Class
    i only read the top part, but to clarify

    you are trying to make a prog that will calculate the total and average rainfall amounts right?

    in this function:

    Private Function CalcAverage(ByRef raincounter As Integer, ByRef rainAccum As Integer, ByVal avgRain As Integer)
    ' Calculates average rainfall amount
    avgRain = (rainAccum + raincounter) / 2

    Return avgRain
    Call CalcAverage(rainAccum, raincounter)
    End Function

    its referring to rain counter (i'm assuming thats the total number of entries added, and rainaccum = (rain accumulated?)= ?

    I don't know about you but an easier way to do it would be to use an array man.

    It would make everything so much easier for you. I'm not going to do your homework for you man but its mad easy just learn it.

    Heres some pseudo code to point you into the right direction

    declare an array (for the amount of rain)
    in the procedure for the button, make it store the contents of the input box into a new element of this array

    for example, say you have ran this prog, it will store

    rain(0) = 5
    rain(1) = 10
    rain(2) = 7

    ok got it? then the index(which is the number in the parenthesis of the variable) + 1 = the total number of entries you added right?

    so add up all of the elements of the array, and divide by (index + 1) of the variable.

    theres the average.

    to calculate the rainfall total, just simply add up all of the elements of the array

  16. #16
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default

    Quote Originally Posted by RandomGuy
    i only read the top part, but to clarify

    you are trying to make a prog that will calculate the total and average rainfall amounts right?


    I don't know about you but an easier way to do it would be to use an array man.

    It would make everything so much easier for you. I'm not going to do your homework for you man but its mad easy just learn it.

    Heres some pseudo code to point you into the right direction

    declare an array (for the amount of rain)
    in the procedure for the button, make it store the contents of the input box into a new element of this array
    I cant do an array...not allowed.... have to do two seperate functions to calculate the total and average rainfall. I am completely lost. This is an online class and the teacher never answers any emails. Very frustrating. I got it all untill I got to this last part..now it is like I'm looking at a Chineese dictionary.
    There's no trim like a 50 trim....oh wait!

  17. #17
    Nappy Headed Hoe superfox1's Avatar
    Join Date
    Oct 2006
    Age
    50
    Posts
    128
    Rep Power
    20

    Default

    Quote Originally Posted by Jecht
    If you can't do anything with Visual Basic, I suggest you don't pursue a career related to computers.

    Thank you for that well thought out response..actually I already have a very nice career in computers!
    No VB needed!

    I am a Networking Engineer and use Linux boxes all day. VB doesnt even come into my vocabulary.

    I am not in school to get a degree, I already have one. I am going to school to get the rest of my GI BIll. It ends in December..this is the last set of classes I will take
    There's no trim like a 50 trim....oh wait!

  18. #18
    ⎝⏠⏝⏠⎠ RandomGuy's Avatar
    Join Date
    Jan 2004
    Location
    GA
    Posts
    18,981
    Rep Power
    150

    Default

    Quote Originally Posted by superfox1
    The first problem is I have written a program that will allow users to enter any number of rainfall amounts. I need it to calculate and display the total rainfall amount and the average rainfall amount. I have to break it down into 2 seperate functions.

    code seems like vb.net but still very similar
    or your teacher is reallllly picky haha


    hrm no arrays? haha ok still very doable
    well first thing is that you mixed up your variable passing in the function (byref and byvals) when you pass a variable to a procedure with byref, you can fuck with the value and what not, but if you send it byval, then once you're out of the procedure then shit restores back to normal.


    i'm assuming rainaccum is the value inputed
    why not make a variable called avg1
    also totalrain

    try something along these lines:

    Option Explicit On
    Option Strict On

    first thing first the variables: declare avg1, rainaccum, and totalrain and initialize 'em to 0.


    Public Class MainForm

    Private Function CalcAverage(ByVal rainaccum As Integer, ByRef avg1 As Integer)
    ' Calculates average rainfall amount
    avg1 = (rainAccum + avg1) / 2 ((just get add the value of the entered info the the existing average, and then divide out, much like we do with grades haha)
    Return avg1
    Call CalcAverage(rainAccum, avg1) [why not call the function from the click event ... it doesnt specify what type of function was needed]
    End Function
    ok so now whenever you call calcaverage with those parameters, it'll take the current average, add the new value to it, then divide by two, giving you the current average

    Private Function CalcTotal(ByRef TotalRain As Decimal, ByVal rainAccum As Decimal)
    ' calculates the total
    totalrain = totalrain + rainAccum

    Return totalrain

    Call CalcTotal(totalrain, rainAccum)[same as above]

    End Function



    if u still aren't following:

    make the procedure for the button pass the .text property of the textbox to the variable rainaccum

    then in that sub, call calcaverage and pass rainaccum and avg1 to it
    it'll calculate

    then call calc total with totalrain and rain accum passed to it




    after all thats done, in the sub for the click event on the button,
    make it output the data however you do it
    like label1.caption = aksldajsdk or whatever

    and make it do what you want


    but yeah Its late so i'm sure i overlooked something but yeah as for the second one it looks long i dont even feel like reading it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
ImportAtlanta is a community of gearheads and car enthusiasts. It does not matter what kind of car or bike you drive, IA is an open community for any gearhead. Whether you're looking for advice on a performance build or posting your wheels for sale, you're welcome here!
Announcement
Welcome back to ImportAtlanta. We are currently undergoing many changes, so please report any issues you encounter with the site using the 'Contact Us' button below. Thank you!