Top "If-statement" questions

An "if" statement is a flow control structure in most programming languages that branches execution flow depending on a binary condition, generally evaluated at runtime.

IF-ELSE statement shortcut in C

C has the following syntax for a shorthand IF-ELSE statement (integer == 5) ? (TRUE) : (FALSE); I often find myself requiring only one …

c if-statement shortcut
cmake if else with option

I have a problem using option together with if-else statement in cmake. project(test) option(TESTE "isso é um teste" OFF) …

if-statement cmake cmakelists-options
How to check if a defined constant exists in PHP?

So I'm using a PHP framework called fuelphp, and I have this page that is an HTML file, so I …

php if-statement constants fuelphp
Assignment in an if statement

I have a class Animal, and its subclass Dog. I often find myself coding the following lines: if (animal is …

c# casting if-statement
Case insensitive string comparison

I would like to compare two variables to see if they are the same, but I want this comparison to …

php if-statement case-insensitive
MySQL INSERT IF (custom if statements)

First, here's the concise summary of the question: Is it possible to run an INSERT statement conditionally? Something akin to …

mysql concurrency insert if-statement race-condition
Two conditions in one if statement does the second matter if the first is false?

Okay, so I have this piece of code tested and I found there isn't any exception thrown out. public static …

java if-statement conditional-statements
Javascript - check if div contains a word?

How can I check if a div contains a certain word? var divs= document.getElementsByTagName('div'); for (var i = 0, len = …

javascript html if-statement contains
Blade view: if statement with OR/AND condition

Is it possible in Laravel 4.0 -blade-view to do an if statment like so? @if ($var1 === '1' OR $var2 === '1…

php if-statement view laravel-4 blade
PHP - exit from IF block

How can I exit a if block if a certain condition is met? I tried using break but it doesn't …

php if-statement conditional exit