I need to add one more condition inside this call Staging..
how to do it in this condition.
#ifdef MYAPP_PRODUCTION buildMode = @"Production"; #else #ifdef MYAPP_RELEASE buildMode = @"Release"; #else MYAPP_DEBUG buildMode = @"Debug"; #endif #endif
another is MyApp_Staging
need to include in this if condition how to do this?
OR – =IF(OR(Something is True, Something else is True), Value if True, Value if False) NOT – =IF(NOT(Something is True), Value if True, Value if False)
if (score >= 90) grade = 'A'; The following example displays Number is positive if the value of number is greater than or equal to 0 . If the value of number is less than 0 , it displays Number is negative . if (number >= 0) printf("Number is positive\n"); else printf("Number is negative\n");
Use two if statements if both if statement conditions could be true at the same time. In this example, both conditions can be true. You can pass and do great at the same time. Use an if/else statement if the two conditions are mutually exclusive meaning if one condition is true the other condition must be false.
Yes, placing an if inside an else is perfectly acceptable practice but in most cases use of else if is clearer and cleaner.
You could do something like this to contain all the different options including the new Staging Mode and make the whole statement cleaner:
#ifdef MYAPP_PRODUCTION buildMode = @"Production"; #elif MYAPP_RELEASE buildMode = @"Release"; #elif MYAPP_DEBUG buildMode = @"Debug"; #elif MYAPP_STAGING buildMode = @"Staging"; #endif
Your question is not very clear... If you want multiple conditions in a #ifdef, here is a solution:
#if defined(MYAPP_RELEASE) && defined(MyApp_Staging) // ... #else // ... #endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With