Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7927401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:17:35+00:00 2026-06-03T19:17:35+00:00

I bought the book Visual Basic.net Core Reference by Francesco Balena and was hoping

  • 0

I bought the book Visual Basic.net Core Reference by Francesco Balena and was hoping to learn Visual basic, but I’m already having problem on my first console code sample from the book. Do you think the book is too old and the samples are no longer compatible with today’s VB.net anymore? The compiler is prompting that I’m missing Sub Main(), but the sample in Francesco’s book doesn’t have Sub Main()

Module MathFunctions 
'A public constant
Public Const DoublePI as Double = 6.2831853
'A private array
    Private factValues(169) As Double
'Return the factorial of a number in the range 0-169
    Public Function Factorial(ByVal n As Integer) As Double
'evvaluate all possible values in advance during the first call.
        If factValues(0) = 0 Then
            Dim i As Integer
            factValues(0) = 1
            For i = 1 To 169
                factValues(i) = factValues(i - 1) * CDbl(i)
            Next
        End If
'check the argument
        If n >= 0 And n <= 169 Then
'return the value in the array if argument is in range
            Factorial = factValues(n)
        Else
'raise an error otherwise
            Err.Raise(6, , "Overflow")
        End If
    End Function
      'The following code block (except End Module) is what I added to the code sample, but I'm still not getting any output from the console
    Sub Main()
     Factorial(32)
    End Sub
    End Module
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:17:37+00:00Added an answer on June 3, 2026 at 7:17 pm

    The program is executing absolutely fine.

    What you are probably expecting is to see the returned value from your function – however, you have not output it anywhere.

    If you change your Main to the following, you will see a result:

    Sub Main()
     Console.WriteLine(Factorial(32))
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to learn more about Spring.NET, I bought the book Spring in Action,
I mainly do .Net development but have just bought an Apple Mac Book Pro
I bought a book on Hibernate. I wanted to learn on what Hibernate is
I have tried to work this out myself (even bought a Kindle book!), but
In my feeble attempt to learn JavaScript, I bought a book which teaches you
I already bought a good book on Python 2.5. Should I return it and
I've recently bought 'Smashing jQuery' by Jake Rutter - it's a good book, but
I recently bought Bob's book Delphi XML, SOAP & Web Services in page 85
I bought the O'Reilly Dojo book by Matthew Russell. It says in your toolkit
I bought The D Programming Language a little while ago. Great book, very educational.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.