KB: Resolving "Unterminated String" and "Comma Expected" Errors in Altium Designer
Solution Details
Unterminated String Error

Why This Happens
This error occurs when one or more design rules contain incomplete or improperly formatted expressions. It often results from missing quotation marks or syntax errors in rule definitions.
What to Do
- Review all design rules for incomplete or invalid expressions, and ensure they are corrected to comply with proper syntax.
How to Do It
- Navigate to Design » Rules in Altium Designer.
- Identify any rules highlighted in red. These indicate invalid entries.
- Review the syntax of each highlighted rule.
- Correct any incomplete expressions or missing characters.
- Save and recompile the project.
Comma Expected Error

Why This Happens
This error can occur due to the following reasons:
- Incorrect use of quotation marks in the design rule's formatted expression. If quotation marks are placed improperly within the rule syntax, Altium Designer may misinterpret the expression, leading to a parsing error.
- When quotation marks are used in object names such as nets, footprints, pads, or other design elements targeted by design rules. Altium Designer does not support the use of quotation marks in these names, especially when they are referenced in design rules.
Note on Use of Single Quotation Marks in Altium Designer Query Language: In Altium Designer's query language, string values must be enclosed in single quotation marks ('). This syntax is essential for correctly identifying and filtering objects based on text-based properties such as names, comments, layers, or parameters.
Valid Example:
InNet('LCD_Light')
This query correctly uses single quotation marks to define the string literal.
Invalid Examples:
InNet('Paul's LCD_Light')
InNet('LCD_Light)
InNet(''LCD_Light'')
The first expression will result in a syntax error because the parser interprets 'Paul' as one string and s LCD_Light' as invalid syntax. The two other examples are invalid syntax as well.
What to Do
- Review all design rules for incomplete or invalid expressions, and ensure they are corrected to comply with proper syntax.
-
Check for and remove quotation marks from the affected object names and update the PCB document to reflect these changes. Then, redefine the design rule definitions for the affected objects to ensure they reference the corrected names.
How to Do It
If the error is caused by quotation marks used in object names, follow the steps outlined below to correct the issue.
- Review your design for object names (e.g., nets, ports) that contain quotation marks.
- Remove any quotation marks from these names.
- Open Design » Rules and inspect rule definitions for misplaced quotes.
- Correct the syntax to eliminate unnecessary quotation marks.
- Save and recompile the project to verify resolution.