Commenting out a line of a multiline script block

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm

Commenting out a line of a multiline script block

Post by [-hh] » Thu Jul 14, 2016 1:09 pm

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.
shiftLock happens

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Commenting out a line of a multiline script block

Post by mwieder » Thu Jul 14, 2016 8:43 pm

Great! This solves an ongoing problem for me. Thanks.

Post Reply