# Use of ifdef homeyscripts

**URL:** <https://community.homey.app/t/use-of-ifdef-homeyscripts/112821>\
**Category:** Flows\
**Created:** [July 13, 2024, 6:53am UTC](https://community.homey.app/t/use-of-ifdef-homeyscripts/112821 "2024-07-13T06:53:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheKos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/thekos/32/33969_2.png) [@TheKos](https://community.homey.app/u/TheKos)\
**Post date:** [July 13, 2024, 6:53am UTC](https://community.homey.app/t/use-of-ifdef-homeyscripts/112821/1 "2024-07-13T06:53:05Z")

</div>

In my arduino projects is use #IFDEF to set debug actions. Now I know this is different from homeyscript, since Arduino uses a compiler, and homey not.  
But I am looking for something similar to e.g,  
#define DEBUG

#ifdef DEBUG  
#DEBUG\_PRINT(x) log(“Welcome to debugger”,x)  
#else  
#DEBUG\_PRINT(x) log(“nothing to debug”)  
#endif  
This of course does not work, since #IFDEF is a compiler instruction, but is there an alternative

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [July 13, 2024, 8:09am UTC](https://community.homey.app/t/use-of-ifdef-homeyscripts/112821/2 "2024-07-13T08:09:42Z")

</div>

There is no `DEBUG` (or equivalent) in HomeyScript anyway.

---

<div class="post-metadata">

**Author:** ![Rmb](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rmb/32/79135_2.png) [@Rmb](https://community.homey.app/u/Rmb)\
**Post date:** [July 13, 2024, 8:23am UTC](https://community.homey.app/t/use-of-ifdef-homeyscripts/112821/3 "2024-07-13T08:23:11Z")

</div>

You define a variable at the beginning of your code. And where applicable you insert some code like:  
If debug== TRUE then log(“debug info”);
