Index: query/tutor_cli.html =================================================================== --- query/tutor_cli.html (revision 30426) +++ query/tutor_cli.html (revision 30427) @@ -1,9 +1,9 @@ -

advanced search, command line tutorial: query language

+

advanced search, command line tutorial: query language

-

scope

+

scope

pcb-rnd from version 1.1.3 features a flexible advanced search that helps the user selecting/unselecting objects that match a given logical expression. @@ -19,7 +19,7 @@ wizard when using the GTK HID. A separate tutorial is dealing with that feature. -

Actions

+

Actions

The query(act, expr) action creates the list called "@", which contains all objects of the design. Then it iterates over this list (if needed) and evaluates the query expression on each object. For each evaluation "act" @@ -60,7 +60,7 @@ specify the query expression only, without quotes - the reader should add the query(eval, ' ') part. -

iteration vs. evaluate once

+

iteration vs. evaluate once

If an expression does not reference the @ object, no iteration is performed and the expression is ran only once:
@@ -75,7 +75,7 @@
 all instances of @ are substituted with the same object in that iteration.
 
 
-

grammar: arithmetics and logics

+

grammar: arithmetics and logics

For example the integer and floating point numbers and the usual arithmetic and logical operators work as expected: @@ -95,7 +95,7 @@ 4 > 2 1 because four is greater than two; all the usual relational operators work: == is equal, != is not-equal, <, <=, > and >=. -

grammar: object properties

+

grammar: object properties

Object have named properties, e.g. the thickness of a line (or arc, or trace in general) is called ".thickness", so the thickness of the current object is: @@ -124,7 +124,7 @@ (@.thickness != 8 mil) && (@.thickness != 10 mil) && (@.thickness != 15 mil)
-

grammar: invalid value

+

grammar: invalid value

But how comes an expression like '@.thickness > 10 mil' works while @ iterates over non-trace objects, like layers, nets or subcircuits that clearly have no thickness? @@ -145,7 +145,7 @@ actual object doesn't have the feature needed. If the expression is wrong, an error is generated and the expression stops evaluating immediately. -

grammar: more properties

+

grammar: more properties

Some properties are a single numeric value, like thickness, or the .name of a layer (which is a string) but others are objects. For example the .layer property of a line or arc refers to the layer