CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 13 of 13

Threaded View

  1. #1
    Join Date
    Aug 2006
    Posts
    140

    How to Elegantly code an if()?

    How long does an if condition check take when the result is negative and the if won't need to run?

    I have an app that except for the first time it unnecessarily runs the "if" conditional check like several dozens of million times a day! Is there anyway to just run it once since after the first check it's state doesn't change anymore???

    In my Matlab coding, I'd handle such issues by having the first script do all the checking and set the one time variables and then call script 2 which would then call script 3 to script n accordingly but never returned to script 1 which was a single use script.
    How can one do the same in C# and how do you handle the one time issues and avoid putting them in your code snippet that needs to run say 50 million time / 24 hours?

    thanks
    Last edited by Cy_; January 6th, 2009 at 12:22 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured