Adding comments in C# or VFP
C# Syntax Notes
Comments in C# are similar to those in C, Java and Javascript. There are two
styles:
marks a single line and the matching pair
and
mark a block of comments. Such a block can cover anything from a few characters
within a line of code to several lines of code.
The
marker can be used at the start of a line or in the middle
of a line.
SqlConnection con = new SqlConnection(conString);
con.Open();
The danger with the block style of comment is that any mistake in the
closing tag means that all the text until the next correctly-formed
closing tag will be accidentally turned into a comment.
VFP Syntax Notes
There are three styles of comment in Visual FoxPro. The
and
markers are similar. They must be at the start of a line and they mark that entire
line as a comment:
The
style dates from dBaseII and is only supported in Visual FoxPro for
backwards compatibility. Comments written in this way can be very
difficult to understand because you tend to include the word "Note"
when you're reading them.
The third style of FoxPro comment uses a double ampersand
This can be placed anywhere in a line and marks the start of a comment which
runs to the end of the line
SELECT
0
USE
customer
Visual FoxPro does not have a style of comment which will
mark a block in a program but you can select several lines
of text, right-click, and select
to indentify them as comments. This tool uses
to mark the comments so you can easily see which code
has been remmed out in this way. The
option on the right-click menu will remove the
comment marks in the text selected.
Arrays
|
Language index
|
Constants
|