Date: Wed, 19 Sep 2001 11:23:15 -0500
Reply-To: "Smith, Curtis, Mr, DCAA" <Curtis.Smith@DCAA.MIL>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Smith, Curtis, Mr, DCAA" <Curtis.Smith@DCAA.MIL>
Subject: Re: SAS Comments
Content-Type: text/plain; charset="iso-8859-1"
I agree with John. Using the /* */ is so much quicker when needing to
comment blocks of code. But, I have been burned many times by inadvertently
nesting the comment markers.
-----Original Message-----
From: John Whittington [mailto:John.W@MEDISCIENCE.CO.UK]
Sent: Wednesday, September 19, 2001 9:14 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: SAS Comments
At 13:13 19/09/01 +0100, Roland wrote (in part):
>If you use /* then this won't cause you a problem */ Everything between
>the slash-aster and the aster-slash will be ignored. But * this'll cause
>you a problem ; because it contains a single unmatched quote and SAS will
>expect it to be a comment and will scan through looking for the quote to
>end it. /* */ is safer than using * ; .
Roland, there I have to disagree with you. An unmatched quote within a
*...; type of comment is no problem. After the asterisk, SAS treats EVERY
character it finds as being part of the comment until it hits the next
semicolon - hence, it is perfectly safe to put ANYTHING in a *...; type of
comment EXCEPT for a semicolon. By analogy, it is perfectly safe to put
anything other than */ inside of a /*...*/ type of comment.
As for the relative 'safety' of the two approaches, I again have to
disagree with you. Like many other people I know, I virtually never use
the /*...*/ type of comment, because of the serious potential hazard caused
by their 'un-nestability'. Rightly or wrongly, /*...*/ is often used to
'comment out' blocks of code during testing/development, and that can
result in chaos if there are /*...*/ comments within the block of code in
question. I therefore virtually always use *...; - UNLESS I need to have a
semicolon within the comment; in all other situations, I regard *...; as
being 'safer'.
That's how I see it, anyway.
Kind Regards
John
----------------------------------------------------------------
Dr John Whittington, Voice: +44 (0) 1296 730225
Mediscience Services Fax: +44 (0) 1296 738893
Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk
Buckingham MK18 4EL, UK mediscience@compuserve.com
----------------------------------------------------------------
|