&& Command
Indicates the beginning of a nonexecuting inline comment in a program file.
&& [Comments]
Parameters
- && [ Comments]
Specifies inline comments that follow.
Remarks
Inserting inline comments to denote the end of the IF ... ENDIF, DO, and FOR ... ENDFOR structured programming commands greatly improves the readability of programs when including many such structures.
Warning
Including double ampersands (&&) in a string literal, for example, "AAA&&BBB", generates an error. Instead, to include double ampersands, use concatenation as shown: "AAA&" + "&" + "BBB".
Note
When using concatenation, use caution with placement of a single ampersand (&), which is used to perform macro substitution and thus might produce undesirable results. For example, suppose you assign the string "YYY" to a variable, BBB. Performing concatenation using "AAA&" and "&BBB" replaces "BBB" with "YYY", so instead of getting the result "AAA&&BBB", the result is "AAA&YYY". For more information, see & Command.
To continue a comment on the following line, place a semicolon (;) at the end of the comment line to be continued.
Note
In earlier versions of Visual FoxPro, you cannot place && and a comment after the semicolon that is used to continue a command line to an additional line.
Example
The following example includes the inline comments "20 years of monthly payments" indicated by the && command:
STORE (20*12) TO gnPayments && 20 years of monthly payments
NOTE Initialize the page number;
variable.
STORE 1 to gnPageNum
* Set up the loop
DO WHILE gnPageNum <= 25 && loop 25 times
gnPageNum = gnPageNum + 1
ENDDO && DO WHILE gnPageNum <= 25