Embedding comments within loops

If you want to embed a comment (REM) within a loop, such as @FOR, you will get an error. I've found a away around that. Simply insert a string without any kind of REM prefix. The string is syntactically correct, and the compiler accepts it. It just has no effect on the result.

For example, the following code would generate an error:

@FOR (cnt:=1; cnt<10; 
cnt:=cnt +1;

REM "This is a remark";
myvalue := myvalue + 1;
)

Instead, use the following:

@FOR (cnt:=1; cnt<10; 
cnt:=cnt +1;

"This is a remark";
myvalue := myvalue + 1;
)

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Ralph Bacon. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

This was first published in June 2004

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.