KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Disabling code using If(False)...End if
PRODUCT: 4D | VERSION: 18 | PLATFORM: Mac & Win
Published On: July 6, 2021

When developing or debuging code, it can sometimes be useful to disable some code. Typically this can be quickly performed by commenting out the code after highlighting the desired lines. However, if the code needs to remain disabled for a while during development it can be better to disable the code by wrapping it in an If(False)... End if statement. This will make sure the code doesn't run but does not convert the code to comments allowing for other features of designer mode to apply such as compiler checks and specified searches.

For example if a search for a project method matching "myProjMethod" would not return a result for the following:

// myProjMethod

It would return a result it the code were still tokenized and disabled using an If(False)...End if statement:
If(False)
   myProjMethod
End if