Comments

Comments are sections of code that FormCalc does not execute. Typically comments contain information or instructions that explain the use of a particular fragment of code. FormCalc ignores all information stored in comments at run time.

You can specify a comment by using either a semi-colon (;) or a pair of slashes (//). In FormCalc, a comment extends from its beginning to the next line terminator.

Character name

Representations

Comment

;

//

For example:

    // This is a type of comment 
    First_Name="Tony" 
    Initial="C" ;This is another type of comment 
    Last_Name="Blue"

Commenting all FormCalc calculations on an event

Commenting all of the FormCalc calculations for a particular event generates an error when you preview your form in the Preview PDF tab or when you view the final PDF. Each FormCalc calculation is required to return a value, and FormCalc does not consider comments to be values.

To prevent the commented FormCalc code from returning an error, you must do one of the following actions:

  • Remove the commented code from the event

  • Add an expression that returns a value to the FormCalc code on the event

To prevent the value of the expression from producing unwanted results on your form, use one of the following types of expressions:

  • A simple expression consisting of a single character, as shown in the following example:

        // First_Name="Tony" 
        // Initial="C" 
        // Last_Name="Blue" 
        // 
        // The simple expression below sets the value of the event to zero. 
        0
  • An assignment expression that retains the value of the object. Use this type of expression if your commented FormCalc code is located on the calculate event to prevent the actual value of the object from being altered, as shown in the following example:

        // First_Name="Tony" 
        // Initial="C" 
        // Last_Name="Blue" 
        // 
        // The assignment expression below sets the value of the current 
        // field equal to itself. 
        $.rawValue = $.rawValue

// Ethnio survey code removed