Page 1 of 1

Commenting out a line of a multiline script block

Posted: Thu Jul 14, 2016 1:09 pm
by [-hh]
If someone of you didn't realize this until now as I did:
Comments after the line continuation char "\" in multiline strings/commands are allowed.
(I learned that in another thread here.)

So I gradually have found by that a method to comment out a line of a multiline block:
Just prepend the line with "\--" (or "\#" or "\//"):

Code: Select all

function hallo
  return "" & \
        \-- "I am a commented line" &cr& \
        "See you later alligator!"
end hallo

function decisionRule p,q,r
  return ((p is not r) and (q is not r)) \
         \-- OR ((p is q) and (q is r)) \ 
        OR ((p is r) and (q is not p))
end decisionRule
It's so obvious, I gave up too early when the usual prepending of "--" didn't work.

Re: Commenting out a line of a multiline script block

Posted: Thu Jul 14, 2016 8:43 pm
by mwieder
Great! This solves an ongoing problem for me. Thanks.