Electronic – How to comment at the end of a command in LTspice

ltspicespice

Commenting in a spice file is quite straightforward. Start a line with an * and the entire line is a comment. The first line is comment by default. An example is as follows:

* This is how your write a comment in a spice file

That much is clear from the following references:
http://newton.ex.ac.uk/teaching/cdhw/Electronics2/userguide/sec2.html
http://www.ecircuitcenter.com/Basics.htm
http://home.olemiss.edu/~atef/engr360/tutorial/qgspice.html

However, I have been unsuccessful so far in finding a reference, which explains how to add comments at the end of a line. The third link mentions the use of ; but it is unclear about it. For example:

R1 3 4 1K ; Is this a comment?

In LTspice (and in spice in general) is it a frowned upon practice to add comments at the end of the line?

Best Answer

SPICE is not a well-standardized netlist description language. Every SPICE can introduce it's own syntax, special symbols, circuit elements, etc. Historically, only full-line comments were used ('*' in the first column), but there's no reason some particular SPICE might not allow ';' to introduce an end-of-line comment.

From the LTSpice Help file, under the heading "General Structure and Conventions':

Any line starting with a "*" is a comment and is ignored. The line starting with "R1" declares that there is a 1K resistor connected between nodes n1 and n2. Note that the semicolon, ";", can be used to start a comment in the middle of a line.

So LTSpice does, indeed, allow end-of-line comments starting with a semicolon.