Comments in Apex programs?

TripleT

Active member
Is there a way to comment out lines in a program?

Like C++, where you can use //comment or /*comment*/ for example?
 
It would come in handy for longer programs, to remind you of your original intent.

And... for enabling/disabling statements temporarily during testing/tweaking.

Anybody else want to vote for this feature?
 
As already stated, you can't do comments. However, it is possible to effectively disable commands. Since the Apex executes top to bottom, you can just add the new code at the end. The only exception would be Defer and Min Time that always execute last regardless of position. So for example:


[Heater]
If Temp < 78.0 Then ON
If Temp > 80.0 Then OFF

If Temp < 76.0 Then ON
If Temp > 78.0 Then OFF

The code in blue is superceded by the later code. However, I do think comments would be useful.

Todd
 
Back
Top