How To Temporarily Disable/Pause a Single Line of Code Without Modifying It?


#1

1) Give a description of the problem
I want to temporarily disable a condition in one of my pistons, but I want to leave the coding exactly how it is, and just make it not active.

2) What is the expected behavior?
Become disabled, but while still sitting there, in the same place, just as it was before.

3) What is happening/not happening?
For now, I modified the code to make it effectively disabled (e.g. in this case, it was configured to limit activity to between sunset and sunrise, and I simply changed it to ‘Time Is Any’), and put a note in that line’s comment field to remind myself to modify it back to how it was before once I’m finished with my current testing/troubleshooting on this particular piston.

I know I can also just create a copy of the piston, and temporarily Pause the original while I’m modifying the copy, and all that, but I was looking for a way of just temporarily ‘pausing’ one specific line of code without having to do all that.

No big deal if this can’t be done.
Just checking. :slight_smile:

4) Post a Green Snapshot of the piston![image|45x37]
NA

5) Attach any logs (From [ST IDE]
NA

REMOVE BELOW AFTER READING


#2

Click on the statement you want to disable, then the gear cog at the bottom to expose settings, and then there is a Disable option.

In some cases it can’t be done on a single line and a block of code needs to be disabled together. For example, you can’t disable one line in a multi-condition IF statement. In those instances, I just right click on the statement, choose duplicate statement, and then disable the original and modify to copy to the way I want it to be.

image


#3

One workaround I do since we cannot comment out a single line is to create a dummy disabled statement, I then drag the single line of code that I want to disable into that dummy statement :smiley:


I can't disable any part of my code (comment/rem)
#4

I’m not sure if my webCoRE is corrupt, or if I’m losing my mind (HA!), or if it’s different depending on whether it’s a condition or a trigger, or what, but when I go there, there is no such disable option.

Oh, wait…when I go up to the ‘with’ item, it shows up in the cog there…just not when I go to the cog in any of the ‘do’ items themselves.

So, I guess that’s because there are multiple ‘do’ items then?

Ya, I guess I will use a combination of duplicating sections and whole pistons for this.

Thanks, guys. :slight_smile: