Database development and training for Birmingham and the midlands
Specialists in Microsoft Access and Visual Foxpro database training and development
I am happy to hear from existing clients but I am taking no new calls.
Visual Basic and Visual FoxPro comments
VBA' or Rem |
VFP*, && or Note |
Visual Basic Syntax Notes
VBA still recognises REM 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 ' A comment in another line
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 ' to the start of each line. Highlight the lines and click the button to remove the comments.
button on the Edit toolbar. This will add a single quoteNote 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 NOTE marker from dBase II to mark a line as a comment. As with the VB REM 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 && A comment in another line
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 *!* combination and it will only clear comments which start with these characters. It will not clear your own comments.
to mark a block comment or to clear it. Fox marks each line with a specialThis 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.