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 9315691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:25:56+00:00 2026-06-19T02:25:56+00:00

I may simply misunderstand the difference between the two: If the only difference between

  • 0

I may simply misunderstand the difference between the two: If the only difference between a subroutine and a function is that a function has the option of returning a value while a subroutine does not, then in what situation would you use a subroutine? Why wouldn’t you always use a function?

  • 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-19T02:25:57+00:00Added an answer on June 19, 2026 at 2:25 am

    I use Subs when I need a ‘named piece of code’ that does not return any information, but is called only for its side effects. I use Functions when I need a ‘named piece of code’ that returns some information (and (normally) does not have side effects). I’m glad that I can state my intentions in VBScript explicitly.

    Added: Why @AutomatedChaos’ proposal (comment) is misguided:

    1. You shouldn’t write code before your design is settled. Either you don’t need to check the result of a file delete action (then write a Sub) or you have to (then write a Function). You may later realize that you have made a mistake, but then you’ll have to change more than just the npc’s type.
    2. Checking an action’s result in a Function is a promise that your script will always handle a failure of the action reasonably (because each call of the Function is obliged to check the return value). To freely give the license to call such a Function as a Sub invalidates this promise.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What would be the difference between matching like: fun(Binary) -> [Value, Rest] = binary:split(Binary,
This is a rather complicated question that may simply be impossible with what's currently
So my task may sound simple, but it has me boggled. I have looked
I like to ask something that may be simple and stupid, but I can't
That may be really simple but I'm unable to find a good answer. How
I'm fairly new to Knockout.js so I may simply be missing something. I'm trying
What are the Runtime exceptions and what are Checked/Unchecked Exceptions and difference between Error/Exception.Why
This may simply be a matter of preference, however, I am interested to know
This may be simply idiotic, but for me it's a bit confusing: In [697]:
You may have noticed that certain web applications (for example, certain parts of GMail)

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.