1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Visual Basic Help

Discussion in 'Software Development' started by Rhino24, Mar 6, 2008.

Thread Status:
Not open for further replies.
  1. Rhino24

    Rhino24 Thread Starter

    Joined:
    Feb 8, 2008
    Messages:
    41
    Here is my code...The only error I am getting is a identifier expected after the "b" on Private Sub at the very top. Can anyone help me out??

    Private Sub
    btnFactorial_Click( _
    ByVal eventSender As System.Object, _
    ByVal eventArgs As System.EventArgs) _
    Handles btnFactorial.Click
    Dim x As Double
    Dim Fact As Double

    lblOutput.Text = "To determine the Factorial of a number. " _
    & "Please enter a number less than 10."
    & "Then, click on the Factorial Button to view the results."

    x = Val(txtInput.Text)

    Fact = Factorial(x)
    lblOutput.Text = ("")
    lblOutput.Text = (" " & x & "! is " & Fact)


    End Sub

    Private Function Factorial(ByRef x As Double) As Double


    If x <= 1 Then
    Factorial = 1
    Else
    Factorial = x * Factorial(x - 1)
    End If

    End Function

    End Class
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/690564

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice