Check is task exists in NXC

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
bungeshea
Posts: 207
Joined: 14 Aug 2011, 08:45
Location: Australia
Contact:

Check is task exists in NXC

Post by bungeshea »

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.
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Check is task exists in NXC

Post by HaWe »

if a task exists or if it's alive?
spillerrec
Posts: 358
Joined: 01 Oct 2010, 06:37
Location: Denmark
Contact:

Re: Check is task exists in NXC

Post by spillerrec »

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().
My blog: http://spillerrec.dk/category/lego/
RICcreator, an alternative to nxtRICeditV2: http://riccreator.sourceforge.net/
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests