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

  • Home
  • SEARCH
  • 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 1105417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:37:47+00:00 2026-05-17T01:37:47+00:00

Here are two ways of calling callscript (in pseudocode): using duplicate calls if flag

  • 0

Here are two ways of calling callscript (in pseudocode):

using duplicate calls

if flag == true
    flag = false
    callscript
    flag = true
else
    callscript
endif

using an extra variable

flag2 = flag
flag = false
callscript
flag = flag2

conditions

  • I have to make sure is that flag is false when the script is called.
  • Also, the flag value has to be restored to the original value.

Is there a better way to do this than these two? If not, which one of these is a better choice?

  • 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-17T01:37:48+00:00Added an answer on May 17, 2026 at 1:37 am

    The best would be to send the flag along in the call, so that the relation between the flag and the method is clear:

    callscript(false)
    

    If that’s not an option, and you have to choose between the two, then either one would do. There is no clear winner, readability is about the same for both, so it’s just a matter of taste.

    The second option would be the better one if the actual call is complicated so that you don’t want to repeat it in the code, or if the data type is something more complicated than a boolean.

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

Sidebar

Related Questions

Here are two ways to make a NSString . NSString *sBody = [NSString stringWithString:@Hello]
For example, here are two ways to set an integer variable (say C++): int
How can I make my C# app erase itself (self-destruct)? Here's two ways that
Here's two ways of doing string substitution: name = Tshepang my name is {}.format(name)
Relative JS newbie here trying to understand the difference between two ways of defining
Here are two queries that return the same resultset, but which is the optimal
Here's two screen shots, showing the effect with a small viewport that has to
Here is two variants. First: int n = 42; int* some_function(int* input) { int*
Here is two my variants of method, which returns a string, associated with enum
I've got a test site here with two columns, both with absolute positioning. http://dl.dropbox.com/u/17844821/zeug/heighttest.html

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.