What to put in empty if statement?
The short story is I need to allow an if statement to be empty. Since SublimeKSP gives me an error when an if statement is empty, I need to put something in there to satisfy it. I could declare a dummy variable and write to it, but I don't want to declare anything extraneous like that. What is a good fast, low memory instruction I can put in my empty if statement?
Best Answer
-
You can always do an i = i thing as a sort of a no-op. But with this sKSP option disabled you don't have to do anything, just leave the branch empty.
0
Answers
-
There's an option in SublimeKSP not to warn on empty if/case statements.
0 -
Very cool, I did not know about that. Thanks
SublimeKSP's warning says that an empty if statement is equivalent to invoking the "exit" function. I haven't used the exit function personally yet, but the manual says it exits functions or callbacks. There's a good chance that I don't want to do that either. If that is the case, then do I have any other recourse than to put a filler statement in my otherwise empty if statement?
0 -
You can always do an i = i thing as a sort of a no-op. But with this sKSP option disabled you don't have to do anything, just leave the branch empty.
0
Categories
- All Categories
- 19 Welcome
- 1.5K Hangout
- 62 NI News
- 785 Tech Talks
- 4.1K Native Access
- 16.6K Komplete
- 2K Komplete General
- 4.3K Komplete Kontrol
- 5.7K Kontakt
- 1.6K Reaktor
- 379 Battery 4
- 846 Guitar Rig & FX
- 429 Massive X & Synths
- 1.3K Other Software & Hardware
- 5.8K Maschine
- 7.3K Traktor
- 7.3K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators