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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:38:28+00:00 2026-05-27T17:38:28+00:00

during programming with VBScript I write a lot of error-check code in functions before

  • 0

during programming with VBScript I write a lot of error-check code in functions before function start to do actions. So, if some pre-reqierements wan’t met, then I do “Exit Function”. So, for example:

public fucnton func
   if not condition then
     func = -1
     exit function
   End If
   'Other conditions with exit functions
   'Then long code goes here
   ..........
   ..........
   ..........
   func = res
End Function

So, I can exit from function in multiple points. Is this good way to do? In this case I will get long else branches of if statement

Maybe it is better to write:

public fucnton func
    if not condition then
        func = -1
    Else
        'Then long code goes here
        ..........
        ..........
        ..........
    End If  
End Function

Please, share your thoughts.

  • 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-05-27T17:38:28+00:00Added an answer on May 27, 2026 at 5:38 pm

    I’ve used ‘if (badParameters) then exit’ style of coding for decades. If nothing else, the actual ‘long code’ that does the work is not pushed off the right-hand side of the edit window by a massive ‘if/then/else’ ladder. The ladder makes the code look messier and more complex than it actually is and impedes readability.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

During a typical day programming, I implement functions in a way that I would
I've used recursion quite a lot during my many years of programming to solve
At some point during my C programming adventures on Linux, I encountered flags (possibly
I'm doing some GPGPU programming with OpenGL. I want to be able to write
There's a lot of Text editors which support autocomplete during programming, but I want
I've painfully learned during last few days a lot about programming in c++. I
This problem has happened to me twice.Both times during programming with Borland C++.when i
This is one of the programming questions asked during written test from Microsoft. I
How do we create multiple thread during runtime in C programming language? If we
I hope this is programming-related enough. What exactly happens during the shutdown process of

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.