Is there a way to check is a task, function or variable exists in NXC? I know that in PHP you can use isset() to check if a variable exists and function_exists() to do the same for a function, but is there a way to do that in NXC? I am specifically wanting to check if a task exists.
Last edited by bungeshea on 04 May 2014, 00:07, edited 1 time in total.
No, there is no such thing. NXC is a static typed language, if a task, function or variable do not exist, it will not compile. PHP is dynamically typed, so it is not always the case.
I'm not quite sure what you are trying to do. You might be able to do something with conditional compilation using the #if or #ifdef of the preprocessor, but this is at compile time and not runtime like isset().