Epi Info™ User Guide

Command Reference


Comments

Description
Allows entering user-defined comments identifying a task or defining variable names to the programmer.  Comments are also useful for troubleshooting programs and Check Code by instructing Classic Analysis or Enter to ignore the commented lines.  Use comments to disable commands.

Check Code Syntax

//  <single line of commented text>

/*
<one or more lines of commented text>
*/

Classic Analysis Syntax

***  <single line of commented text>

Comments
Check Code:   To comment a single line of text, begin the line with the double-slash comment.  //
All text on the same line following the double-slash comment will be ignored.

To comment several lines of text or block of commands, begin the block with comment starting tag–  slash-asterisk:    /*
The comment starting tag should be in the first column of the editor.
Close the comment block with the comment ending tag–  asterisk-slash:   */

Classic Analysis:   To comment a single line of text, begin the line with three asterisks.   ***
The three asterisks should begin in the first column of the editor.  All text following the three asterisks *** will be ignored.
To comment several lines of text or a block of commands, begin each line with three asterisks  ***.

Check Code Examples
Example 1: Comments are used to document the purpose of a sub-routine.

Sub ErrorMessage1
    DIALOG "The date entered is invalid." TITLETEXT="Date Error"
End-Sub

Field DOB
   After
      IF DOB > SYSTEMDATE THEN
         //The following sub-routine calls the Date Error message.
         CALL ErrorMessage1
      END-IF
   End-After
End-Field

Example 2: Comments are used to note the date of the code’s generation date, purpose, and author.

/* Written by Demmy Epiologist, MPH
   Date Completed – 06/30/2018  	
   The block of code below uses the YEARS function.
*/ 
ASSIGN AGE = YEARS(DOB, SYSTEMDATE)

Example 3: Comments are used to disable certain commands from executing.

/* The next few lines are incomplete and are commented for later 	
DEFINE PatientID Numeric – Note: need to determine ID should be a Text type variable.  	
LIST – ToDo: need to add the field names to the list 
*/

Classic Analysis Examples

Example 4:  The WRITE command that appears within the IF consequence is temporarily commented and replaced with a simple DIALOG while the IF condition is tested.  All lines beginning with *** are commented and will be ignored with the commands are run.

READ {config:Sample.prj}:Oswego
SELECT ILL = (+)
IF RECORDCOUNT < 50 THEN
*** the following line is temporarily commented.
*** WRITE APPEND "Epi7" {Provider=Microsoft.Jet.OLEDB.4.0;Data Source=".\Projects\Sample\Sample.mdb"} : ILLCases *
    DIALOG "The Record Count is less than 50."
END
Page last reviewed: September 16, 2022, 12:00 pm