Visual Basic and Visual FoxPro comments
Visual Basic Syntax Notes
VBA still recognises which has been used to
mark comments since the first days of BASIC but this is rarely used in new work.
The more common symbol in Visual Basic is the single quote to mark the
start of a comment. This can be at the start of the line of code or anywhere within
that line:
a = b + c
In both cases the comment runs from the quote to the end of the line.
There is no syntax
in Visual Basic to mark the beginning and end of a multi-line comment. If you do need to
comment out a block of code then highlight that code and use the
button on the Edit toolbar. This will add a
single quote to the start of each line. Highlight the
lines and click the button to remove the
comments.
Note that these two buttons might not be visible on your toolbar. If they are not there
then right-click and select to add them to the
toolbar.
Visual FoxPro Syntax Notes
FoxPro shows its age as much as Visual Basic because it still recognises the
marker from dBase II to mark a line as a comment. As
with the VB comment, this is very old-fashioned syntax
that is not used in new work.
Visual FoxPro uses two different markers for a comment that is a line of its own
and for a comment that is part of a program line. These markers are the asterisk
and the double ampersand
:
a = b + c
Like Visual Basic, Visual FoxPro does not have markers for the start and end of a block
of comments. The technique here is to highlight the lines to be commented, right-click
and then select to mark a block comment or
to clear it. Fox marks each line with a
special combination and it will only clear comments
which start with these characters. It will not clear your own comments.
This screenshot shows a block of SQL which has been commented out with the special
symbols but also shows some comments starting with
. This is purely a personal habit. I mark my comments
like this so that I can identify my own comments when I'm sharing the development work.
Arrays
|
Language index
|
Constants
|