Quartus® Prime Pro Edition User Guide: Scripting

ID 683432
Date 7/08/2024
Public
Document Table of Contents

2.9.10. Syntax and Comments

Arguments to Tcl commands are separated by white space, and Tcl commands are terminated by a newline character or a semicolon. You must use backslashes when a Tcl command extends more than one line. The backslash (\) must be the last character in the line to designate line extension. If the backslash is followed by any other character including a space, that character is treated as a literal.

Tcl uses the hash or pound character (#) to begin comments. The # character must begin a comment. If you prefer to include comments on the same line as a command, be sure to terminate the command with a semicolon before the # character. The following example is a valid line of code that includes a set command and a comment.

set a 1;# Initializes a

Without the semicolon, the command is invalid because the set command does not terminate until the new line after the comment.

The Tcl interpreter counts curly braces inside comments, which can lead to errors that are difficult to track down. The following example causes an error because of unbalanced curly braces.

# if { $x > 0 } {
if { $y > 0 } {
	# code here
}