File: eagle_en.htm

package info (click to toggle)
eagle 5.10.0-2
  • links: PTS
  • area: non-free
  • in suites: squeeze
  • size: 88,616 kB
  • ctags: 720
  • sloc: makefile: 33; sh: 24
file content (17399 lines) | stat: -rw-r--r-- 682,490 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
<html>
<head>
<title>EAGLE Help Version 5.10.0</title>
<style type="text/css"><!-- h1 { background-color: #CCCCCC; color: #0050B0; } pre { background-color: #EEEEEE; } mb { font-weight: bold; font-family: courier; background-color: #EEEEEE; }--></style>
</head>
<body>
<table width=100% cellspacing=0 border=0><tr>
<td align=left>EAGLE Help Version 5.10.0</td>
<td align=right><font size=-1>
<i>Copyright &copy; 2010 CadSoft Computer GmbH</i>
</font></td></tr></table>

<h1>Index</h1>
<ul>
<li><a href=#1>General Help</a>
<li><a href=#2>Configuring EAGLE</a>
<li><a href=#3>Command Line Options</a>
<li><a href=#4>Quick Introduction</a>
<ul>
<li><a href=#5>Control Panel and Editor Windows</a>
<li><a href=#6>Entering Parameters and Values</a>
<li><a href=#7>Drawing a Schematic</a>
<li><a href=#8>Checking the Schematic</a>
<li><a href=#9>Generating a Board from a Schematic</a>
<li><a href=#10>Checking the Layout</a>
<li><a href=#11>Creating a Library Device</a>
</ul>
<li><a href=#12>Control Panel</a>
<ul>
<li><a href=#13>Context Menus</a>
<li><a href=#14>Directories</a>
<li><a href=#15>Backup</a>
<li><a href=#16>User Interface</a>
<li><a href=#17>Window positions</a>
<li><a href=#18>Check for Update</a>
</ul>
<li><a href=#19>Keyboard and Mouse</a>
<ul>
<li><a href=#20>Selecting objects in dense areas</a>
</ul>
<li><a href=#21>Editor Windows</a>
<ul>
<li><a href=#22>Library Editor</a>
<ul>
<li><a href=#23>Edit Library Object</a>
</ul>
<li><a href=#24>Board Editor</a>
<li><a href=#25>Schematic Editor</a>
<li><a href=#26>Text Editor</a>
</ul>
<li><a href=#27>Editor Commands</a>
<ul>
<li><a href=#28>Command Syntax</a>
<li><a href=#29>ADD</a>
<li><a href=#30>ARC</a>
<li><a href=#31>ASSIGN</a>
<li><a href=#32>ATTRIBUTE</a>
<li><a href=#33>AUTO</a>
<li><a href=#34>BOARD</a>
<li><a href=#35>BUS</a>
<li><a href=#36>CHANGE</a>
<li><a href=#37>CIRCLE</a>
<li><a href=#38>CLASS</a>
<li><a href=#39>CLOSE</a>
<li><a href=#40>CONNECT</a>
<li><a href=#41>COPY</a>
<li><a href=#42>CUT</a>
<li><a href=#43>DELETE</a>
<li><a href=#44>DESCRIPTION</a>
<li><a href=#45>DISPLAY</a>
<li><a href=#46>DRC</a>
<li><a href=#47>EDIT</a>
<li><a href=#48>ERC</a>
<li><a href=#49>ERRORS</a>
<li><a href=#50>EXPORT</a>
<li><a href=#51>FRAME</a>
<li><a href=#52>GATESWAP</a>
<li><a href=#53>GRID</a>
<li><a href=#54>GROUP</a>
<li><a href=#55>HELP</a>
<li><a href=#56>HOLE</a>
<li><a href=#57>INFO</a>
<li><a href=#58>INVOKE</a>
<li><a href=#59>JUNCTION</a>
<li><a href=#60>LABEL</a>
<li><a href=#61>LAYER</a>
<li><a href=#62>LOCK</a>
<li><a href=#63>MARK</a>
<li><a href=#64>MENU</a>
<li><a href=#65>MIRROR</a>
<li><a href=#66>MITER</a>
<li><a href=#67>MOVE</a>
<li><a href=#68>NAME</a>
<li><a href=#69>NET</a>
<li><a href=#70>OPEN</a>
<li><a href=#71>OPTIMIZE</a>
<li><a href=#72>PACKAGE</a>
<li><a href=#73>PAD</a>
<li><a href=#74>PASTE</a>
<li><a href=#75>PIN</a>
<li><a href=#76>PINSWAP</a>
<li><a href=#77>POLYGON</a>
<li><a href=#78>PREFIX</a>
<li><a href=#79>PRINT</a>
<li><a href=#80>QUIT</a>
<li><a href=#81>RATSNEST</a>
<li><a href=#82>RECT</a>
<li><a href=#83>REDO</a>
<li><a href=#84>REMOVE</a>
<li><a href=#85>RENAME</a>
<li><a href=#86>REPLACE</a>
<li><a href=#87>RIPUP</a>
<li><a href=#88>ROTATE</a>
<li><a href=#89>ROUTE</a>
<li><a href=#90>RUN</a>
<li><a href=#91>SCRIPT</a>
<li><a href=#92>SET</a>
<li><a href=#93>SHOW</a>
<li><a href=#94>SIGNAL</a>
<li><a href=#95>SMASH</a>
<li><a href=#96>SMD</a>
<li><a href=#97>SPLIT</a>
<li><a href=#98>TECHNOLOGY</a>
<li><a href=#99>TEXT</a>
<li><a href=#100>UNDO</a>
<li><a href=#101>UPDATE</a>
<li><a href=#102>USE</a>
<li><a href=#103>VALUE</a>
<li><a href=#104>VIA</a>
<li><a href=#105>WINDOW</a>
<li><a href=#106>WIRE</a>
<li><a href=#107>WRITE</a>
</ul>
<li><a href=#108>Generating Output</a>
<ul>
<li><a href=#109>Printing</a>
<ul>
<li><a href=#110>Printing a Drawing</a>
<li><a href=#111>Printing a Text</a>
<li><a href=#112>Printer Page Setup</a>
</ul>
<li><a href=#113>CAM Processor</a>
<ul>
<li><a href=#114>Main CAM Menu</a>
<li><a href=#115>CAM Processor Job</a>
<li><a href=#116>Output Device</a>
<ul>
<li><a href=#117>Device Parameters</a>
<ul>
<li><a href=#118>Aperture Wheel File</a>
<li><a href=#119>Aperture Emulation</a>
<li><a href=#120>Aperture Tolerances</a>
<li><a href=#121>Drill Rack File</a>
<li><a href=#122>Drill Tolerances</a>
<li><a href=#123>Offset</a>
<li><a href=#124>Printable Area</a>
<li><a href=#125>Pen Data</a>
</ul>
<li><a href=#126>Defining Your Own Device Driver</a>
</ul>
<li><a href=#127>Output File</a>
<li><a href=#128>Flag Options</a>
<li><a href=#129>Layers and Colors</a>
</ul>
<li><a href=#130>Outlines data</a>
</ul>
<li><a href=#131>Autorouter</a>
<li><a href=#132>Design Checks</a>
<ul>
<li><a href=#133>Design Rules</a>
</ul>
<li><a href=#134>Cross-references</a>
<ul>
<li><a href=#135>Cross-reference labels</a>
<li><a href=#136>Part cross-references</a>
<li><a href=#137>Contact cross-references</a>
</ul>
<li><a href=#138>User Language</a>
<ul>
<li><a href=#139>Writing a ULP</a>
<li><a href=#140>Executing a ULP</a>
<li><a href=#141>Syntax</a>
<ul>
<li><a href=#142>Whitespace</a>
<li><a href=#143>Comments</a>
<li><a href=#144>Directives</a>
<ul>
<li><a href=#145>#include</a>
<li><a href=#146>#require</a>
<li><a href=#147>#usage</a>
</ul>
<li><a href=#148>Keywords</a>
<li><a href=#149>Identifiers</a>
<li><a href=#150>Constants</a>
<ul>
<li><a href=#151>Character Constants</a>
<li><a href=#152>Integer Constants</a>
<li><a href=#153>Real Constants</a>
<li><a href=#154>String Constants</a>
<li><a href=#155>Escape Sequences</a>
</ul>
<li><a href=#156>Punctuators</a>
<ul>
<li><a href=#157>Brackets</a>
<li><a href=#158>Parentheses</a>
<li><a href=#159>Braces</a>
<li><a href=#160>Comma</a>
<li><a href=#161>Semicolon</a>
<li><a href=#162>Colon</a>
<li><a href=#163>Equal Sign</a>
</ul>
</ul>
<li><a href=#164>Data Types</a>
<ul>
<li><a href=#165>char</a>
<li><a href=#166>int</a>
<li><a href=#167>real</a>
<li><a href=#168>string</a>
<li><a href=#169>Type Conversions</a>
<li><a href=#170>Typecast</a>
</ul>
<li><a href=#171>Object Types</a>
<ul>
<li><a href=#172>UL_ARC</a>
<li><a href=#173>UL_AREA</a>
<li><a href=#174>UL_ATTRIBUTE</a>
<li><a href=#175>UL_BOARD</a>
<li><a href=#176>UL_BUS</a>
<li><a href=#177>UL_CIRCLE</a>
<li><a href=#178>UL_CLASS</a>
<li><a href=#179>UL_CONTACT</a>
<li><a href=#180>UL_CONTACTREF</a>
<li><a href=#181>UL_DEVICE</a>
<li><a href=#182>UL_DEVICESET</a>
<li><a href=#183>UL_ELEMENT</a>
<li><a href=#184>UL_FRAME</a>
<li><a href=#185>UL_GATE</a>
<li><a href=#186>UL_GRID</a>
<li><a href=#187>UL_HOLE</a>
<li><a href=#188>UL_INSTANCE</a>
<li><a href=#189>UL_JUNCTION</a>
<li><a href=#190>UL_LABEL</a>
<li><a href=#191>UL_LAYER</a>
<li><a href=#192>UL_LIBRARY</a>
<li><a href=#193>UL_NET</a>
<li><a href=#194>UL_PACKAGE</a>
<li><a href=#195>UL_PAD</a>
<li><a href=#196>UL_PART</a>
<li><a href=#197>UL_PIN</a>
<li><a href=#198>UL_PINREF</a>
<li><a href=#199>UL_POLYGON</a>
<li><a href=#200>UL_RECTANGLE</a>
<li><a href=#201>UL_SCHEMATIC</a>
<li><a href=#202>UL_SEGMENT</a>
<li><a href=#203>UL_SHEET</a>
<li><a href=#204>UL_SIGNAL</a>
<li><a href=#205>UL_SMD</a>
<li><a href=#206>UL_SYMBOL</a>
<li><a href=#207>UL_TEXT</a>
<li><a href=#208>UL_VIA</a>
<li><a href=#209>UL_WIRE</a>
</ul>
<li><a href=#210>Definitions</a>
<ul>
<li><a href=#211>Constant Definitions</a>
<li><a href=#212>Variable Definitions</a>
<li><a href=#213>Function Definitions</a>
</ul>
<li><a href=#214>Operators</a>
<ul>
<li><a href=#215>Bitwise Operators</a>
<li><a href=#216>Logical Operators</a>
<li><a href=#217>Comparison Operators</a>
<li><a href=#218>Evaluation Operators</a>
<li><a href=#219>Arithmetic Operators</a>
<li><a href=#220>String Operators</a>
</ul>
<li><a href=#221>Expressions</a>
<ul>
<li><a href=#222>Arithmetic Expression</a>
<li><a href=#223>Assignment Expression</a>
<li><a href=#224>String Expression</a>
<li><a href=#225>Comma Expression</a>
<li><a href=#226>Conditional Expression</a>
<li><a href=#227>Function Call</a>
</ul>
<li><a href=#228>Statements</a>
<ul>
<li><a href=#229>Compound Statement</a>
<li><a href=#230>Expression Statement</a>
<li><a href=#231>Control Statements</a>
<ul>
<li><a href=#232>break</a>
<li><a href=#233>continue</a>
<li><a href=#234>do...while</a>
<li><a href=#235>for</a>
<li><a href=#236>if...else</a>
<li><a href=#237>return</a>
<li><a href=#238>switch</a>
<li><a href=#239>while</a>
</ul>
</ul>
<li><a href=#240>Builtins</a>
<ul>
<li><a href=#241>Builtin Constants</a>
<li><a href=#242>Builtin Variables</a>
<li><a href=#243>Builtin Functions</a>
<ul>
<li><a href=#244>Character Functions</a>
<ul>
<li><a href=#245>is...()</a>
<li><a href=#246>to...()</a>
</ul>
<li><a href=#247>File Handling Functions</a>
<ul>
<li><a href=#248>fileerror()</a>
<li><a href=#249>fileglob()</a>
<li><a href=#250>Filename Functions</a>
<li><a href=#251>Filedata Functions</a>
<li><a href=#252>File Input Functions</a>
<ul>
<li><a href=#253>fileread()</a>
</ul>
</ul>
<li><a href=#254>Mathematical Functions</a>
<ul>
<li><a href=#255>Absolute, Maximum and Minimum Functions</a>
<li><a href=#256>Rounding Functions</a>
<li><a href=#257>Trigonometric Functions</a>
<li><a href=#258>Exponential Functions</a>
</ul>
<li><a href=#259>Miscellaneous Functions</a>
<ul>
<li><a href=#260>Configuration Parameters</a>
<li><a href=#261>country()</a>
<li><a href=#262>exit()</a>
<li><a href=#263>fdlsignature()</a>
<li><a href=#264>language()</a>
<li><a href=#265>lookup()</a>
<li><a href=#266>palette()</a>
<li><a href=#267>sort()</a>
<li><a href=#268>status()</a>
<li><a href=#269>system()</a>
<li><a href=#270>Unit Conversions</a>
</ul>
<li><a href=#271>Network Functions</a>
<ul>
<li><a href=#272>neterror()</a>
<li><a href=#273>netget()</a>
<li><a href=#274>netpost()</a>
</ul>
<li><a href=#275>Printing Functions</a>
<ul>
<li><a href=#276>printf()</a>
<li><a href=#277>sprintf()</a>
</ul>
<li><a href=#278>String Functions</a>
<ul>
<li><a href=#279>strchr()</a>
<li><a href=#280>strjoin()</a>
<li><a href=#281>strlen()</a>
<li><a href=#282>strlwr()</a>
<li><a href=#283>strrchr()</a>
<li><a href=#284>strrstr()</a>
<li><a href=#285>strsplit()</a>
<li><a href=#286>strstr()</a>
<li><a href=#287>strsub()</a>
<li><a href=#288>strtod()</a>
<li><a href=#289>strtol()</a>
<li><a href=#290>strupr()</a>
<li><a href=#291>strxstr()</a>
</ul>
<li><a href=#292>Time Functions</a>
<ul>
<li><a href=#293>time()</a>
<li><a href=#294>timems()</a>
<li><a href=#295>Time Conversions</a>
</ul>
<li><a href=#296>Object Functions</a>
<ul>
<li><a href=#297>clrgroup()</a>
<li><a href=#298>ingroup()</a>
<li><a href=#299>setgroup()</a>
</ul>
<li><a href=#300>XML Functions</a>
<ul>
<li><a href=#301>xmlattribute(), xmlattributes()</a>
<li><a href=#302>xmlelement(), xmlelements()</a>
<li><a href=#303>xmltags()</a>
<li><a href=#304>xmltext()</a>
</ul>
</ul>
<li><a href=#305>Builtin Statements</a>
<ul>
<li><a href=#306>board()</a>
<li><a href=#307>deviceset()</a>
<li><a href=#308>library()</a>
<li><a href=#309>output()</a>
<li><a href=#310>package()</a>
<li><a href=#311>schematic()</a>
<li><a href=#312>sheet()</a>
<li><a href=#313>symbol()</a>
</ul>
</ul>
<li><a href=#314>Dialogs</a>
<ul>
<li><a href=#315>Predefined Dialogs</a>
<ul>
<li><a href=#316>dlgDirectory()</a>
<li><a href=#317>dlgFileOpen(), dlgFileSave()</a>
<li><a href=#318>dlgMessageBox()</a>
</ul>
<li><a href=#319>Dialog Objects</a>
<ul>
<li><a href=#320>dlgCell</a>
<li><a href=#321>dlgCheckBox</a>
<li><a href=#322>dlgComboBox</a>
<li><a href=#323>dlgDialog</a>
<li><a href=#324>dlgGridLayout</a>
<li><a href=#325>dlgGroup</a>
<li><a href=#326>dlgHBoxLayout</a>
<li><a href=#327>dlgIntEdit</a>
<li><a href=#328>dlgLabel</a>
<li><a href=#329>dlgListBox</a>
<li><a href=#330>dlgListView</a>
<li><a href=#331>dlgPushButton</a>
<li><a href=#332>dlgRadioButton</a>
<li><a href=#333>dlgRealEdit</a>
<li><a href=#334>dlgSpacing</a>
<li><a href=#335>dlgSpinBox</a>
<li><a href=#336>dlgStretch</a>
<li><a href=#337>dlgStringEdit</a>
<li><a href=#338>dlgTabPage</a>
<li><a href=#339>dlgTabWidget</a>
<li><a href=#340>dlgTextEdit</a>
<li><a href=#341>dlgTextView</a>
<li><a href=#342>dlgVBoxLayout</a>
</ul>
<li><a href=#343>Layout Information</a>
<li><a href=#344>Dialog Functions</a>
<ul>
<li><a href=#345>dlgAccept()</a>
<li><a href=#346>dlgRedisplay()</a>
<li><a href=#347>dlgReset()</a>
<li><a href=#348>dlgReject()</a>
<li><a href=#349>dlgSelectionChanged()</a>
</ul>
<li><a href=#350>Escape Character</a>
<li><a href=#351>A Complete Example</a>
</ul>
<li><a href=#352>Supported HTML tags</a>
</ul>
<li><a href=#353>Automatic Backup</a>
<li><a href=#354>Forward&amp;Back Annotation</a>
<ul>
<li><a href=#355>Consistency Check</a>
<li><a href=#356>Limitations</a>
</ul>
<li><a href=#357>Technical Support</a>
<li><a href=#358>License</a>
<ul>
<li><a href=#359>EAGLE License</a>
<li><a href=#360>EAGLE Editions</a>
</ul>
</ul>


<a name=1>
<h1>General Help</h1>
While inside a <a href=#24>board</a>,
<a href=#25>schematic</a>, or
<a href=#22>library</a> editor window,
pressing F1 or entering the command <tt>HELP</tt>
will open the help page for the currently active command.
<p>
You can also display an editor command's help page by entering
<pre>
HELP command
</pre>
replacing "command" with, e.g., <tt>MOVE</tt>, which would display the help
page for the MOVE command.
<p>
Anywhere else, pressing the F1 key will bring up a context sensitive
help page for the menu, dialog or action that is currently active.
<p>
For detailed information on how to get started with EAGLE please read the
following help pages:
<ul>
<li><a href=#4>Quick Introduction</a>
<li><a href=#2>Configuring EAGLE</a>
<li><a href=#3>Command Line Options</a>
<li><a href=#12>Control Panel</a>
</ul>


<a name=2>
<h1>Configuring EAGLE</h1>
Global EAGLE parameters can be adjusted in the
<a href=#12>Control Panel</a>.
<p>
The following editor commands can be used to customize the way EAGLE works.
They can be given either directly from an editor window's command line,
or in the <a href=#91>eagle.scr</a> file.
<h2>User Interface</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Command menu             </td><td width=20><td><a href=#64>MENU</a> command..;</td></tr>
<tr><td>Assign keys              </td><td width=20><td><a href=#31>ASSIGN</a> function_key command..;</td></tr>
<tr><td>Snap function            </td><td width=20><td><a href=#92>SET</a> SNAP_LENGTH number;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> CATCH_FACTOR value;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> SELECT_FACTOR value;</td></tr>
<tr><td>Content of menus         </td><td width=20><td><a href=#92>SET</a> USED_LAYERS name | number;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> WIDTH_MENU value..;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> DIAMETER_MENU value..;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> DRILL_MENU value..;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> SMD_MENU value..;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> SIZE_MENU value..;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> ISOLATE_MENU value..;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> SPACING_MENU value..;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> MITER_MENU value..;</td></tr>
<tr><td>Wire bend                </td><td width=20><td><a href=#92>SET</a> WIRE_BEND bend_nr;</td></tr>
<tr><td>Beep on/off              </td><td width=20><td><a href=#92>SET</a> BEEP OFF | ON;</td></tr>
</table>
<h2>Screen Display</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Color for grid lines     </td><td width=20><td><a href=#92>SET</a> COLOR_GRID color;</td></tr>
<tr><td>Color for layer          </td><td width=20><td><a href=#92>SET</a> COLOR_LAYER layer color;</td></tr>
<tr><td>Fill style for layer     </td><td width=20><td><a href=#92>SET</a> FILL_LAYER layer fill;</td></tr>
<tr><td>Grid parameter           </td><td width=20><td><a href=#92>SET</a> MIN_GRID_SIZE pixels;</td></tr>
<tr><td>Min. text size displayed </td><td width=20><td><a href=#92>SET</a> MIN_TEXT_SIZE size;</td></tr>
<tr><td>Display of net lines     </td><td width=20><td><a href=#92>SET</a> NET_WIRE_WIDTH width;</td></tr>
<tr><td>Display of pads          </td><td width=20><td><a href=#92>SET</a> DISPLAY_MODE REAL | NODRILL;</td></tr>
<tr><td>                         </td><td width=20><td><a href=#92>SET</a> PAD_NAMES OFF | ON;</td></tr>
<tr><td>Display of bus lines     </td><td width=20><td><a href=#92>SET</a> BUS_WIRE_WIDTH width;</td></tr>
<tr><td>DRC fill style           </td><td width=20><td><a href=#92>SET</a> DRC_FILL fill_name;</td></tr>
<tr><td>Polygon processing       </td><td width=20><td><a href=#92>SET</a> POLYGON_RATSNEST OFF | ON;</td></tr>
<tr><td>Vector font              </td><td width=20><td><a href=#92>SET</a> VECTOR_FONT OFF | ON;</td></tr>
</table>
<h2>Mode Parameters</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Package check            </td><td width=20><td><a href=#92>SET</a> CHECK_CONNECTS OFF | ON;</td></tr>
<tr><td>Grid parameters          </td><td width=20><td><a href=#53>GRID</a> options;</td></tr>
<tr><td>Replace mode             </td><td width=20><td><a href=#92>SET</a> REPLACE_SAME NAMES | COORDS;</td></tr>
<tr><td>UNDO Buffer              </td><td width=20><td><a href=#92>SET</a> UNDO_LOG OFF | ON;</td></tr>
<tr><td>Wire Optimizing          </td><td width=20><td><a href=#92>SET</a> OPTIMIZING OFF | ON;</td></tr>
<tr><td>Net wire termination     </td><td width=20><td><a href=#92>SET</a> AUTO_END_NET OFF | ON;</td></tr>
<tr><td>Automatic junctions      </td><td width=20><td><a href=#92>SET</a> AUTO_JUNCTION OFF | ON;</td></tr>
</table>
<h2>Presettings</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Pad shape                </td><td width=20><td><a href=#36>CHANGE</a> SHAPE shape;</td></tr>
<tr><td>Wire width               </td><td width=20><td><a href=#36>CHANGE</a> WIDTH value;</td></tr>
<tr><td>Pad/via diameter         </td><td width=20><td><a href=#36>CHANGE</a> DIAMETER diameter;</td></tr>
<tr><td>Pad/via/hole drill diam. </td><td width=20><td><a href=#36>CHANGE</a> DRILL value;</td></tr>
<tr><td>Smd size                 </td><td width=20><td><a href=#36>CHANGE</a> SMD width height;</td></tr>
<tr><td>Text height              </td><td width=20><td><a href=#36>CHANGE</a> SIZE value;</td></tr>
<tr><td>Text line width          </td><td width=20><td><a href=#36>CHANGE</a> RATIO ratio;</td></tr>
<tr><td>Text font                </td><td width=20><td><a href=#36>CHANGE</a> FONT font;</td></tr>
<tr><td>Polygon parameter        </td><td width=20><td><a href=#36>CHANGE</a> THERMALS OFF | ON;</td></tr>
<tr><td>Polygon parameter        </td><td width=20><td><a href=#36>CHANGE</a> ORPHANS OFF | ON;</td></tr>
<tr><td>Polygon parameter        </td><td width=20><td><a href=#36>CHANGE</a> ISOLATE distance;</td></tr>
<tr><td>Polygon parameter        </td><td width=20><td><a href=#36>CHANGE</a> POUR SOLID | HATCH;</td></tr>
<tr><td>Polygon parameter        </td><td width=20><td><a href=#36>CHANGE</a> RANK value;</td></tr>
<tr><td>Polygon parameter        </td><td width=20><td><a href=#36>CHANGE</a> SPACING distance;</td></tr>
</table>


<a name=3>
<h1>Command Line Options</h1>
You can call up EAGLE with command line parameters. Use the following format:
<pre>
eagle [ options [ filename [ layer ] ] ]
</pre>
<h2>Options</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>-Cxxx</tt></td>  <td width=20><td>execute the given Command</td></tr>
<tr><td><tt>-Dxxx</tt></td>  <td width=20><td>Draw tolerance (0.1 = 10%)</td></tr>
<tr><td><tt>-Exxx</tt></td>  <td width=20><td>Drill tolerance (0.1 = 10%)</td></tr>
<tr><td><tt>-Fxxx</tt></td>  <td width=20><td>Flash tolerance (0.1 = 10%)</td></tr>
<tr><td><tt>-N-</tt></td>    <td width=20><td>no command line prompts</td></tr>
<tr><td><tt>-O+</tt></td>    <td width=20><td>Optimize pen movement</td></tr>
<tr><td><tt>-Pxxx</tt></td>  <td width=20><td>plotter Pen (layer=pen)</td></tr>
<tr><td><tt>-Rxxx</tt></td>  <td width=20><td>drill Rack file</td></tr>
<tr><td><tt>-Sxxx</tt></td>  <td width=20><td>Scriptfile</td></tr>
<tr><td><tt>-Wxxx</tt></td>  <td width=20><td>aperture Wheel file</td></tr>
<tr><td><tt>-X-</tt></td>    <td width=20><td>eXecute CAM Processor</td></tr>
<tr><td><tt>-a-</tt></td>    <td width=20><td>emulate Annulus</td></tr>
<tr><td><tt>-c+</tt></td>    <td width=20><td>positive Coordinates</td></tr>
<tr><td><tt>-dxxx</tt></td>  <td width=20><td>Device (-d? for list)</td></tr>
<tr><td><tt>-e-</tt></td>    <td width=20><td>Emulate apertures</td></tr>
<tr><td><tt>-f+</tt></td>    <td width=20><td>Fill pads</td></tr>
<tr><td><tt>-hxxx</tt></td>  <td width=20><td>page Height (inch)</td></tr>
<tr><td><tt>-m-</tt></td>    <td width=20><td>Mirror output</td></tr>
<tr><td><tt>-oxxx</tt></td>  <td width=20><td>Output filename</td></tr>
<tr><td><tt>-pxxx</tt></td>  <td width=20><td>Pen diameter (mm)</td></tr>
<tr><td><tt>-q-</tt></td>    <td width=20><td>Quick plot</td></tr>
<tr><td><tt>-r-</tt></td>    <td width=20><td>Rotate output 90 degrees</td></tr>
<tr><td><tt>-sxxx</tt></td>  <td width=20><td>Scale factor</td></tr>
<tr><td><tt>-t-</tt></td>    <td width=20><td>emulate Thermal</td></tr>
<tr><td><tt>-u-</tt></td>    <td width=20><td>output Upside down</td></tr>
<tr><td><tt>-vxxx</tt></td>  <td width=20><td>pen Velocity</td></tr>
<tr><td><tt>-wxxx</tt></td>  <td width=20><td>page Width (inch)</td></tr>
<tr><td><tt>-xxxx</tt></td>  <td width=20><td>offset X (inch)</td></tr>
<tr><td><tt>-yxxx</tt></td>  <td width=20><td>offset Y (inch)</td></tr>
</table>
<p>
where <tt>xxx</tt> means that further data, e.g. a file name or a decimal number
needs to be appended to the option character (without space or separated by a space),
as in
<pre>
-Wmywheel.whl
-W mywheel.whl
-e      Aperture emulation on
-e+     dto.
-e-     Aperture emulation off
</pre>
For flag options, a <tt>'-'</tt> means that the option is off by default, while
<tt>'+'</tt> means it is on by default.
<p>
Flag options (e.g. <tt>-e</tt>) can be used without repeating the <tt>'-'</tt> character:
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>-eatm</tt></td>  <td width=20><td>Aperture emulation on, annulus and thermal emulation on, mirror output</td></tr>
<tr><td><tt>-ea-t+</tt></td> <td width=20><td>Aperture emulation on, annulus emulation <b>off</b>, thermal emulation <b>on</b></td></tr>
</table>
<h2>Defining Tolerance Values</h2>
Without <tt>'+'</tt> or <tt>'-'</tt> sign, a tolerance value applies to both directions:
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>-D0.10</tt></td>         <td width=20><td>adjusts the draw tolerance to &plusmn;10%</td></tr>
<tr><td><tt>-D+0.1 -D-0.05</tt></td> <td width=20><td>adjusts the draw toleranceto +10% and -5%</td></tr>
</table>
<h2>Executing commands</h2>
If a command is given with the <tt>'-C'</tt> option, as in
<pre>
eagle -C "window (1 1) (2 2);" myboard.brd
</pre>
EAGLE will load the given file and execute the command as if it had been
typed into the editor window's command line.
<p>
The following conditions apply for the <tt>'-C'</tt> option:
<ul>
<li>A file name (board, schematic or library) must be given, so that an editor
    window will be opened in which the command can be executed. That file doesn't
    necessarily need to exist.
<li>The <tt>eagle.scr</tt> file will not be executed automatically.
<li>The option <tt>'-s'</tt> will be ignored.
<li>The user settings will not be written back to the <tt>eaglerc</tt> file.
<li>Any project that has been open when EAGLE was left the last time will not be opened.
<li>The command can be a single command, or a sequence of commands delimited by
    semicolons.
</ul>
To run EAGLE without automatically executing the <tt>eagle.scr</tt> file or loading
a project, the command string can be empty, as in
<pre>
eagle -C ""
</pre>
Note that in this special case there must be a blank between the option character
and the quotes, so that the program will see the explicitly empty string. There
also doesn't have to be a file name here, because no command will actually be
executed.
<h2>Filename</h2>
If the given filename is <tt>eagle.epf</tt> (optionally preceded by a directory name),
EAGLE will load that Project File. Otherwise, if no file extension is given,
it defaults to <tt>.brd</tt>, to load a board file.


<a name=4>
<h1>Quick Introduction</h1>
For a quick start you should know more about the following topics:
<ul>
<li><a href=#5>Control Panel and Editor Windows</a>
<li><a href=#28>Using Editor Commands</a>
<li><a href=#6>Entering Parameters and Values</a>
<li><a href=#7>Drawing a Schematic</a>
<li><a href=#8>Checking the Schematic</a>
<li><a href=#9>Generating a Board from a Schematic</a>
<li><a href=#10>Checking the Layout</a>
<li><a href=#11>Creating a Library Device</a>
<li><a href=#131>Using the Autorouter</a>
<li><a href=#109>Using the System Printer</a>
<li><a href=#113>Using the CAM Processor</a>
</ul>
In case of problems please contact our
free <a href=#357>Technical Support</a>.


<a name=5>
<h1>Control Panel and Editor Windows</h1>
From the <a href=#12>Control Panel</a> you can open schematic,
board, or library editor windows by using the File menu or double clicking
an icon.


<a name=6>
<h1>Entering Parameters and Values</h1>
Parameters and values can be entered in the EAGLE command line
or, more conveniently, in the Parameter Toolbars which appear when a
command is activated. As this is quite self-explanatory, the help text
does not explicitly mention this option at other locations.
<p>
Wherever coordinates or sizes (like width, diameter etc.) can be entered, they may
be given with units, as in 50mil or 0.8mm. If no unit is given, the current grid unit is used.


<a name=7>
<h1>Drawing a Schematic</h1>
<h2>Create a Schematic File</h2>
Use File/New and Save as to create a schematic with a name of your
choice.
<h2>Load a Drawing Frame</h2>
Load library FRAMES with <a href=#102>USE</a> and place a frame of your choice with <a href=#29>ADD</a>.
<h2>Place Symbols</h2>
Load appropriate libraries with <a href=#102>USE</a> and place symbols (see <a href=#29>ADD</a>, <a href=#67>MOVE</a>,
<a href=#43>DELETE</a>, <a href=#88>ROTATE</a>, <a href=#68>NAME</a>, <a href=#103>VALUE</a>). Where a particular component is not
available, define a new one with the library editor.
<h2>Draw Bus Connections</h2>
Using the <a href=#35>BUS</a> command, draw bus connections. You can <a href=#68>NAME</a> a bus in
such a way that you can drag nets out of the bus which are named
accordingly.
<h2>Draw Net Connections</h2>
Using the <a href=#69>NET</a> command, connect up the pins of the various elements on
the drawing. Intersecting nets may be made into connections with the
<a href=#59>JUNCTION</a> command.


<a name=8>
<h1>Checking the Schematic</h1>
Carry out an electrical rule check (<a href=#48>ERC</a>) to look for open pins, etc.,
and use the messages generated to correct any errors. Use the <a href=#93>SHOW</a>
command to follow complete nets across the screen. Use the <a href=#50>EXPORT</a> command
to generate a netlist, pinlist, or partlist if necessary.


<a name=9>
<h1>Generating a Board from a Schematic</h1>
By using the <a href=#34>BOARD</a> command or clicking the Switch-to-Board icon you
can generate a board from the loaded schematic (if there is no board
with the same name yet).
<p>
All the components, together with their connections drawn as airwires,
appear beside a blank board ready for placing. Power pins are
automatically connected to the appropriate supply (if not connected by
a net on the schematic).
<p>
The board is linked to the schematic via <a href=#354>Forward&amp;Back Annotation</a>.
This mechanism makes sure that schematic and board are consistent.
When editing a drawing, board and schematic must be loaded to keep
Forward&amp;Back Annotation active.
<h2>Set Board Outlines and Place Components</h2>
The board outlines can be adjusted with the <a href=#67>MOVE</a> and <a href=#97>SPLIT</a>
commands as appropriate before moving each package on the board. Once
all packages have been placed, the <a href=#81>RATSNEST</a> command is used to
optimize airwires.
<h2>Define Restricted Areas</h2>
If required, restricted areas for the Autorouter can be defined as
<a href=#82>RECT</a>angles, <a href=#77>POLYGON</a>s, or <a href=#37>CIRCLE</a>s on the tRestrict, bRestrict, or
vRestrict layers. Note: areas enclosed by wires drawn on the Dimension
layer are borders for the Autorouter, too.
<h2>Routing</h2>
Airwires are now converted into tracks with the aid of the <a href=#89>ROUTE</a>
command. This function can also be performed automatically by the
<a href=#33>Autorouter</a>, when available.


<a name=10>
<h1>Checking the Layout</h1>
Check the layout (<a href=#46>DRC</a>) and correct the errors (<a href=#49>ERRORS</a>). Generate
net, part, or pin list if necessary(<a href=#50>EXPORT</a>).


<a name=11>
<h1>Creating a Library Device</h1>
Creating a new component part in a library has three steps. You must
follow these steps as they build upon each other.
<p>
To start, open a library. Use the File menu Open or New command (not
the USE command).
<h2>Create a Package</h2>
Packages are the part of the device that are added to a board.
<p>
Click the Edit Package icon and edit a new package by typing its
name in the New field of the dialog box.
<p>
Set the proper distance <a href=#53>GRID</a>.
<p>
<a href=#68>NAME</a> and place <a href=#73>PAD</a>s properly.
<p>
Add texts &gt;NAME and &gt;VALUE with the <a href=#99>TEXT</a> command (show actual name and
value in the board) and draw package outlines (<a href=#106>WIRE</a> command) in the
proper layers.
<h2>Create a Symbol</h2>
Symbols are the part of the device that are added to a schematic.
<p>
Click the Edit Symbol icon and edit a new symbol by typing its
name in the New field of the dialog box.
<p>
Place and name pins with the commands <a href=#75>PIN</a> and <a href=#68>NAME</a> and provide pin
parameters (<a href=#36>CHANGE</a>).
<p>
Add texts &gt;NAME and &gt;VALUE with the <a href=#99>TEXT</a> command (show actual name and
value in the schematic) and draw symbol outlines (<a href=#106>WIRE</a> command) in the
proper layers.
<h2>Create the Device</h2>
Devices are the "master" part of a component and use both a package
and one or more symbols.
<p>
Click the Edit Device icon and edit a new device by typing its
name in the New field of the dialog box.
<p>
Assign the package with the <a href=#72>PACKAGE</a> command.
<p>
Add the gate(s) with <a href=#29>ADD</a>, you can have as many gates as needed.
<p>
Use <a href=#40>CONNECT</a> to specify which of the packages pads are
connected to the pins of each gate.
<p>
Save the library and you can <a href=#102>USE</a> it from the schematic or board
editor.


<a name=12>
<h1>Control Panel</h1>
The Control Panel is the top level window of EAGLE.
It contains a tree view on the left side, and an information window on the right side.
<h2>Directories</h2>
The top level items of the tree view represent the various types of EAGLE files.
Each of these can point to one or more directories that contain files of that type.
The location of these directories can be defined with the <a href=#14>directories dialog</a>.
If a top level item points to a single directory, the contents of that directory will
appear if the item is opened (either by clicking on the little symbol to the left, or by
double clicking the item). If such an item points to more directories, all of these
directories will be listed when the item is opened.
<h2>Context menu</h2>
The <a href=#13>context menu</a> of the tree items can be accessed by clicking on them with the right
mouse button. It contains options specific to the selected item.
<h2>Descriptions</h2>
The <i>Description</i> column of the tree view contains a short description of the
item (if available). These descriptions are derived from the first non-blank line
of the text from the following sources:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Directories</td>            <td width=20><td>a file named DESCRIPTION in that directory</td></tr>
<tr><td>Libraries</td>              <td width=20><td>the description of the library</td></tr>
<tr><td>Devices</td>                <td width=20><td>the description of the device</td></tr>
<tr><td>Packages</td>               <td width=20><td>the description of the package</td></tr>
<tr><td>Design Rules</td>           <td width=20><td>the description of the design rules file</td></tr>
<tr><td>User Language Programs</td> <td width=20><td>the text defined with the <tt>#usage</tt> directive</td></tr>
<tr><td>Scripts</td>                <td width=20><td>the comment at the beginning of the script file</td></tr>
<tr><td>CAM Jobs</td>               <td width=20><td>the description of the CAM job</td></tr>
</table>
<h2>Drag&amp;drop</h2>
You can use <i>Drag&amp;Drop</i> to copy or move files and directories within the
tree view. It is also possible to drag a device or package to a schematic, board or library
window, respectively, and drop it there to add it to the drawing. User Language Programs
and Scripts will be executed if dropped onto an editor window, and Design Rules will be
applied to a board if dropped onto a board editor window. If a board, schematic or
library file is dropped onto its respective editor window, it will be loaded into the
editor.
All of these functions can also be accessed through the <i>context menu</i>
of the particular tree item.
<h2>Information window</h2>
The right hand side of the Control Panel displays information about the current item
in the tree view. That information is derived from the places listed above under
<i>Descriptions</i>. Devices and packages also show a preview of their contents.
<h2>Pulldown menu</h2>
The Control panel's <i>pulldown menu</i> contains the following options:
<h2>File</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>New   </td><td width=20><td>create a new file</td></tr>
<tr><td>Open            </td><td width=20><td>open an existing file</td></tr>
<tr><td>Open recent projects</td><td width=20><td>open a recently used project</td></tr>
<tr><td>Save all        </td><td width=20><td>save all modified editor files</td></tr>
<tr><td>Close project   </td><td width=20><td>close the current project</td></tr>
<tr><td>Exit            </td><td width=20><td>exit from the program</td></tr>
</table>
<h2>View</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Refresh</td><td width=20><td>refresh the contents of the tree view</td></tr>
<tr><td>Sort            </td><td width=20><td>change the sorting of the tree view</td></tr>
</table>
<h2>Options</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Directories...    </td><td width=20><td>opens the <a href=#14>directories dialog</a></td></tr>
<tr><td>Backup...         </td><td width=20><td>opens the <a href=#15>backup dialog</a></td></tr>
<tr><td>User interface... </td><td width=20><td>opens the <a href=#16>user interface dialog</a></td></tr>
<tr><td>Window positions...</td><td width=20><td>opens the <a href=#17>window positions dialog</a></td></tr>
</table>
<h2>Window</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Control Panel         </td><td width=20><td>switch to the Control Panel</td></tr>
<tr><td>1 Schematic - ...     </td><td width=20><td>switch to window number 1</td></tr>
<tr><td>2 Board - ...         </td><td width=20><td>switch to window number 2</td></tr>
</table>
<h2>Help</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>General </td><td width=20><td>opens a general help page</td></tr>
<tr><td>Context           </td><td width=20><td>opens the help page for the current context</td></tr>
<tr><td>Control Panel     </td><td width=20><td>opens the help page you are currently looking at</td></tr>
<tr><td>EAGLE License     </td><td width=20><td>opens the <a href=#359>license dialog</a></td></tr>
<tr><td>Check for Update  </td><td width=20><td><a href=#18>checks</a> if a new version of EAGLE is available</td></tr>
<tr><td>About EAGLE       </td><td width=20><td>displays details on your EAGLE version and <a href=#358>license</a></td></tr>
</table>
<h2>Status line</h2>
The status line at the bottom of the Control Panel contains
the full name of the currently selected item.


<a name=13>
<h1>Context Menus</h1>
Clicking on an item in the <a href=#12>Control Panel</a>
with the right mouse button opens a context menu which allows
the following actions (not all of them may be present on a particular item):
<h2>New Folder</h2>
Creates a new folder below the selected folder and puts the newly created tree
item into <i>Rename</i> mode.
<h2>Edit Description</h2>
Loads the DESCRIPTION file of a directory into the HTML editor.
<h2>Rename</h2>
Puts the tree item's text into edit mode, so that it can be renamed.
<h2>Copy</h2>
Opens a file dialog in which you can enter a name to which to copy this file or directory.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>Delete</h2>
Deletes the file or directory (you will be prompted to confirm that you really want this to happen).
<h2>Use</h2>
Marks this library to be <i>used</i> when searching for devices or packages.
You can also click on the icon in the second column of the tree view to toggle this flag.
<h2>Use all</h2>
Marks all libraries in the Libraries path to be <i>used</i> when searching for devices or packages.
<h2>Use none</h2>
Removes the <i>use</i> marks from all libraries (including such libraries that are not
in the Libraries path).
<h2>Update</h2>
Updates all parts used from this library in the loaded board and schematic.
<h2>Update in Library</h2>
Updates all packages used from this library in the loaded library.
<h2>Add to Schematic</h2>
Starts the <a href=#29>ADD</a> command in the schematic window with this device.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>Add to Board</h2>
Starts the <a href=#29>ADD</a> command in the board window with this package.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>Copy to Library</h2>
Copies the selected device set or package into the loaded library.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>New variant in Library</h2>
Creates a new package variant with the selected package in the current
device set of the loaded library.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>Open/Close Project</h2>
Opens or closes this project.
You can also click on the icon in the second column of the tree view to do this.
<h2>New</h2>
Opens a window with a new file of the given type.
<h2>Open</h2>
Opens this file in the propper window.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>Print...</h2>
Prints the file to the system printer. See the chapter on
<a href=#109>printing to the system printer</a> for more
information on how to use the print dialogs.
<p>
Printing a file through this context menu option will always print the file
as it is on disk, even if you have an open editor window in which you have
modified the file! Use the <a href=#79>PRINT</a> command to
print the drawing from an open editor window.<br>
<b>Please note that polygons in boards will not be automatically calculated
when printing via the context menu! Only the outlines will be drawn.
To print polygons in their calculated shape you have to load the drawing
into an editor window, enter <a href=#81>RATSNEST</a>
and then <a href=#79>PRINT</a></b>.
<h2>Run in ...</h2>
Runs this User Language Program in the current schematic, board or library.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>Execute in ...</h2>
Executes this script file in the current schematic, board or library.
You can also use <i>Drag&amp;Drop</i> to do this.
<h2>Load into Board</h2>
Loads this set of Design Rules into the current board.
You can also use <i>Drag&amp;Drop</i> to do this.


<a name=14>
<h1>Directories</h1>
The <i>Directories</i> dialog is used to define the directory paths
in which to search for files.
<p>
All entries may contain one or more directories, separated by a colon (<b><tt>':'</tt></b>),
in which to look for the various types of files.
<table><tr><td valign="top"><img src="platforms-win.png"></td><td valign="middle">
On <b>Windows</b> the individual directory names are separated by a semicolon (<b><tt>';'</tt></b>).
</td></tr></table>
When entering an <a href=#70>OPEN</a>,
<a href=#102>USE</a>, <a href=#91>SCRIPT</a> or
<a href=#90>RUN</a> command, these paths will be searched
left-to-right to locate the file.
If the file dialog is used to access a file of one of these types, the directory into
which the user has navigated through the file dialog will be implicitly added to the
end of the respective search path.
<p>
The special variables <tt>$HOME</tt> and <tt>$EAGLEDIR</tt> can be used to reference
the user's home directory and the EAGLE program directory, respectively.
<table><tr><td valign="top"><img src="platforms-win.png"></td><td valign="middle">
On <b>Windows</b> the value of <tt>$HOME</tt> is either that of the environment variable
HOME (if set), or the value of the registry key "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell&nbsp;Folders\Personal",
which contains the actual name of the "My Documents" directory.
</td></tr></table>


<a name=15>
<h1>Backup</h1>
The <i>Backup</i> dialog allows you to customize the
<a href=#353>automatic backup</a> function.
<h2>Maximum backup level</h2>
Defines how many backup copies of your EAGLE data files shall be kept
when regularly saving a file to disk with the WRITE command
(default is 9).
<h2>Auto backup interval (minutes)</h2>
Defines the maximum time after which EAGLE automatically creates a safety backup
copy of any modified drawing (default is 5).
<h2>Automatically save project file</h2>
If this option is checked, your project settings will be automatically saved when
you exit from the program.
Note that if you uncheck this option while you have a project open, this
project will not be saved when you close it, and thus this setting will not
be stored in the project's eagle.epf file. This means that the next time you
open the project, this option will be checked again. If you want this option
to remain unchecked for the current project, you need to manually select
"File/Save all" from the pulldown menu after unchecking this option.


<a name=16>
<h1>User Interface</h1>
The <i>User interface</i> dialog allows you to customize the
appearance of the layout, schematic and library
<a href=#21>editor windows</a>.
<h2>Controls</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Pulldown menu        </td><td width=20><td>activates the pulldown menu at the top of the editor window</td></tr>
<tr><td>Action toolbar       </td><td width=20><td>activates the action toolbar containing buttons for "File", "Print" etc.</td></tr>
<tr><td>Parameter toolbar    </td><td width=20><td>activates the dynamic parameter toolbar, which contains all the parameters that are available for the currently active command</td></tr>
<tr><td>Command buttons      </td><td width=20><td>activates the command buttons</td></tr>
<tr><td>Command texts        </td><td width=20><td>activates the textual command menu</td></tr>
<tr><td>Sheet thumbnails     </td><td width=20><td>aktivates the sheet thumbnail preview</td></tr>
</table>
<h2>Layout</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Background     </td><td width=20><td>selects a black, white or colored background for the layout mode</td></tr>
<tr><td>Cursor               </td><td width=20><td>selects a small or large cursor for the layout mode</td></tr>
</table>
<h2>Schematic</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Background     </td><td width=20><td>selects a black, white or colored background for the schematic mode</td></tr>
<tr><td>Cursor               </td><td width=20><td>selects a small or large cursor for the schematic mode</td></tr>
</table>
<h2>Help</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Bubble help          </td><td width=20><td>activates the "Bubble Help" function, which pops up a short hint about the meaning of several buttons when moving the cursor over them</td></tr>
<tr><td>User guidance        </td><td width=20><td>activates the "User Guidance" function, which displays a helping text telling the user what would be the next meaningful action when a command is active</td></tr>
</table>
<h2>Misc</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Always vector font   </td><td width=20><td>always displays texts in drawings with the builtin vector font, regardless of which font is actually set for a particular text</td></tr>
<tr><td>Mouse wheel zoom     </td><td width=20><td>defines the zoom factor that will be used to zoom in and out of an editor window when the mouse wheel is turned ('0' disables this feature, the sign of this value defines the direction of the zoom operation)</td></tr>
</table>


<a name=17>
<h1>Window positions</h1>
The <i>Window positions</i> dialog allows you to store the positions
of all currently open windows, so that later, when a window of the same
type is opened again, it will appear at the same position as before.
<p>
You can also delete all stored window positions, so that the window manager
can decide again where to place newly opened windows.


<a name=18>
<h1>Check for Update</h1>
The option "Help/Check for Update" in the Control Panel's pulldown menu opens
a dialog that displays whether there is a new version of EAGLE available on
the CadSoft server.
<p>
The <b>Configure</b> button opens a dialog in which you can specify if and
how often a check for new versions should be done automatically upon program
start (by default it checks once per day). If you need to use a proxy to access
the Internet, this can also be specified in the configuration dialog. In the "Host"
field enter the full name of the proxy host, without any
<tt>http://</tt> prefix, and enter an optional port number in the "Port" field.
<p>
If you would like to be informed about beta versions of EAGLE, you can check
the "Also check for beta versions" box.


<a name=19>
<h1>Keyboard and Mouse</h1>
The <i>modifier keys</i> (<tt>Alt</tt>, <tt>Ctrl</tt> and <tt>Shift</tt>) are used
to modify the behaviour of certain mouse actions.
Note that depending on which operating system or window manager you use, some of these
keys (in combination with mouse events) may not be delivered to applications, which means
that some of the functions described here may not be available.
<h2>Alt</h2>
Pressing the <tt>Alt</tt> key switches to an alternate <a href=#53>GRID</a>.
This can typically be a finer grid than the normal one, which allows you to quickly
do some fine positioning in a dense area, for instance, where the normal grid might
be too coarse.
The alternate grid remains active as long as the <tt>Alt</tt> key is held pressed down.
<h2>Ctrl</h2>
Pressing the <tt>Ctrl</tt> key while clicking on the right mouse button toggles
between corresponding wire bend styles (only applies to commands that support wire
bend styles, like, for instance, <a href=#106>WIRE</a>).
<p>
The <tt>Ctrl</tt> key together with the left mouse button controls special functionality
of individual commands, like, for instance, selecting an object at its origin with the
<a href=#67>MOVE</a> command.
<p>
If a command can select a group, the <tt>Ctrl</tt> key must be pressed together with
the right mouse button when selecting the group (otherwise a context menu for the
selected object would be opened).
<p>
<table><tr><td valign="top"><img src="platforms-mac.png"></td><td valign="middle">
On <b>Mac OS X</b> the <tt>Cmd</tt> key has to be used instead of the <tt>Ctrl</tt> key.
</td></tr></table>
<h2>Shift</h2>
Pressing the <tt>Shift</tt> key while clicking on the right mouse button reverses
the direction in which the wire bend styles are switched through (only applies to
commands that support wire bend styles, like, for instance, <a href=#106>WIRE</a>).
<p>
The <tt>Shift</tt> key together with the left mouse button controls special functionality
of individual commands, like, for instance, deleting a higher level object with the
<a href=#43>DELETE</a> command.
<h2>Esc</h2>
Pressing the <tt>Esc</tt> key when a command is active will cancel the current
activity of that command without canceling the entire command (if there is text
in the command line, that text will be deleted first, and the next press of the
<tt>Esc</tt> key will act on the command).
For the <a href=#67>MOVE</a> command, for example, this means
that an object that is currently attached to the cursor
will be dropped and an other object can be selected.
<h2>Crsr-Up/Down</h2>
The keys <tt>Crsr-Up</tt> (cursor up) and <tt>Crsr-Down</tt> (cursor down) can be used in the
command line of an editor window to scroll through the command history.
<h2>Function Keys</h2>
Function keys can be assigned any commands by using the <a href=#31>ASSIGN</a> command.
<h2>Left Mouse Button</h2>
The left mouse button is generally used to select, draw or place objects.
<h2>Center Mouse Button</h2>
The center mouse button changes the current layer or mirrors the object currently
attached to the mouse cursor.
<p>
The following commands support the center mouse button:
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#29>ADD</a>  </td><td width=20><td>mirror part</td></tr>
<tr><td><a href=#30>ARC</a>            </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#37>CIRCLE</a>      </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#41>COPY</a>          </td><td width=20><td>mirror object</td></tr>
<tr><td><a href=#58>INVOKE</a>      </td><td width=20><td>mirror gate</td></tr>
<tr><td><a href=#60>LABEL</a>        </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#67>MOVE</a>          </td><td width=20><td>mirror object or group</td></tr>
<tr><td><a href=#74>PASTE</a>        </td><td width=20><td>mirror group</td></tr>
<tr><td><a href=#77>POLYGON</a>    </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#82>RECT</a>          </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#89>ROUTE</a>        </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#96>SMD</a>            </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#99>TEXT</a>          </td><td width=20><td>change active layer</td></tr>
<tr><td><a href=#106>WIRE</a>          </td><td width=20><td>change active layer</td></tr>
</table>
<p>
Click&amp;Drag with the center mouse button will pan the drawing within the editor
window.
<h2>Right Mouse Button</h2>
The right mouse button is mostly used to select a group, rotate objects attached to
the mouse cursor, change wire bend styles and several other command specific functions.
<p>
When selecting an object with the right mouse button, a context specific popup menu is
displayed from which commands that apply to this object can be selected.
If there is currently a command active that can be applied to a group, the popup menu
will contain an entry for this.
<p>
The following commands support the right mouse button:
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#29>ADD</a>  </td><td width=20><td>rotate part</td></tr>
<tr><td><a href=#30>ARC</a>            </td><td width=20><td>change direction of arc</td></tr>
<tr><td><a href=#35>BUS</a>            </td><td width=20><td>change wire bend</td></tr>
<tr><td><a href=#36>CHANGE</a>      </td><td width=20><td>apply change to group</td></tr>
<tr><td><a href=#43>DELETE</a>      </td><td width=20><td>delete group</td></tr>
<tr><td><a href=#54>GROUP</a>        </td><td width=20><td>close polygon</td></tr>
<tr><td><a href=#58>INVOKE</a>      </td><td width=20><td>rotate gate</td></tr>
<tr><td><a href=#60>LABEL</a>        </td><td width=20><td>rotate label</td></tr>
<tr><td><a href=#65>MIRROR</a>      </td><td width=20><td>mirror group</td></tr>
<tr><td><a href=#67>MOVE</a>          </td><td width=20><td>rotate object, select group</td></tr>
<tr><td><a href=#69>NET</a>            </td><td width=20><td>change wire bend</td></tr>
<tr><td><a href=#73>PAD</a>            </td><td width=20><td>rotate pad</td></tr>
<tr><td><a href=#74>PASTE</a>        </td><td width=20><td>rotate group</td></tr>
<tr><td><a href=#75>PIN</a>            </td><td width=20><td>rotate pin</td></tr>
<tr><td><a href=#77>POLYGON</a>    </td><td width=20><td>change wire bend</td></tr>
<tr><td><a href=#87>RIPUP</a>        </td><td width=20><td>ripup group</td></tr>
<tr><td><a href=#88>ROTATE</a>      </td><td width=20><td>rotate group</td></tr>
<tr><td><a href=#89>ROUTE</a>        </td><td width=20><td>change wire bend</td></tr>
<tr><td><a href=#96>SMD</a>            </td><td width=20><td>rotate smd</td></tr>
<tr><td><a href=#97>SPLIT</a>        </td><td width=20><td>change wire bend</td></tr>
<tr><td><a href=#99>TEXT</a>          </td><td width=20><td>rotate text</td></tr>
<tr><td><a href=#106>WIRE</a>          </td><td width=20><td>change wire bend</td></tr>
</table>
<h2>Mouse Wheel</h2>
Inside an editor window the mouse wheel can be used to zoom in and out.


<a name=20>
<h1>Selecting objects in dense areas</h1>
When you try to select an object at a position where several objects
are placed close together, a four way arrow and the question
<p>
<i>Select highlighted object? (left=yes, right=next, ESC=cancel)</i>
<p>
indicates that you can now choose one of these objects.
<p>
Press the right mouse button to switch to the next object.
<p>
Press the left mouse button to select the highlighted object.
<p>
Press Esc to cancel the selection procedure.
<p>
The command
<pre>
<a href=#92>SET</a> Select_Factor select_radius;
</pre>
defines the selection radius.
<p>
If the original selection was done with the right mouse button, a context specific
popup menu will be displayed which applies to the first selected object, and which
contains "Next" as the first entry. Clicking on this entry will cyclically switch
through the objects within the selection radius.


<a name=21>
<h1>Editor Windows</h1>
EAGLE knows different types of data files, each of which has its own
type of editor window. By double clicking on one of the items in the
<a href=#12>Control Panel</a> or by selecting a file from the
<b>File/Open</b> menu, an editor
window suitable for that file will be opened.
<ul>
<li><a href=#22>Library Editor</a>
<li><a href=#25>Schematic Editor</a>
<li><a href=#24>Board Editor</a>
<li><a href=#26>Text Editor</a>
</ul>


<a name=22>
<h1>Library Editor</h1>
The <i>Library Editor</i> is used to edit a part library (<tt>*.lbr</tt>).
<p>
After opening a new library editor window, the edit area will be empty and
you will have to use the <a href=#47>EDIT</a> command to select
which package, symbol or device you want to edit or create.


<a name=23>
<h1>Edit Library Object</h1>
In library edit mode you can edit packages, symbols, and devices.
<p>
<b>Package:</b> the package definition.
<p>
<b>Symbol:</b> the symbol as it appears in the circuit diagram.
<p>
<b>Device:</b> definition of the whole component. Contains one or more
package variants and one or several symbols (e.g. gates).
The symbols can be different from each other.
<p>
Click on the <b>Dev</b>, <b>Pac</b> or
<b>Sym</b> button to select Device, Packages or Symbols,
respectively.
<p>
If you want to create a new object, write the name of the new object into
the <b>New</b> field. You can also edit an existing object
by typing its name into this field. If you omit the extension, an object
of the type indicated by the <b>Choose...</b> prompt will be
loaded. Otherwise an object of the type indicated by the extension will
be loaded.
<p>
If your <a href=#358>license</a> does not include
the Schematic Module, the object type buttons (<b>Dev</b>...)
will not appear in the menu.


<a name=24>
<h1>Board Editor</h1>
The <i>Board Editor</i> is used to edit a board (<tt>*.brd</tt>).
<p>
When there is a schematic file (<tt>*.sch</tt>) with the same name as the
board file (in the same directory), opening a board editor window will
automatically open a <a href=#25>Schematic Editor</a>
window containing that file and will put it on the desktop
as an icon. This is necessary to have the schematic file loaded when editing
the board causes modifications that have to be
<a href=#354>back-annotated</a>
to the schematic.


<a name=25>
<h1>Schematic Editor</h1>
The <i>Schematic Editor</i> is used to edit a schematic (<tt>*.sch</tt>).
<p>
When there is a board file (<tt>*.brd</tt>) with the same name as the
schematic file (in the same directory), opening a schematic editor window will
automatically open a <a href=#24>Board Editor</a>
window containing that file and will put it on the desktop
as an icon. This is necessary to have the board file loaded when editing
the schematic causes modifications that have to be
<a href=#354>forward-annotated</a>
to the board.
<p>
The combo box in the action toolbar of the schematic editor window allows
you to switch between the various sheets of the schematic, or to add new
sheets to the schematic (this can also be done using the
<a href=#47>EDIT</a> command).


<a name=26>
<h1>Text Editor</h1>
The <i>Text Editor</i> is used to edit any kind of text.
<p>
The text must be a pure ASCII file and must not contain any control codes.
The main area of use for the text editor is writing
<a href=#138>User Language Programs</a> and
<a href=#91>Script files</a>.
<h2>Using an external text editor</h2>
If you prefer to use an external text editor instead of EAGLE's builtin text
editor, you can specify the command necessary to start that editor in the
"Options/User interface" dialog.
<p>
Within that command the following placeholders will be replaced with
actual values:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>%C</tt></td><td width=20><td>the column in which to place the cursor (currently always <tt>1</tt>)</td></tr>
<tr><td><tt>%F</tt></td><td width=20><td>the name of the file to load</td></tr>
<tr><td><tt>%L</tt></td><td width=20><td>the line in which to place the cursor</td></tr>
</table>
<p>
If the command consists only of a hyphen (<tt>'-'</tt>), EAGLE will never open
a text editor window. This may be useful for people who always start their text
editor by themselves.
<p>
The following restrictions apply when using an external text editor:
<ul>
<li>The external text editor runs as a separate process, and EAGLE has no way of
    knowing whether the loaded file has been modified or not. It is up to you to
    save the file after you have made modifications.
<li>If the same file is loaded into the text editor several times, it depends on
    the configuration of the text editor in use whether it opens a new window each
    time, or whether it loads the file into the same window.
<li>The external text editor windows do not show up in EAGLE's window list, and
    are therefore not stored in the project file, and are not reopened when the project
    is opened again later.
<li>When leaving EAGLE, the external text editor processes will be terminated.
    It depends on the operating system and the particular text editor whether or
    not you are queried if a file has been modified and should be saved.
<li>The "File/Save all" function will not save files edited with an external text editor.
<li>The update report that may be given when loading a file from an older version
    of EAGLE is always displayed with the internal text editor.
</ul>


<a name=27>
<h1>Editor Commands</h1>
<h2>Change Mode/File Commands</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#39>CLOSE</a>     </td><td width=20><td>Close drawing after editing</td></tr>
<tr><td><a href=#47>EDIT</a>      </td><td width=20><td>Load/create a drawing</td></tr>
<tr><td><a href=#50>EXPORT</a>    </td><td width=20><td>Generate ASCII list (e.g. netlist)</td></tr>
<tr><td><a href=#70>OPEN</a>      </td><td width=20><td>Open library for editing</td></tr>
<tr><td><a href=#80>QUIT</a>      </td><td width=20><td>Quit EAGLE</td></tr>
<tr><td><a href=#84>REMOVE</a>    </td><td width=20><td>Delete files/library elements</td></tr>
<tr><td><a href=#91>SCRIPT</a>    </td><td width=20><td>Execute command file</td></tr>
<tr><td><a href=#102>USE</a>       </td><td width=20><td>Load library for placing elements</td></tr>
<tr><td><a href=#107>WRITE</a>     </td><td width=20><td>Save drawing/library</td></tr>
</table>
<h2>Edit Drawings or Libraries</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#29>ADD</a>       </td><td width=20><td>Add element to drawing/symbol to device</td></tr>
<tr><td><a href=#30>ARC</a>       </td><td width=20><td>Draw arc</td></tr>
<tr><td><a href=#32>ATTRIBUTE</a>  </td><td width=20><td>Define attributes</td></tr>
<tr><td><a href=#37>CIRCLE</a>    </td><td width=20><td>Draw circle</td></tr>
<tr><td><a href=#38>CLASS</a>    </td><td width=20><td>Define net classes</td></tr>
<tr><td><a href=#41>COPY</a>      </td><td width=20><td>Copy objects/elements</td></tr>
<tr><td><a href=#42>CUT</a>       </td><td width=20><td>Cut previously defined group</td></tr>
<tr><td><a href=#43>DELETE</a>    </td><td width=20><td>Delete objects</td></tr>
<tr><td><a href=#44>DESCRIPTION</a> </td><td width=20><td>Change an object's description</td></tr>
<tr><td><a href=#54>GROUP</a>     </td><td width=20><td>Define group for upcoming operation</td></tr>
<tr><td><a href=#56>HOLE</a>      </td><td width=20><td>Define non-conducting hole</td></tr>
<tr><td><a href=#61>LAYER</a>     </td><td width=20><td>Create/change layer</td></tr>
<tr><td><a href=#65>MIRROR</a>    </td><td width=20><td>Mirror objects</td></tr>
<tr><td><a href=#66>MITER</a>    </td><td width=20><td>Miter wire joints</td></tr>
<tr><td><a href=#67>MOVE</a>      </td><td width=20><td>Move or rotate objects</td></tr>
<tr><td><a href=#68>NAME</a>      </td><td width=20><td>Name object</td></tr>
<tr><td><a href=#74>PASTE</a>     </td><td width=20><td>Paste previously cut group to a drawing</td></tr>
<tr><td><a href=#77>POLYGON</a>   </td><td width=20><td>Draw polygon</td></tr>
<tr><td><a href=#82>RECT</a>      </td><td width=20><td>Draw rectangle</td></tr>
<tr><td><a href=#88>ROTATE</a>    </td><td width=20><td>Rotate objects</td></tr>
<tr><td><a href=#95>SMASH</a>     </td><td width=20><td>Prepare NAME/VALUE text for moving</td></tr>
<tr><td><a href=#97>SPLIT</a>     </td><td width=20><td>Bend wires/lines (tracks, nets, etc.)</td></tr>
<tr><td><a href=#99>TEXT</a>      </td><td width=20><td>Add text to a drawing</td></tr>
<tr><td><a href=#103>VALUE</a>     </td><td width=20><td>Enter/change value for component</td></tr>
<tr><td><a href=#106>WIRE</a>      </td><td width=20><td>Draw line or routed track</td></tr>
</table>
<h2>Special Commands for Boards</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#46>DRC</a>       </td><td width=20><td>Perform design rule check</td></tr>
<tr><td><a href=#49>ERRORS</a>    </td><td width=20><td>Show DRC errors</td></tr>
<tr><td><a href=#62>LOCK</a>    </td><td width=20><td>Lock component's position</td></tr>
<tr><td><a href=#81>RATSNEST</a>  </td><td width=20><td>Show shortest air lines</td></tr>
<tr><td><a href=#86>REPLACE</a>   </td><td width=20><td>Replace component</td></tr>
<tr><td><a href=#87>RIPUP</a>     </td><td width=20><td>Ripup routed track</td></tr>
<tr><td><a href=#89>ROUTE</a>     </td><td width=20><td>Route signal</td></tr>
<tr><td><a href=#94>SIGNAL</a>    </td><td width=20><td>Define signal (air line)</td></tr>
<tr><td><a href=#104>VIA</a>       </td><td width=20><td>Place via-hole</td></tr>
</table>
<h2>Special Commands for Schematics</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#34>BOARD</a>      </td><td width=20><td>Create a board from a schematic</td></tr>
<tr><td><a href=#35>BUS</a>       </td><td width=20><td>Draw bus line</td></tr>
<tr><td><a href=#48>ERC</a>       </td><td width=20><td>Perform electrical rule check</td></tr>
<tr><td><a href=#52>GATESWAP</a>  </td><td width=20><td>Swap equivalent 'gates'</td></tr>
<tr><td><a href=#58>INVOKE</a>    </td><td width=20><td>Add certain 'gate' from a placed device</td></tr>
<tr><td><a href=#59>JUNCTION</a>  </td><td width=20><td>Place connection point</td></tr>
<tr><td><a href=#60>LABEL</a>     </td><td width=20><td>Provide label to bus or net</td></tr>
<tr><td><a href=#69>NET</a>       </td><td width=20><td>Define net</td></tr>
<tr><td><a href=#76>PINSWAP</a>   </td><td width=20><td>Swap equivalent pins</td></tr>
</table>
<h2>Special Commands for Libraries</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#40>CONNECT</a>   </td><td width=20><td>Define pin/pad assignment</td></tr>
<tr><td><a href=#72>PACKAGE</a>   </td><td width=20><td>Define package for device</td></tr>
<tr><td><a href=#73>PAD</a>       </td><td width=20><td>Add pad to a package</td></tr>
<tr><td><a href=#75>PIN</a>       </td><td width=20><td>Add pin to a symbol</td></tr>
<tr><td><a href=#78>PREFIX</a>    </td><td width=20><td>Define default prefix for device</td></tr>
<tr><td><a href=#84>REMOVE</a>    </td><td width=20><td>Delete library elements</td></tr>
<tr><td><a href=#85>RENAME</a>    </td><td width=20><td>Rename symbol/package/device</td></tr>
<tr><td><a href=#96>SMD</a>       </td><td width=20><td>Add smd pad to a package</td></tr>
<tr><td><a href=#98>TECHNOLOGY</a> </td><td width=20><td>Define technologies for a device</td></tr>
<tr><td><a href=#103>VALUE</a>     </td><td width=20><td>Define if value text can be changed</td></tr>
</table>
<h2>Change Screen Display and User Interface</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#31>ASSIGN</a>    </td><td width=20><td>Assign keys</td></tr>
<tr><td><a href=#36>CHANGE</a>    </td><td width=20><td>Change parameters</td></tr>
<tr><td><a href=#45>DISPLAY</a>   </td><td width=20><td>Display/hide layers</td></tr>
<tr><td><a href=#53>GRID</a>      </td><td width=20><td>Define grid/unit</td></tr>
<tr><td><a href=#64>MENU</a>      </td><td width=20><td>Configure command menu</td></tr>
<tr><td><a href=#92>SET</a>       </td><td width=20><td>Set program parameters</td></tr>
<tr><td><a href=#105>WINDOW</a>    </td><td width=20><td>Choose screen window</td></tr>
</table>
<h2>Miscellaneous Commands</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#33>AUTO</a>      </td><td width=20><td>Start Autorouter</td></tr>
<tr><td><a href=#55>HELP</a>      </td><td width=20><td>Show help page</td></tr>
<tr><td><a href=#57>INFO</a>      </td><td width=20><td>Show information about object</td></tr>
<tr><td><a href=#63>MARK</a>      </td><td width=20><td>Set/remove mark (for measuring)</td></tr>
<tr><td><a href=#71>OPTIMIZE</a>  </td><td width=20><td>Optimize (join) wire segments</td></tr>
<tr><td><a href=#79>PRINT</a>    </td><td width=20><td>Print to the system printer</td></tr>
<tr><td><a href=#83>REDO</a>      </td><td width=20><td>Redo commands</td></tr>
<tr><td><a href=#90>RUN</a>        </td><td width=20><td>Run User Language Program</td></tr>
<tr><td><a href=#93>SHOW</a>      </td><td width=20><td>Highlight object</td></tr>
<tr><td><a href=#100>UNDO</a>      </td><td width=20><td>Undo commands</td></tr>
<tr><td><a href=#101>UPDATE</a>  </td><td width=20><td>Update library objects</td></tr>
</table>


<a name=28>
<h1>Command Syntax</h1>
EAGLE commands can be entered in different ways:
<ul>
<li>with the keyboard as text
<li>with the mouse by selecting menu items or clicking on icons
<li>with assigned keys (see <a href=#31>ASSIGN</a> command)
<li>with command files (see <a href=#91>SCRIPT</a> command)
</ul>
All these methods can be mixed.
<p>
Commands and parameters in <tt>CAPITAL LETTERS</tt> are entered directly (or
selected in the command menu with the mouse). For the input there is
no difference between small and capital letters.
<p>
Parameters in <tt>lowercase letters</tt> are replaced by names, number values or
key words. Example:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Syntax:   </td><td width=20><td><tt>GRID grid_size grid_multiple;</tt></td></tr>
<tr><td>Input:    </td><td width=20><td><tt>GRID 1 10;</tt></td></tr>
</table>
<h2>Shorten key words</h2>
For command names and other key words, only so many characters must be
entered that they clearly differ from other key words.
<h2>Alternative Parameters</h2>
The sign | means that alternative parameters can be indicated. Example:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Syntax:   </td><td width=20><td><tt>SET BEEP OFF | ON;</tt></td></tr>
<tr><td>Input:    </td><td width=20><td><tt>SET BEEP OFF;</tt></td></tr>
<tr><td>          </td><td width=20><td>or</td></tr>
<tr><td>          </td><td width=20><td><tt>SET BEEP ON;</tt></td></tr>
</table>
<h2>Repetition Points</h2>
The signs .. mean that the function can be executed several times
or that several parameters of the same type are allowed. Example:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Syntax:   </td><td width=20><td><tt>DISPLAY option layer_name..</tt></td></tr>
<tr><td>Input:    </td><td width=20><td><tt>DISPLAY TOP PINS VIAS</tt></td></tr>
</table>
<h2>Coordinates</h2>
The sign &#149; normally means that an object has to be selected with the
left mouse button at this point in the command. Example:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Syntax:   </td><td width=20><td><tt>MOVE &#149; &#149;..</tt></td></tr>
<tr><td>Input:    </td><td width=20><td><tt>MOVE</tt></td></tr>
<tr><td>          </td><td width=20><td><tt>Mouse click on the first element to be moved</tt></td></tr>
<tr><td>          </td><td width=20><td><tt>Mouse click on the target position</tt></td></tr>
<tr><td>          </td><td width=20><td><tt>Mouse click on the second element to be moved</tt></td></tr>
<tr><td>          </td><td width=20><td><tt>etc.</tt></td></tr>
</table>
<p>
This example also explains the meaning of the repetition points for
commands with mouse clicks.
<p>
For the program each mouse click is the input of a coordinate. If
coordinates are to be entered as text, the input via the keyboard
must be as follows:
<pre>
(x y)
</pre>
x and y are numbers in the unit which has been selected with the GRID
command. The input as text is mainly required for script files.<br>
If a unit other than the one selected with the GRID command shall be used,
it can be appended to the given coordinates, as in
<pre>
(100mil 200mil)
</pre>
Allowed units are <tt>mm</tt>, <tt>mic</tt>, <tt>mil</tt> and <tt>in</tt>.
It is possible to use different units for x and y.<br>
The special coordinate
<pre>
(@)
</pre>
can be used to reference the current position of the mouse cursor within
the draw window. For example, the input
<pre>
MOVE R1 (@)
</pre>
would move the part named R1 to the place currently pointed to with the mouse.
<p>
Any combination of the following modifiers may follow the opening brace
in order to simulate a particular key that is held pressed with the
"mouse click" or to change the type of coordinates:
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>&gt;</tt></td><td width=20><td>right mouse button click</td></tr>
<tr><td><tt>A   </tt></td><td width=20><td>Alt key</td></tr>
<tr><td><tt>C   </tt></td><td width=20><td>Ctrl key</td></tr>
<tr><td><tt>P   </tt></td><td width=20><td>Polar coordinates (relative to the <a href=#63>mark</a>, x = radius, y = angle in degrees, counterclockwise)</td></tr>
<tr><td><tt>R   </tt></td><td width=20><td>Relative coordinates (relative to the <a href=#63>mark</a>)</td></tr>
<tr><td><tt>S   </tt></td><td width=20><td>Shift key</td></tr>
</table>
For example, the input
<pre>
(CR&gt; 1 2)
</pre>
would result in a "right button mouse click" at (1&nbsp;2) relative to the <a href=#63>mark</a>,
with the Ctrl key held down (of course what happens with this kind of input
will depend on the actual command). Note that if there is currently no mark
defined, coordinates with <tt>R</tt> or <tt>P</tt> will be relative to the
drawing's origin. Also, the modifier characters are not case sensitive, their
sequence doesn't matter and there doesn't have to be a blank between them and
the first coordinate digit. So the above example could also be written as
<tt>(r&gt;c1&nbsp;2)</tt>.
Values entered as "polar coordinates" will be stored internally as the corresponding
pair of (x&nbsp;y) coordinates.
<p>
As an example for entering coordinates as text let's assume you wish to enter the exact
dimensions for board outlines:
<pre>
GRID 1 MM;
CHANGE LAYER DIMENSION;
WIRE 0 (0 0) (160 0) (160 100) (0 100) (0 0);
GRID LAST;
</pre>
<h2>Decimal numbers</h2>
When entering decimal numbers in the command line of the editor window or in
dialog input fields, you can use the comma as the decimal delimiter (as in <tt>12,34</tt>),
if your locale settings allow this. However, when writing a script or a ULP that
returns EAGLE commands through the <tt>exit()</tt> function, you should always
use the 'dot' as the decimal delimiter (as in <tt>12.34</tt>), because otherwise
your script or ULP might not work on other systems. In general, it is recommended
to always use the 'dot' as the decimal delimiter.
<h2>Semicolon</h2>
The semicolon (';') terminates commands. A command needs to be terminated
with a semicolon if there fewer than the maximum possible number of options.
For example the command
<pre>
WINDOW;
</pre>
redraws the drawing window, whereas
<pre>
WINDOW FIT
</pre>
scales the drawing to fit entirely into the drawing window. There is no semicolon necessary here because it is already clear that the command is complete.


<a name=29>
<h1>ADD</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Add elements into a drawing.<br>
Add symbols into a device.
<dt>
<b>Syntax</b>
<dd>
<tt>ADD package_name[@library_name] [name] [orientation] &#149;..</tt><br>
<tt>ADD device_name[@library_name]  [name [gate]] [orientation] &#149;..</tt><br>
<tt>ADD symbol_name                 [name] [options] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> mirrors the part.<br>
<mb>Right</mb> rotates the part.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#101>UPDATE</a>,
<a href=#102>USE</a>,
<a href=#58>INVOKE</a>
<p>
The ADD command fetches a circuit symbol (gate) or a package from the active library and places it into the drawing.
<p>
During device definition the ADD command fetches a symbol into the device.
<p>
Usually you click the ADD command and select the package or symbol from the menu which opens. If necessary, parameters can now be entered via the keyboard.
<p>
If <tt>device_name</tt> contains wildcard characters (<tt>'*'</tt> or <tt>'?'</tt>) and more
than one device matches the pattern, the ADD dialog will be opened and the specific device
can be selected from the list.
Note that the <i>Description</i> checkbox in the ADD dialog will be unchecked after
any ADD command with a <tt>device_name</tt> has been given in the command line, no matter
if it contains wildcards or not. This is because a <tt>device_name</tt> entered in the
command line is only searched for in the device names, not in the descriptions.
<p>
The package or symbol is placed with the left button and rotated with the right button. After it has been placed another copy is immediately hanging from the cursor.
<p>
If there is already a device or package with the same name (from the same library) in the drawing,
and the library has been modified after the original object was added, an automatic
<a href=#101>library update</a> will be started and you will be asked whether
objects in the drawing shall be replaced with their new versions.
<b>Note: You should always run a <a href=#46>Design Rule Check</a> (DRC) and an
<a href=#48>Electrical Rule Check</a> (ERC) after a library update has been performed!</b>
<h2>Fetching a Package or Symbol into a Drawing</h2>
<h3>Wildcards</h3>
The ADD command can be used with wildcards (<tt>'*'</tt> or <tt>'?'</tt>) to find
a specific device. The ADD dialog offers a tree view of the matching
devices, as well as a preview of the device and package variant.
<p>
To add directly from a specific library, the command syntax
<pre>
ADD devicename@libraryname
</pre>
can be used. <tt>devicename</tt> may contain wildcards and <tt>libraryname</tt> can
be either a plain library name (like "ttl" or "ttl.lbr") or a full
file name (like "/home/mydir/myproject/ttl.lbr" or "../lbr/ttl").
<h3>Names</h3>
The package_name, device_name or symbol_name parameter is the name under which the package, device or symbol is stored in the library.
It is usually selected from a menu. The name parameter is the name which the element is to receive in the drawing.
If the name could be interpreted as an orientation or option, it must be enclosed in single quotes.
If a name is not explicitly given it will receive an automatically generated name.
<p>
Example:
<pre>
ADD DIL14 IC1 &#149;
</pre>
fetches the DIL14 package to the board and gives it the name IC1.
<p>
If no name is given in the schematic, the gate will receive the prefix that was specified in the device definition with <a href=#78>PREFIX</a>, expanded with a sequential number (e.g. IC1).
<p>
Example:
<pre>
ADD 7400 &#149; &#149; &#149; &#149; &#149;
</pre>
This will place a sequence of five gates from 7400 type components. Assuming that the prefix is defined as "IC" and that the individual gates within a 7400 have the names A..D, the gates in the schematic will be named IC1A, IC1B, IC1C, IC1D, IC2A. (If elements with the same prefix have already been placed the counting will proceed from the next sequential number.) See also <a href=#58>INVOKE</a>.
<p>
While an object is attached to the cursor, you can change the name under which
it will be added to the drawing. This allows you to add several parts of the same
type, but with different, explicitly defined names:
<p>
Example:
<pre>
ADD CAP C1 &#149; C5 &#149; C7 &#149;
</pre>
<h3>Particular Gates</h3>
To fetch a particular gate of a newly added device the name of that gate can be given following the part name:
<p>
Example:
<pre>
ADD 7400 IC1 A &#149;
</pre>
This is mainly useful if a schematic is to be generated through a script. Note that if a particular
gate is added, no other gates with add level MUST or ALWAYS will be fetched automatically, and you will have to
use the <a href=#58>INVOKE</a> command to invoke at least the MUST gates (otherwise
the <a href=#48>Electrical Rule Check</a> will report them as missing).
<h3>Orientation</h3>
This parameter defines the orientation of the object in the drawing.
Objects are normally rotated using the right mouse button.
In <a href=#91>Script</a> files textual descriptions of this parameter are used:
<p>
<b><tt>[S][M]Rnnn</tt></b>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b><tt>S</tt></b>   </td><td width=20><td>sets the <b>S</b>pin flag, which disable keeping texts readable from the bottom or right side of the drawing (only available in a board context)</td></tr>
<tr><td><b><tt>M</tt></b>   </td><td width=20><td>sets the <b>M</b>irror flag, which mirrors the object about the y-axis</td></tr>
<tr><td><b><tt>Rnnn</tt></b></td><td width=20><td>sets the <b>R</b>otation to the given value, which may be in the range <tt>0.0</tt>...<tt>359.9</tt> (at a resolution of 0.1 degrees) in a board context, or one of <tt>0</tt>, <tt>90</tt>, <tt>180</tt> or <tt>270</tt> in a schematic context (angles may be given as negative values, which will be converted to the corresponding positive value)</td></tr>
</table>
<p>
The key letters <b><tt>S</tt></b>, <b><tt>M</tt></b> and <b><tt>R</tt></b> may be given
in upper- or lowercase, and there must be at least <b><tt>R</tt></b> followed by a number.
<p>
If the <b>M</b>irror flag is set in an element as well as in a text within the
element's package, they cancel each other out.
The same applies to the <b>S</b>pin flag.
<p>
Examples:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>R0 </td><td width=20><td>no rotation</td></tr>
<tr><td>R90    </td><td width=20><td>rotated 90&deg; counterclockwise</td></tr>
<tr><td>R-90   </td><td width=20><td>rotated 90&deg; clockwise (will be converted to 270&deg;)</td></tr>
<tr><td>MR0    </td><td width=20><td>mirrored about the y-axis</td></tr>
<tr><td>SR0    </td><td width=20><td>spin texts</td></tr>
<tr><td>SMR33.3</td><td width=20><td>rotated 33.3&deg; counterclockwise, mirrored and spin texts</td></tr>
</table>
<p>
Default: R0
<p>
<pre>
ADD DIL16 R90 (0 0);
</pre>
places a 16-pin DIL package, rotated 90 degrees counterclockwise, at coordinates (0 0).
<h3>Error messages</h3>
An error message appears if a gate is to be fetched from a device which is not fully defined (see <a href=#34>BOARD</a> command). This can be prevented with the "<a href=#92>SET</a> CHECK_CONNECTS OFF;" command. Take care: The BOARD command will perform this check in any case. Switching it off is only sensible if no pcb is to be made.
<h2>Fetch Symbol into Device</h2>
During device definition the ADD command fetches a previously defined symbol into the device. Two parameters (swaplevel and addlevel) are possible, and these can be entered in any sequence. Both can be preset and changed with the <a href=#36>CHANGE</a> command. The value entered with the ADD command is also retained as a default value.
<h3>Swaplevel</h3>
The swaplevel is a number in the range 0..255, to which the following rules apply:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>0:  </td><td width=20><td>The symbol (gate) can not be swapped with any other in the schematic.</td></tr>
<tr><td>1..255       </td><td width=20><td>The symbol (gate) can be swapped with any other symbol of the same type in the schematic that has the same swaplevel (including swapping between different devices).</td></tr>
</table>
<p>
Default: 0
<h3>Addlevel</h3>
The following possibilities are available for this parameter:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>Next</tt>   </td><td width=20><td>If a device has more than one gate, the symbols are fetched into the schematic with Addlevel Next.</td></tr>
<tr><td><tt>Must</tt>   </td><td width=20><td>If any symbol from a device is fetched into the schematic, then a symbol defined with Addlevel Must must also appear. This happens automatically. It cannot be deleted until all the other symbols in the device have been deleted. If the only symbols remaining from a device are Must-symbols, the DELETE command will delete the entire device.</td></tr>
<tr><td><tt>Always</tt> </td><td width=20><td>Like Must, although a symbol with Addlevel Always can be deleted and brought back into the schematic with <a href=#58>INVOKE</a>.</td></tr>
<tr><td><tt>Can</tt>    </td><td width=20><td>If a device contains Next-gates, then Can-gates are only fetched if explicitly called with INVOKE. A symbol with Addlevel Can is only then fetched into the schematic with ADD if the device only contains Can-gates and Request-gates.</td></tr>
<tr><td><tt>Request</tt></td><td width=20><td>This property is usefully applied to devices' power-symbols. Request-gates can only be explicitly fetched into the schematic (INVOKE) and are not internally counted. The effect of this is that in devices with only one gate and one voltage supply symbol, the gate name is not added to the component name. In the case of a 7400 with four gates (plus power supply) the individual gates in the schematic are called, for example, IC1A, IC1B, IC1C and IC1D. A 68000 with only one <i>Gate</i>, the processor symbol, might on the other hand be called IC1, since its separate voltage supply symbol is not counted as a gate.  </td></tr>
</table>
<p>
Example:
<pre>
ADD PWR 0 REQUEST &#149;
</pre>
fetches the PWR symbol (e.g. a power pin symbol), and defines a Swaplevel of 0 (not swappable) and the Addlevel <i>Request</i> for it.


<a name=30>
<h1>ARC</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Draw an arc of variable diameter, width, and length.
<dt>
<b>Syntax</b>
<dd>
<tt>ARC ['signal_name'] [CW | CCW] [ROUND | FLAT] [width] &#149; &#149; &#149;</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.<br>
<mb>Right</mb> changes the orientation.
</dl>
<b>See also</b> <a href=#36>CHANGE</a>,
<a href=#106>WIRE</a>,
<a href=#37>CIRCLE</a>
<p>
The ARC command, followed by three mouse clicks on a drawing, draws
an arc of defined width. The first point defines a point on a circle,
the second its diameter. Entering the second coordinate reduces the
circle to a semi-circle, while the right button alters the direction
from first to second point. Entry of a third coordinate truncates
the semi-circle to an arc extending to a point defined by the intersection
of the circumference and a line between the third point and the arc
center.
<p>
The parameters CW and CCW enable you to define the direction of the
arc (clockwise or counterclockwise). ROUND and FLAT define whether the arc
endings are round or flat, respectively.
<h2>Signal name</h2>
The <tt>signal_name</tt> parameter is intended mainly to be used in
script files that read in generated data. If a <tt>signal_name</tt>
is given, the arc will be added to that signal and no
automatic checks will be performed.<br>
<b>This feature should be used with great care because it could result
in short circuits if an arc is placed in a way that it would connect
different signals. Please run a
<a href=#46>Design Rule Check</a> after using the ARC command
with the <tt>signal_name</tt> parameter!</b>
<h2>Line Width</h2>
The parameter "width" defines the thickness of the drawn line.
It can be changed or predefined with the command:
<pre>
CHANGE WIDTH width;
</pre>
The adjusted width is identical to the line width for wires.
<p>
Arcs with angles of 0 or 360 degrees or a radius of 0 are
not accepted.
<p>
Example for text input:
<pre>
GRID inch 1;
ARC CW (0 1) (0 -1) (1 0);
</pre>
generates a 90-degree arc with the center at the origin.


<a name=31>
<h1>ASSIGN</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Modify key assignments.
<dt>
<b>Syntax</b>
<dd>
<tt>ASSIGN</tt><br>
<tt>ASSIGN function_key command..;</tt><br>
<tt>ASSIGN function_key;</tt>
<p>
<tt>function_key = modifier+key</tt><br>
<tt>modifier     = </tt>any combination of <tt>S</tt> (Shift), <tt>C</tt> (Control), <tt>A</tt> (Alt) and <tt>M</tt> (Cmd, Mac OS X only)<br>
<tt>key          = F1..F12, A-Z, 0-9, BS</tt> (Backspace)
</dl>
<b>See also</b> <a href=#91>SCRIPT</a>,
<a href=#19>Keyboard and Mouse</a>
<p>
The ASSIGN command can be used to define the meaning of the function keys
<tt>F1</tt> thru <tt>F12</tt>, the letter keys <tt>A</tt> thru <tt>Z</tt>,
the (upper) digit keys <tt>0</tt> thru <tt>9</tt> and the <tt>backspace</tt>
key (each also in combination with modifier keys).
<p>
The ASSIGN command without parameters displays the present key
assignments in a dialog, which also allows you to modify these settings.
<p>
Keys can be assigned a single command or multiple commands. The command
sequence to be assigned should be enclosed in apostrophes.
<p>
If <tt>key</tt> is one of <tt>A-Z</tt> or <tt>0-9</tt>,
the <tt>modifier</tt> must contain at least <tt>A</tt>, <tt>C</tt> or <tt>M</tt>.
<table><tr><td valign="top"><img src="platforms-mac.png"></td><td valign="middle">
The <b><tt>M</tt></b> modifier is only available on <b>Mac OS X</b>.
</td></tr></table>
<p>
Please note that any special operating system function assigned to a function
key will be overwritten by the ASSIGN command
(depending on the operating system, ASSIGN may not be able to overwrite
certain function keys).<br>
If you assign to a letter key together with the modifier <tt>A</tt>,
(e.g. <tt>A+F</tt>), a corresponding hotkey from the pulldown menu is
no longer available.
<p>
To remove an assignment from a key you can enter <tt>ASSIGN</tt>
with only the function_key code, but no command.
<h2>Examples</h2>
<pre>
ASSIGN F7 'change layer top; route';
ASS A+F7 'cha lay to; rou';
ASSIGN C+F10 menu add mov rou ''';''' edit;
ASSIGN CA+R 'route';
</pre>
The first two examples have the same effect, since EAGLE allows abbreviations
not only with commands but also with parameters (as long as they are
unmistakable).
<p>
Please note that here, for instance, the change layer top command
is terminated by a semicolon, but not the route command. The
reason is that in the first case the command already contains all
the necessary parameters, while in the second case coordinates still
have to be added (usually with the mouse). Therefore the ROUTE command
must not be deactivated by a semicolon.
<h2>Define Command Menu</h2>
If you want to assign the MENU command to a key, the separator
character in the MENU command (semicolon) has to be enclosed in three
pairs of apostrophes (see the third example). This semicolon will
show up in the new menu.
<h2>Presetting of key assignments</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>F1     HELP</tt> </td><td width=20><td>Help function</td></tr>
<tr><td><tt>Alt+F2 WINDOW FIT</tt>     </td><td width=20><td>The whole drawing is displayed</td></tr>
<tr><td><tt>F2     WINDOW;</tt>        </td><td width=20><td>Screen redraw</td></tr>
<tr><td><tt>F3     WINDOW 2</tt>       </td><td width=20><td>Zoom in by a factor of 2</td></tr>
<tr><td><tt>F4     WINDOW 0.5</tt>     </td><td width=20><td>Zoom out by a factor of 2</td></tr>
<tr><td><tt>F5     WINDOW (@);</tt>    </td><td width=20><td>Cursor pos. is new center</td></tr>
<tr><td><tt>F6     GRID;</tt>          </td><td width=20><td>Grid on/off</td></tr>
<tr><td><tt>F7     MOVE</tt>           </td><td width=20><td>MOVE command</td></tr>
<tr><td><tt>F8     SPLIT</tt>          </td><td width=20><td>SPLIT command</td></tr>
<tr><td><tt>F9     UNDO</tt>           </td><td width=20><td>UNDO command</td></tr>
<tr><td><tt>F10    REDO</tt>           </td><td width=20><td>REDO command</td></tr>
<tr><td><tt>Alt+BS UNDO</tt>           </td><td width=20><td>UNDO command</td></tr>
<tr><td><tt>Shift+Alt+BS REDO</tt>     </td><td width=20><td>REDO command</td></tr>
</table>


<a name=32>
<h1>ATTRIBUTE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Definition of attributes for parts.
<dt>
<b>Syntax</b>
<dd>
<tt>ATTRIBUTE name [ 'value' ] [ options ]</tt><br>
<tt>ATTRIBUTE part_name attribute_name</tt><br>
<tt>ATTRIBUTE part_name attribute_name 'attribute_value' [ [ orientation ] &#149; ]</tt><br>
<tt>ATTRIBUTE part_name attribute_name DELETE</tt><br>
<tt>ATTRIBUTE * [ name [ 'value' ] ]</tt><br>
<tt>ATTRIBUTE * name DELETE</tt><br>
<tt>ATTRIBUTE &#149;..</tt>
</dl>
<b>See also</b> <a href=#98>TECHNOLOGY</a>,
<a href=#68>NAME</a>,
<a href=#103>VALUE</a>,
<a href=#95>SMASH</a>,
<a href=#99>TEXT</a>
<p>
See the description of <tt>orientation</tt> at <a href=#29>ADD</a>.
<p>
An <i>attribute</i> is an arbitrary combination of a <i>name</i> and a <i>value</i>,
that can be used to specify any kind of information for a given part.
<p>
Attributes can be defined in the library (for individual devices), in the schematic
(for an actual part) or in the board (for an actual element). Attributes defined
on the device level will be used for every part of that device type in the schematic.
In a schematic, additional attributes can be defined for each part, and existing
attributes from the devices can be overwritten with new values (if the attributes
have been defined as <i>variable</i>). An element in the board has all the attributes
of its corresponding part, and can have further attributes of its own.
<h2>Attributes in the Library</h2>
In a library the ATTRIBUTE command can be used to define the attributes of a given
technology variant, using the syntax
<pre>
ATTRIBUTE name [ 'value' ] [ options ]
</pre>
The <tt>name</tt> may consist of any letters, digits, '_', '#' and '-' and may have
any length; the first character must not be '-', though. Names are treated
case insensitive, so PartNo is the same as PARTNO. The <tt>value</tt> may
contain any characters and must be enclosed in single quotes.
<p>
The valid <tt>options</tt> are:
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>delete</tt>  </td><td width=20><td>Delete the attribute with the given name from all technology variants (in this case there must be no 'value').</td></tr>
<tr><td><tt>variable</tt></td><td width=20><td>Mark this attribute as <i>variable</i>, so that it can be overwritten in the schematic (this is the default).</td></tr>
<tr><td><tt>constant</tt></td><td width=20><td>Attributes marked as <i>constant</i> cannot be overwritten in the schematic (unless the user insists). If a new attribute is defined for a device and has <i>constant</i> set, this setting is copied to all other technologies as well.</td></tr>
</table>
Options may be abbreviated and are case insensitive.
<p>
An already existing attribute can be switched between <i>variable</i> and
<i>constant</i> without the need to repeat its value, as in
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>ATTRIBUTE ABC '123'</tt>   </td><td width=20><td>(variable by default)</td></tr>
<tr><td><tt>ATTRIBUTE ABC constant</tt></td><td width=20><td>(ABC retains its value '123')</td></tr>
</table>
If the value of an attribute is changed, its <i>constant/variable</i> setting
remains unchanged (unless explicitly given).
<p>
The attribute names NAME, PART, GATE, DRAWING_NAME, LAST_DATE_TIME,
PLOT_DATE_TIME and SHEET are not allowed, since they would interfere with
the already existing <a href=#99>text variables</a>. If an attribute
named VALUE is defined, its value will be used to initialize the actual value when
placing a part in a schematic (in case the device set has 'Value On').
<h2>Attributes in the Schematic</h2>
In a schematic, the ATTRIBUTE command can be used to assign attributes to
a part, in which case the value of such an attribute overwrites the value
of the attribute with the same name in the library (if the device has such
an attribute and allows overwriting). A part may also be given attributes
that are not defined in the library at all.
<p>
Selecting the ATTRIBUTE command and clicking on a part shows a dialog in which all
attributes of that part are listed and can be edited.
<p>
For a fully textual definition of an attribute, the following syntax can be used:
<pre>
ATTRIBUTE part_name attribute_name 'attribute_value' orientation &#149;
</pre>
Note that in case of a multi-gate part, actually one of the gates (i.e.
"instances") is selected. When selecting it via a mouse click it is already
clear which gate is meant, while when selecting it via part_name, the full
name consisting of the part and gate name should be given.
While a specific part can only have one attribute with a given name, the
attribute can be attached to any or all of its gates.
If only the part name is given, the first visible gate will be implicitly
selected.
<p>
If no coordinates are given (and the command is terminated with a <tt>';'</tt>),
the behavior depends on whether the given attribute already exists for that
part (either in the device or in the schematic). If the attribute already exists,
only its value will be changed. If it doesn't exist yet, a new attribute with
the given name and value will be placed at the origin of the selected gate of the part.
<p>
To delete an attribute from a part, the command
<pre>
ATTRIBUTE part_name attribute_name DELETE
</pre>
can be used.
<p>
When defining attributes via the command line or a script, use the
<a href=#36>CHANGE</a> DISPLAY command to define which parts of the
attribute (name, value, both or none of these) shall be visible.
<h2>Attributes in the Board</h2>
In a board, attributes can be assigned to elements with the ATTRIBUTE
command, much the same as in schematics. By default elements have all the
attributes that are defined for their part in the schematic (and their
device in the library). Attributes with the same name for a given
element/part pair will always have the same value (through <a href=#354>Forward&amp;Back Annotation</a>).
Elements can have additional attributes that are not present in the
schematic or library.
<h2>Global attributes</h2>
Global attributes can be defined in boards and schematics by using <tt>'*'</tt> as
the part name (which implies that this attribute applies to <i>all</i> parts).
Alternatively global attributes can be defined through the menu option
"Edit/Global attributes...". The global attributes of board and schematic
are handled separately and are not connected via <a href=#354>Forward&amp;Back-Annotation</a>.
<p>
Such an attribute could for instance be the author of a drawing, and can be used
in the title block of a drawing's frame. It will be shown on every schematic sheet
that has a drawing frame that contains a <a href=#99>text variable</a>
with the same name.
<h2>Selecting the layer</h2>
Unlike other commands (like WIRE, for instance), the ATTRIBUTE command keeps track
of its last used layer by itself. This has the advantage of making sure that
attributes are always drawn into the right layer, no matter what layers other
commands draw into. The downside of this is that the usual way of setting the layer
in a script, as in
<pre>
LAYER <i>layer</i>;
WIRE (1 2) (3 4);
</pre>
doesn't work here. The layer needs to be selected while the ATTRIBUTE command is
already active, which can be done like this
<pre>
ATTRIBUTE <i>parameters</i>
LAYER <i>layer</i>
<i>more parameters</i>;
</pre>
Note that the ATTRIBUTE line is <b>not</b> terminated with a <tt>';'</tt>, and
that the LAYER command starts on a new line.<br>
The commands
<pre>
ATTRIBUTE
LAYER <i>layer</i>;
</pre>
set the layer to use with subsequent ATTRIBUTE commands.
<h2>Examples</h2>
First the package and technology has to be selected (in case there is more
than one) and then attributes for that technology can be defined:
<pre>
PACKAGE N;
TECHNOLOGY LS;
ATTRIBUTE PartNo '12345-ABC';
ATTRIBUTE Temp '100K' constant;
ATTRIBUTE Remark 'mount manually';
</pre>


<a name=33>
<h1>AUTO</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Starts the Autorouter
<dt>
<b>Syntax</b>
<dd>
<tt>AUTO;</tt><br>
<tt>AUTO signal_name..;</tt><br>
<tt>AUTO ! signal_name..;</tt><br>
<tt>AUTO &#149;..;</tt><br>
<tt>AUTO FOLLOWME</tt><br>
<tt>AUTO LOAD|SAVE filename;</tt>
</dl>
<b>See also</b> <a href=#94>SIGNAL</a>,
<a href=#89>ROUTE</a>,
<a href=#106>WIRE</a>,
<a href=#81>RATSNEST</a>,
<a href=#92>SET</a>
<p>
The AUTO command activates the integrated
<a href=#131>Autorouter</a>. If signal names
are specified or signals are selected with the mouse, only these signals
are routed. Without parameters the command will try to route all signals.
If a "!" character is specified all signals are routed except the
signals following the "!" character. The "!" character must be the
first parameter and must show up only once.
<p>
The <tt>LOAD</tt> and <tt>SAVE</tt> options can be used to load the Autorouter parameters
from or save them to the given file. If <i>filename</i> doesn't have the extension
<tt>".ctl"</tt> it will be appended automatically.
<p>
Without any parameters (or if no terminating <tt>';'</tt> is given), the AUTO command
opens a dialog in which the parameters that control the routing algorithm can
be configured. The special option <tt>FOLLOWME</tt> opens this dialog in a mode
where only the parameters controlling the <a href=#89>Follow-me router</a>
can be modified.
<h2>Example</h2>
<pre>
AUTO ! GND VCC;
</pre>
In every case the semicolon is necessary as a terminator. A menu for
adjusting the Autorouter control parameters opens if you select AUTO
from the command menu or type in AUTO from the keyboard (followed
by Return key).
<h2>Wildcards</h2>
If a <tt>signal_name</tt> parameter is given, the characters <tt>'*'</tt>, <tt>'?'</tt>
and <tt>'[]'</tt> are <i>wildcards</i> and have the following meaning:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>*</tt>    </td><td width=20><td>matches any number of any characters</td></tr>
<tr><td><tt>?</tt>    </td><td width=20><td>matches exactly one character</td></tr>
<tr><td><tt>[...]</tt></td><td width=20><td>matches any of the characters between the brackets</td></tr>
</table>
<p>
If any of these characters shall be matched exactly as such, it has to be enclosed
in brackets. For example, <tt>abc[*]ghi</tt> would match <tt>abc*ghi</tt> and not
<tt>abcdefghi</tt>.
<p>
A range of characters can be given as <tt>[a-z]</tt>, which results in any character
in the range <tt>'a'</tt>...<tt>'z'</tt>.
<h2>Polygons</h2>
When the Autorouter is started all <a href=#77>Polygons</a> are
calculated.
<h2>Protocol File</h2>
A protocol file (name.pro) is generated automatically.
<h2>Board Size</h2>
The Autorouter puts a rectangle around all objects in the board
and takes the size of this rectangle as the routing area. Wires
in the Dimension layer are border lines for the
Autorouter. This means you can delimit the route area with closed
lines drawn into this layer with the WIRE command.
<p>
In practice you draw the board outlines into the Dimension layer with
the WIRE command and place the components within this area.
<h2>Signals</h2>
Signals defined with EAGLE's SIGNAL command, polygons, and wires drawn
onto the Top, Bottom, and ROUTE2...15 layers are recognized by the
Autorouter.
<h2>Restricted Areas</h2>
Objects in the layers tRestrict, bRestrict,
and vRestrict are treated as restricted areas for the Top and Bottom
side and for vias respectively.
<p>
If you want the Autorouter not to use a layer, select "N/A" in the
preferred direction field.
<h2>Canceling</h2>
If you cancel the Autorouter by clicking on the STOP button, any airwires
that have not yet been routed, are not automatically recalculated.
Use the <a href=#81>RATSNEST</a> command to do this.


<a name=34>
<h1>BOARD</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Converts a schematic into a board.
<dt>
<b>Syntax</b>
<dd>
<tt>BOARD [ grid ]</tt>
</dl>
<b>See also</b> <a href=#47>EDIT</a>
<p>
The command BOARD is used to convert a schematic drawing into a board.
<p>
If the board already exists, it will be loaded into a board window.
<p>
If the board does not exist, you will be asked whether to create that new
board.
If a <tt>grid</tt> is given, the parts on the board will be placed in
the given raster, as in
<pre>
BOARD 5mm
</pre>
which would place the parts in a 5 millimeter raster (default is 50mil).
The number must be given with a unit, and the maximum allowed value
is 10mm.
<p>
The BOARD command will never overwrite an existing board file. To create
a new board file if there is already a file with that name, you have to
<a href=#84>remove</a> that file first.
<h2>Creating a board from a schematic</h2>
The first time you edit a board the program checks if there is a
schematic with the same name in the same directory and gives you the
choice to create the board from that schematic.<br>
If you have opened a schematic window and want to create a board, just
type
<pre>
edit .brd
</pre>
in the editor window's command line.
<p>
All relevant data from the schematic file (name.sch) will be converted to a
board file (name.brd). The new board is loaded automatically as an empty
card with a size of 160x100mm
(<a href=#360>Light edition</a>: 100x80mm).
All packages and connections are shown on the left side
of the board. Supply pins are already connected
(see <a href=#75>PIN</a> command).
<p>
If you need board outlines different to the ones that are generated
by default, simply delete the respective lines and use the
<a href=#106>WIRE</a> command to draw your own outlines into
the <i>Dimension</i> layer. The recommended width for these lines is 0.
<p>
A board file cannot be generated:
<ul>
<li>if there are gates in the schematic from a device
for which no package has been defined (error message: "device
name has no package). Exception: if there are only pins with
Direction "Sup" (supply symbols)
<li>if there are gates in the schematic from a device
for which not all pins have been assigned to related pads of a package
(error message: "device name has unconnected pins"). Exception:
device without pins (e.g. frames)
</ul>


<a name=35>
<h1>BUS</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Draws buses in a schematic.
<dt>
<b>Syntax</b>
<dd>
<tt>BUS [bus_name] &#149; [curve | @radius] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Right</mb> changes the wire bend style (see <a href=#92>SET Wire_Bend</a>).<br>
<mb>Shift+Right</mb> reverses the direction of switching bend styles.<br>
<mb>Ctrl+Right</mb> toggles between corresponding bend styles.
</dl>
<b>See also</b> <a href=#69>NET</a>,
<a href=#68>NAME</a>,
<a href=#92>SET</a>
<p>
The command BUS is used to draw bus connections onto the Bus layer
of a schematic diagram. Bus_name has the following form:
<pre>
SYNONYM:partbus,partbus,..
</pre>
where SYNONYM can be any name.
Partbus is either a simple net name or a bus name range of the following form:
<pre>
Name[LowestIndex..HighestIndex]
</pre>
where the following condition must be met:
<p>
0 &lt;= LowestIndex &lt;= HighestIndex &lt;= 511
<p>
If a name is used with a range, that name must not end with digits, because
it would become unclear which digits belong to the Name and which belong to
the range.
<p>
If a bus wire is placed at a point where there is already another bus
wire, the current bus wire will be ended at that point.
This function can be disabled with "<tt>SET AUTO_END_NET OFF;</tt>",
or by unchecking "Options/Set/Misc/Auto end net and bus".
<p>
If the <i>curve</i> or <i>@radius</i> parameter is given, an arc can be drawn as part of the bus
(see the detailed description in the <a href=#106>WIRE</a> command).
<h2>Bus name examples</h2>
<pre>
A[0..15]
RESET
DB[0..7],A[3..4]
ATBUS:A[0..31],B[0..31],RESET,CLOCK,IOSEL[0..1]
</pre>
If no bus name is used, a name of the form B$1 is automatically allocated.
This name can be changed with the NAME command at any time.
<p>
The line width used by the bus can be defined for example with
<pre>
SET Bus_Wire_Width 40;
</pre>
to be 40 mil. (Default: 30 mil).
<h2>Inverted signals</h2>
The name of an inverted signal ("active low") can be displayed overlined if it
is preceded with an exclamation mark (<tt>'!'</tt>), as in
<pre>
  ATBUS:A[0..31],B[0..31],!RESET,CLOCK,IOSEL[0..1]
</pre>
which would result in
<pre>
                          _____
  ATBUS:A[0..31],B[0..31],RESET,CLOCK,IOSEL[0..1]
</pre>
You can find further details about this in the description of the <a href=#99>TEXT</a> command.


<a name=36>
<h1>CHANGE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Changes parameters.
<dt>
<b>Syntax</b>
<dd>
<tt>CHANGE option &#149; &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Right</mb> changes parameter of the group.
</dl>
The CHANGE command is used to change or preset properties of objects.
The objects are clicked on with the mouse after the desired parameters
have been selected from the CHANGE command menu or have been typed
in from the keyboard.
<p>
Parameters adjusted with the CHANGE command remain as preset
properties for objects added later.
<p>
All values in the CHANGE command are used according to the actual grid
unit.
<h2>Change Groups</h2>
When using the CHANGE command with a group, the group is first identified
with the <a href=#54>GROUP</a> command before
entering the CHANGE command with appropriate parameters. The right
button of the mouse is then used to execute the changes.
<h2>What can be changed?</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Layer                </td><td width=20><td><tt>CHANGE LAYER name | number</tt></td></tr>
<tr><td>Text                 </td><td width=20><td><tt>CHANGE TEXT [ text ]</tt></td></tr>
<tr><td>Text height          </td><td width=20><td><tt>CHANGE SIZE value</tt></td></tr>
<tr><td>Text line width      </td><td width=20><td><tt>CHANGE RATIO ratio</tt></td></tr>
<tr><td>Text font            </td><td width=20><td><tt>CHANGE FONT VECTOR | PROPORTIONAL | FIXED</tt></td></tr>
<tr><td>Wire width           </td><td width=20><td><tt>CHANGE WIDTH value</tt></td></tr>
<tr><td>Wire style           </td><td width=20><td><tt>CHANGE STYLE value</tt></td></tr>
<tr><td>Arc cap              </td><td width=20><td><tt>CHANGE CAP ROUND | FLAT</tt></td></tr>
<tr><td>Pad shape            </td><td width=20><td><tt>CHANGE SHAPE SQUARE | ROUND | OCTAGON | LONG | OFFSET</tt></td></tr>
<tr><td>Pad/via/smd flags    </td><td width=20><td><tt>CHANGE STOP | CREAM | THERMALS | FIRST  OFF | ON</tt></td></tr>
<tr><td>Pad/via diameter     </td><td width=20><td><tt>CHANGE DIAMETER diameter</tt></td></tr>
<tr><td>Pad/via/hole drill   </td><td width=20><td><tt>CHANGE DRILL value</tt></td></tr>
<tr><td>Via layers           </td><td width=20><td><tt>CHANGE VIA from-to</tt></td></tr>
<tr><td>Smd dimensions       </td><td width=20><td><tt>CHANGE SMD width height</tt></td></tr>
<tr><td>Pin parameters       </td><td width=20><td><tt>CHANGE DIRECTION NC | IN | OUT | I/O | OC | HIZ | SUP | PAS | PWR | SUP</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE FUNCTION NONE | DOT | CLK | DOTCLK</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE LENGTH POINT | SHORT | MIDDLE | LONG</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE VISIBLE BOTH | PAD | PIN | OFF</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE SWAPLEVEL number</tt></td></tr>
<tr><td>Polygon parameters   </td><td width=20><td><tt>CHANGE THERMALS OFF | ON</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE ORPHANS OFF | ON</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE ISOLATE distance</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE POUR SOLID | HATCH</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE RANK value</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE SPACING distance</tt></td></tr>
<tr><td>Gate parameters      </td><td width=20><td><tt>CHANGE SWAPLEVEL number</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE ADDLEVEL NEXT | MUST | ALWAYS | CAN | REQUEST</tt></td></tr>
<tr><td>Net class            </td><td width=20><td><tt>CHANGE CLASS number | name</tt></td></tr>
<tr><td>Package              </td><td width=20><td><tt>CHANGE PACKAGE part_name [device_name] | 'device_name' [part_name]</tt></td></tr>
<tr><td>Technology           </td><td width=20><td><tt>CHANGE TECHNOLOGY part_name [device_name] | 'device_name' [part_name]</tt></td></tr>
<tr><td>Attribute display    </td><td width=20><td><tt>CHANGE DISPLAY OFF | VALUE | NAME | BOTH</tt></td></tr>
<tr><td>Frame parameters     </td><td width=20><td><tt>CHANGE COLUMS value</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE ROWS value</tt></td></tr>
<tr><td>                     </td><td width=20><td><tt>CHANGE BORDER NONE | BOTTOM | RIGHT | TOP | LEFT | ALL</tt></td></tr>
<tr><td>Label                </td><td width=20><td><tt>CHANGE XREF OFF | ON</tt></td></tr>
</table>


<a name=37>
<h1>CIRCLE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds circles to a drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>CIRCLE &#149; &#149;..       [center, circumference]</tt><br>
<tt>CIRCLE width &#149; &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.
</dl>
<b>See also</b> <a href=#36>CHANGE</a>,
<a href=#106>WIRE</a>
<p>
The CIRCLE command is used to create circles. Circles in the layers
tRestrict, bRestrict, and vRestrict define restricted
areas. They should be defined with a width of 0.
<p>
The width parameter defines the width of the circle's circumference
and is the same parameter as used in the WIRE command. The width can
be changed with the command:
<pre>
CHANGE WIDTH width;
</pre>
where <i>width</i> is the desired value in the current unit.
<p>
A circle defined with a width of 0 will be filled.
<h2>Example</h2>
<pre>
GRID inch 1;
CIRCLE (0 0) (1 0);
</pre>
generates a circle with a radius of 1 inch and the center at the origin.


<a name=38>
<h1>CLASS</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Define and use net classes.
<dt>
<b>Syntax</b>
<dd>
<tt>CLASS</tt><br>
<tt>CLASS number|name</tt><br>
<tt>CLASS number [ name [ width [ clearance [ drill ] ] ] ] [ number:clearance .. ]</tt>
</dl>
<b>See also</b> <a href=#133>Design Rules</a>,
<a href=#69>NET</a>,
<a href=#94>SIGNAL</a>,
<a href=#36>CHANGE</a>
<p>
The CLASS command is used to define or use net classes.
<p>
Without parameters, it offers a dialog in which the net classes can be defined.
<p>
If only a <tt>number</tt> or <tt>name</tt> is given, the net class with the given
number or name is selected and will be used for subsequent NET and SIGNAL commands.
<p>
If both a <tt>number</tt> and a <tt>name</tt> are given, the net class with the
given number will be assigned all the following values and will also be used for
subsequent NET and SIGNAL commands. If any of the parameters following <tt>name</tt>
are omitted, the net class will keep its respective value.
<p>
If <tt>number</tt> is negative, the net class with the absolute value of <tt>number</tt>
will be cleared. The default net class <tt>0</tt> can't be cleared.
<p>
Net class names are handled case insensitive, so SUPPLY would be the same as Supply
or SuPpLy.
<p>
Using several net classes in a drawing increases the time the
Autorouter needs to do its job. Therefore it makes sense to use only as few net
classes as necessary (only the number of net classes actually used by nets or
signals count here, not the number of defined net classes).
<p>
In order to avoid conflicts when CUT/PASTEing between drawings it makes sense
to define the same net classes under the same numbers in all drawings.
<p>
The Autorouter processes signals sorted by their total width requirements (Width
plus Clearance), starting with those that require the most space. The bus router
only routes signals with net class <tt>0</tt>.
<p>
The net class of an existing net/signal can be changed with the CHANGE command.
Any changes made by the CLASS command will not be stored in the UNDO/REDO buffer.
<h2>Width</h2>
The <i>width</i> parameter defines a minimum width that all objects in this
net class must have.
<h2>Clearance</h2>
The <i>clearance</i> parameter defines the minimum clearance between objects
of different signals in this net class and objects in other net classes.
<h2>Drill</h2>
The <i>drill</i> parameter defines a minimum drill size that all objects in this
net class must have (only applies to objects that actually have a drill parameter,
like pads and vias).
<h2>Clearance between net classes</h2>
If a clearance is given in the form <tt>number:clearance</tt>, it defines the
minimum clearance between signals in this net class and signals in the net class
with the given <tt>number</tt>. The command
<pre>
CLASS 3 1:0.6mm 2:0.8mm
</pre>
defines a minimum clearance of 0.6mm between signals in net classes 1 and 3,
and one of 0.8mm between signals in net classes 2 and 3. Note that the numbers in
<tt>number:clearance</tt> must be less than or equal to the number of the net class
itself (<tt>'3'</tt> in the above example), so
<pre>
CLASS 3 1:0.6mm 2:0.8mm 3:0.2mm
</pre>
would also be valid, whereas
<pre>
CLASS 3 1:0.6mm 2:0.8mm 3:0.2mm 4:0.5mm
</pre>
would not be allowed.


<a name=39>
<h1>CLOSE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Closes an editor window.
<dt>
<b>Syntax</b>
<dd>
<tt>CLOSE</tt>
</dl>
<b>See also</b> <a href=#70>OPEN</a>,
<a href=#47>EDIT</a>,
<a href=#107>WRITE</a>,
<a href=#91>SCRIPT</a>
<p>
The CLOSE command is used to close an editor window. If the drawing you
are editing has been modified you will be prompted whether you wish to
save it.
<p>
This command is mainly used in script files.


<a name=40>
<h1>CONNECT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Assigns package pads to symbol pins.
<dt>
<b>Syntax</b>
<dd>
<tt>CONNECT</tt><br>
<tt>CONNECT symbol_name.pin_name pad_name..</tt><br>
<tt>CONNECT pin_name pad_name..</tt>
</dl>
<b>See also</b> <a href=#78>PREFIX</a>,
<a href=#70>OPEN</a>,
<a href=#39>CLOSE</a>,
<a href=#91>SCRIPT</a>
<p>
This command is used in the device editing mode in order to define
the relationship between the pins of a symbol and the pads of the
corresponding package in the library. First of all, it is necessary
to define which package is to be used by means of the PACKAGE command.
<p>
If the CONNECT command is invoked without parameters, a dialog is
presented which allows you to interactively assign the connections.
<h2>Device with one Symbol</h2>
If only one symbol is included in a device, the parameter symbol_name
can be dropped, e.g.:
<pre>
CONNECT gnd 1 rdy 2 phi1 3 !irq 4 nc1 5...
</pre>
(Note: "!" is used to indicate inverted data signals.)
<h2>Device with Several Symbols</h2>
If several symbols are present in a device, parameters must be entered
with symbol_name, pin_name and pad_name each time. For example:
<pre>
CONNECT A.I1     1  A.I2  2   A.O  3;
CONNECT B.I1     4  B.I2  5   B.O  6;
CONNECT C.I1    13  C.I2  12  C.O 11;
CONNECT D.I1    10  D.I2  9   D.O  8;
CONNECT PWR.gnd  7;
CONNECT PWR.VCC 14;
</pre>
In this case, the connections for four NAND gates of a good old 7400
are allocated. The device includes five symbols - A, B, C, D,
and PWR. The gate inputs are named I1 and I2 while the output is named O.
<p>
The CONNECT command can be repeated as often as required. It may be
used with all pin/pad connections or with only certain pins. Each
new CONNECT command overwrites the previous conditions for the relevant
pins.
<h2>Gate or Pin names that contain periods</h2>
If a gate or pin name contains a period, simply enter them without any special
consideration (no quoting or escape characters are necessary).
<h2>Example</h2>
<pre>
ed 6502.dev;
prefix 'IC';
package dil40;
connect gnd 1 rdy 2 phi1 3 !irq 4 nc1 5 !nmi 6 \
        sync 7 vcc 8  a0 9 a1 10 a2 11 a3 12 a4 \
        13 a5 14 a6 15 a7 16 a8 17 a9 18 a10 19 \
        a11 20 p$0 21 a12 22 a13 23 a14 24 a15 \
        25 d7 26 d6 27 d5 28 d4 29 d3 30 d2 31 \
        d1 32 d0 33 r/w 34 nc2 35 nc3 36 phi0 37 \
        so 38 phi2 39 !res 40;
</pre>
If a command is continued at the next line, it is advisable to
insert the character "\" at the end of the line to ensure
the following text cannot be confused with an EAGLE command.
<p>
Confusing parameters with commands can also be avoided
by enclosing the parameters in apostrophes.


<a name=41>
<h1>COPY</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Copy objects.
<dt>
<b>Syntax</b>
<dd>
<tt>COPY &#149; &#149;..</tt><br>
<tt>COPY deviceset@library [name]</tt><br>
<tt>COPY package@library [name]</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Left</mb> selects an object at its origin.<br>
<mb>Ctrl+Right</mb> selects the group.<br>
<mb>Center</mb> mirrors the selected object or the group.<br>
<mb>Right</mb> rotates the selected object or the group.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#54>GROUP</a>,
<a href=#42>CUT</a>,
<a href=#74>PASTE</a>,
<a href=#29>ADD</a>,
<a href=#58>INVOKE</a>,
<a href=#77>POLYGON</a>
<p>
The COPY command is used to copy objects
within the same drawing. EAGLE will generate a new name for the
copy but will retain the old value. When copying signals (wires),
buses, and nets the names are retained, but in all other cases a new
name is assigned.
<h2>Copy Wires</h2>
If you copy wires or polygons, belonging to a signal, the
copy will belong to the same signal. Please note, for this reason,
if two wires overlap after the use of the COPY command, the DRC will
not register an error. If a net or bus wire is copied in a schematic,
it belongs to the same segment as the original wire, even if there is
no visible connection. This can lead to unexpected effects, for instance
when renaming them later. Therefore COPY should not be used with
net or bus wires, respectively.
<h2>Copy Parts</h2>
When copying a part in a schematic, there will always be a new instance
of the complete part added, even if only a single gate of a multi-gate
part is selected. In addition to the selected gate, any other gates of that
device which have Add-Level MUST or ALWAYS will automatically be invoked.
<p>
If you just want to use another gate of a multi-gate part, you should use
the <a href=#58>INVOKE</a> command instead.
<h2>Copy library objects</h2>
By writing <tt>COPY deviceset@library</tt> or <tt>COPY package@library</tt>
you can copy a device set or a package from a given library into the currently
loaded library. If an additional <tt>name</tt> is given, the copied object will
be given that name.
This can also be done through the library objects'
<a href=#13>context menu</a> or via <i>Drag&amp;Drop</i> from
the Control Panel's tree view.
<p>
<b>Note that any existing library objects (device sets, symbols or packages)
used by the copied library object will be automatically updated.</b>
<h2>Copy a group</h2>
Copying a group by selecting it with the right mouse button is actually
done by doing an implicit <a href=#42>CUT</a> operation, immediately
followed by a <a href=#74>PASTE</a>.


<a name=42>
<h1>CUT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Loads a group into the paste buffer.
<dt>
<b>Syntax</b>
<dd>
<tt>CUT &#149;</tt><br>
<tt>CUT;</tt>
</dl>
<b>See also</b> <a href=#74>PASTE</a>,
<a href=#54>GROUP</a>
<p>
Parts of a drawing (or even a whole board) can be copied onto other
drawings by means of the commands CUT and PASTE.
<p>
To do this you first define a group (GROUP command). Then use the
CUT command, followed by a reference point (mouse click or coordinates
(x y)) to put the selected objects into the buffer.
<tt>CUT;</tt> automatically puts the reference point at the center of
the selected objects (snapped to the grid).
Now you can change to another board or package library (EDIT) and
copy the contents of the buffer onto the new drawing by executing
the PASTE command.
<h2>Reference Point</h2>
If you click the mouse after selecting the CUT command, the position
of the mouse cursor defines a reference point for the group, i.e.
when using the PASTE command, the mouse cursor will be at the exact
position of the group.
<h2>Note</h2>
Unlike other (Windows-) programs EAGLE's CUT command does not physically
remove the marked group from the drawing; it only copies the group into
the paste buffer.


<a name=43>
<h1>DELETE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Deletes objects.
<dt>
<b>Syntax</b>
<dd>
<tt>DELETE &#149;..</tt><br>
<tt>DELETE name ..</tt><br>
<tt>DELETE SIGNALS</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Shift+Left</mb> deletes higher level object.<br>
<mb>Ctrl+Left</mb> deletes a wire joint.<br>
<mb>Ctrl+Right</mb> deletes the group.
</dl>
<b>See also</b> <a href=#87>RIPUP</a>,
<a href=#46>DRC</a>,
<a href=#54>GROUP</a>
<p>
The DELETE command is used to delete the selected object.
<p>
Parts, pads, smds, pins and gates can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area. Note that when selecting a multi-gate part in a schematic by name,
you will need to enter the full instance name, consisting of part
and gate name.
<p>
Attributes of parts can be selected by entering the concatenation of
part name and attribute name, as in <tt>R5&gt;VALUE</tt>.
<p>
Clicking the right mouse button deletes a previously defined
<a href=#54>GROUP</a>.
<p>
After deleting a group it is possible that airwires which have been newly
created due to the removal of a component may be "left over", because
they have not been part of the original group. In such a case you should
re-calculate the airwires with the <a href=#81>RATSNEST</a>
command.
<p>
With active <a href=#354>Forward&amp;Back Annotation</a>, no wires
or vias can be deleted from a signal that is connected to components in a board.
Also, no components can be deleted that have signals connected to them.
Modifications like these have to be done in the schematic.
<p>
Use the <a href=#87>RIPUP</a> command to convert an already
routed connection back into an airwire.
<p>
The DELETE command has no effect on layers that are not visible (refer
to DISPLAY).
<p>
The DRC might generate error polygons which can only be deleted
with DRC CLEAR.
<h2>Deleting Wire Joints</h2>
If the DELETE command, with the <tt>Ctrl</tt> key pressed, is applied to the joining
point of two wires, these wires are combined to form one straight wire.
For this to work the two wires must be in the same layer and have the same width
and line style, and must both have round endings (in case of arcs).
<h2>Deleting Polygon Corners</h2>
The DELETE command deletes one corner at a time from a polygon. The
whole polygon is deleted if there are only three corners left.
<h2>Deleting Components</h2>
Components can be deleted only if the tOrigins layer (or bOrigins with
mirrored components) is visible and if (with active
<a href=#354>Forward&amp;Back Annotation</a>) no signals are
connected to
the component (see also <a href=#86>REPLACE</a>).
Please note that an element may appear to be not connected (no airwires
or wires leading to any of it's pads), while in fact it <b>is</b>
connected to a supply voltage through an implicit power pin. In such a case
you can only delete the corresponding part in the schematic.
<h2>Deleting Junctions, Nets, and Buses</h2>
The following rules apply:
<ul>
<li>If a bus is split into two parts, both keep the initial name.
<li>If a net is split into two parts, the larger one keeps the initial
name while the smaller one gets a new (generated) name.
<li>After the DELETE command, labels belong to the segment next to them.
<li>If a junction point is deleted, the net is separated at this location.
Please check the names of the segments with the SHOW command.
</ul>
<h2>Deleting Supply Symbols</h2>
If the last supply symbol of a given type is deleted from a net segment
that has the same name as the deleted supply pin, that segment is given
a newly generated name (if there are no other supply symbols still
attached to that segment) or the name of one of the remaining supply symbols.
<h2>Deleting Signals</h2>
If you select wires (tracks) or vias belonging to a signal with the DELETE
command three cases have to be considered:
<ul>
<li>The signal is split into two parts. EAGLE will generate a new name
for the smaller part of the signal and keep the previous name for
the larger one.
<li>The signal is deleted from one end. The remaining part of the signal
will keep the previous name.
<li>The signal had only one airwire. It will be deleted completely
and its name won't exist any longer.
</ul>
After wires or vias have been deleted from a signal which contains
polygons, all polygons belong to the signal keeping the original name
(usually the bigger part).
<h2>Deleting all Signals</h2>
<p>
DELETE SIGNALS can be used to delete all signals on a board. This
is useful if you want to read in a new or changed netlist (see EXPORT).
Only those signals are deleted which are connected to pads.
<p>
If you want to delete a part that has the name SIGNALS, you need to
write the name in single quotes.
<h2>Deleting higher level objects</h2>
If the <tt>Shift</tt> key is pressed when clicking on an object, the object
that is hierarchically above the selected one will be deleted. This applies
to the following objects:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>Gate</tt>    </td><td width=20><td>Deletes the entire part containing this gate (even if the gates are spread over several sheets). If f/b annotation is active, the wires connected to the element in the board will not be ripped up (as opposed to deleting a single gate), except for those cases where a pin of the deleted part is only connected directly to one single other pin and no net wire</td></tr>
<tr><td><tt>Polygon&nbsp;Wire</tt> </td><td width=20><td>Deletes the entire polygon</td></tr>
<tr><td><tt>Net/Bus&nbsp;Wire</tt> </td><td width=20><td>Deletes the entire net or bus segment</td></tr>
</table>
<p>
Don't forget: Deleting can be reversed by the
<a href=#100>UNDO</a> command!


<a name=44>
<h1>DESCRIPTION</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines the description of a device, package or library.
<dt>
<b>Syntax</b>
<dd>
<tt>DESCRIPTION</tt><br>
<tt>DESCRIPTION description_string;</tt>
</dl>
<b>See also</b> <a href=#40>CONNECT</a>,
<a href=#72>PACKAGE</a>,
<a href=#103>VALUE</a>
<p>
This command is used in the library editor to define or edit the description
of a device, package or library.
<p>
The <tt>description_string</tt> may contain <a href=#352>HTML</a> tags.
<p>
The first non-blank line of <tt>description_string</tt> will be used as a short
descriptive text (<i>headline</i>) in the Control Panel.
<p>
The DESCRIPTION command without a parameter opens a dialog in which the text can
be edited. The upper pane of this dialog shows the formatted text, in case it
contains <a href=#352>HTML</a> tags, while the lower pane is used
to edit the raw text. At the very top of the dialog the <i>headline</i> is displayed
as it would result from the first non-blank line of the description. The headline
is stripped of any HTML tags.
<p>
The description of a library can be defined or modified via the command line only if the library is
newly opened, and no device, symbol or package has been edited yet. It can always be
defined via the pulldown menu "Library/Description...".<br>
The description of a device set or package can always be edited via the command line,
or via the pulldown menu "Edit/Description...".
<h2>Example</h2>
<pre>
DESCRIPTION '&lt;b&gt;Quad NAND&lt;/b&gt;&lt;p&gt;\nFour NAND gates with 2 inputs each.';
</pre>
This would result in
<p>
<b>Quad NAND</b><p>
Four NAND gates with 2 inputs each.


<a name=45>
<h1>DISPLAY</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Selects the visible layers.
<dt>
<b>Syntax</b>
<dd>
<tt>DISPLAY</tt><br>
<tt>DISPLAY [option] layer_number..</tt><br>
<tt>DISPLAY [option] layer_name..</tt>
</dl>
<b>See also</b> <a href=#61>LAYER</a>,
<a href=#79>PRINT</a>
<p>
Valid options are: ALL, NONE, LAST, ? and ??
<p>
The DISPLAY command is used to choose the visible layers. As parameters,
the layer number and the layer name are allowed (even mixed). If the
parameter ALL is chosen, all layers become visible. If the parameter
NONE is used, all layers are switched off. For example:
<pre>
DISPLAY NONE BOTTOM;
</pre>
Following this command only the Bottom layer is displayed.
<p>
If the parameter LAST is given, the previously visible layers will be displayed.
<p>
Please note that only those signal layers (1 through 16) are available
that have been entered into the layer setup in the <a href=#133>Design Rules</a>.
<p>
If the layer name or the layer number includes a negative sign, it
will be filtered out. For example:
<pre>
DISPLAY TOP -BOTTOM -3;
</pre>
In this case the Top layer is displayed while the Bottom layer and
the layer with the number 3 are not shown on the screen.
<p>
Avoid layer names ALL and NONE as well as names starting with a "-".
<p>
Some commands (PAD, SMD, SIGNAL, ROUTE) automatically activate certain
layers.
<p>
If the DISPLAY command is invoked without parameters, a dialog is
presented which allows you to adjust all layer settings.
<h2>Undefined Layers</h2>
The options '?' and '??' can be used to control what happens if an undefined
layer is given in a DISPLAY command. Any undefined layers following a '?' will
cause a warning and the user can either accept it or cancel the entire DISPLAY
command. Undefined layers following a '??' will be silently ignored.
This is most useful for writing script files that shall be able to handle any drawing,
even if a particular drawing doesn't contain some of the listed layers.
<pre>
DISPLAY TOP BOTTOM ? MYLAYER1 MYLAYER2 ?? OTHER WHATEVER
</pre>
In the above example the two layers TOP and BOTTOM are required and will cause
an error if either of them is missing. MYLAYER1 and MYLAYER2 will just be reported
if missing, allowing the user to cancel the operation, and OTHER and WHATEVER will
be displayed if they are there, otherwise they will be ignored.
<p>
The '?' and '??' options may appear any number of times and in any sequence.
<h2>Pads and Vias</h2>
If pads or vias have different shapes on different layers, the shapes of the currently
visible (activated with DISPLAY) signal layers are displayed on top of each other.
<p>
If the color selected for layer 17 (Pads) or 18 (Vias) is 0 (which represents
the current background color), the pads and vias are displayed
in the color and fill style of the respective signal layers. If no signal layer is
visible, pads and vias are not displayed.
<p>
If the color selected for layer 17 (Pads) or 18 (Vias) is not the background
color and no signal layers are visible, pads and vias are displayed in the
shape of the uppermost and undermost layer.
<p>
This also applies to printouts made with <a href=#79>PRINT</a>.
<h2>Selecting Objects</h2>
If you want to select certain objects or elements (e.g.
with MOVE or DELETE) the corresponding layer must be visible. Elements
can only be selected if the tOrigins (or bOrigins with mirrored elements)
layer is visible!
<h2>Parameter Aliases</h2>
Parameter aliases can be used to define certain parameter settings to the
DISPLAY command, which can later be referenced by a given name.
The aliases can also be accessed by clicking on the DISPLAY button
and holding the mouse button pressed until the list pops up.
A right click on the button also pops up the list.
<p>
The syntax to handle these aliases is:
<dl>
<dt>
<tt>DISPLAY = <i>name</i> <i>parameters</i></tt>
<dd>
Defines the alias with the given <i>name</i> to expand to the given
<i>parameters</i>. The <i>name</i> may consist of any number of letters,
digits and underlines, and is treated case insensitive. It must begin
with a letter or underline and may not be one of the option keywords.
<dt>
<tt>DISPLAY = <i>name</i> @</tt>
<dd>
Defines the alias with the given <i>name</i> to expand to the current
parameter settings of the command.
<dt>
<tt>DISPLAY = ?</tt>
<dd>
Asks the user to enter a name for defining an alias for the current
parameter settings of the command.
<dt>
<tt>DISPLAY = <i>name</i></tt>
<dd>
Opens the DISPLAY dialog and allows the user to select a set
of layers that will be defined as an alias under the given <i>name</i>.
<dt>
<tt>DISPLAY = <i>name</i>;</tt>
<dd>
Deletes the alias with the given <i>name</i>.
<dt>
<tt>DISPLAY <i>name</i></tt>
<dd>
Expands the alias with the given <i>name</i> and executes the DISPLAY command with
the resulting set of parameters. The <i>name</i> may be abbreviated and
there may be other parameters before and after the alias (even other
aliases). Note that in case <i>name</i> is an abbreviation, aliases have precedence
over other parameter names of the command.
</dl>
Example:
<p>
<tt>DISPLAY = MyLayers None Top Bottom Pads Vias Unrouted</tt>
<p>
Defines the alias "MyLayers" which, when used as in
<p>
<tt>DISPLAY myl</tt>
<p>
will display just the layers Top, Bottom, Pads, Vias and Unrouted
(without the "None" parameter the given layers would be displayed in
addition to the currently visible layers).
Note the abbreviated use of the alias and the case insensitivity.


<a name=46>
<h1>DRC</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Checks design rules.
<dt>
<b>Syntax</b>
<dd>
<tt>DRC</tt><br>
<tt>DRC &#149; &#149; ;</tt><br>
<tt>DRC LOAD|SAVE filename;</tt>
</dl>
<b>See also</b> <a href=#133>Design Rules</a>,
<a href=#38>CLASS</a>,
<a href=#92>SET</a>,
<a href=#48>ERC</a>,
<a href=#49>ERRORS</a>
<p>
The command DRC checks a board against the current set of <a href=#133>Design Rules</a>.
<p>
Please note that electrically irrelevant objects (wires in packages, rectangles, circles
and texts) are not checked against each other for clearance errors.
<p>
The errors found are displayed as error polygons in the respective layers,
and can be browsed through with the <a href=#49>ERRORS</a> command.
<p>
Without parameters the DRC command opens a Design Rules dialog in which the board's
Design Rules can be defined, and from which the actual check can be started.
<p>
If two coordinates are given in the DRC command (or if the Select button is
clicked in the Design Rules dialog) all checks will be performed solely in the
defined rectangle. Only errors that occur (at least partly) in this area will be reported.
<p>
If you get DRC errors that don't go away, even if you modify the
<a href=#133>Design Rules</a>, make sure you check the
<a href=#38>Net class</a> of the reported object to see whether
the error is caused by a specific parameter of that class.
<p>
To delete all error polygons use the command
<pre>
ERRORS CLEAR
</pre>
<p>
The <tt>LOAD</tt> and <tt>SAVE</tt> options can be used to load the Design Rules
from or save them to the given file. If <i>filename</i> doesn't have the extension
<tt>".dru"</tt> it will be appended automatically.
<h2>Related SET commands</h2>
The SET command can be used to change the behavior of the DRC command:
<pre>
SET DRC_FILL  fill_name;
</pre>
Defines the fill style used for the DRC error polygons.
Default is LtSlash.


<a name=47>
<h1>EDIT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Loads an existing drawing to be edited or creates a new drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>EDIT name</tt><br>
<tt>EDIT name.ext</tt><br>
<tt>EDIT .ext</tt><br>
<tt>EDIT .sX [ .sY ]</tt>
</dl>
<b>See also</b> <a href=#70>OPEN</a>,
<a href=#39>CLOSE</a>,
<a href=#34>BOARD</a>
<p>
The EDIT command is used to load a drawing or if a library has been
opened with the OPEN command, to load a package, symbol, or device for
editing.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>EDIT name.brd</tt>  </td><td width=20><td>loads a board</td></tr>
<tr><td><tt>EDIT name.sch</tt>  </td><td width=20><td>loads a schematic</td></tr>
<tr><td><tt>EDIT name.pac</tt>  </td><td width=20><td>loads a package</td></tr>
<tr><td><tt>EDIT name.sym</tt>  </td><td width=20><td>loads a symbol</td></tr>
<tr><td><tt>EDIT name.dev</tt>  </td><td width=20><td>loads a device</td></tr>
<tr><td><tt>EDIT .s3</tt>       </td><td width=20><td>loads sheet 3 of a schematic</td></tr>
<tr><td><tt>EDIT .s5 .s2 </tt>  </td><td width=20><td>moves sheet 5 before sheet 2 and loads it (if sheet 5 doesn't exist, a new sheet is inserted before sheet 2)</td></tr>
<tr><td><tt>EDIT .s2 .s5 </tt>  </td><td width=20><td>moves sheet 2 before sheet 5 and loads it (if sheet 5 doesn't exist, sheet 2 becomes the last sheet)</td></tr>
</table>
<p>
Wildcards in the name are allowed (e.g. *.brd).
<p>
The EDIT command without parameters will cause a
file dialog (in board or schematic mode) or a
<a href=#23>popup menu</a> (in library mode) to appear
from which you can select the file or object.
<p>
To change from schematic to a board with the same name the command
<pre>
EDIT .brd
</pre>
can be used. In the same way to change from board to schematic use
the command
<pre>
EDIT .sch
</pre>
To edit another sheet of a schematic the command
<pre>
EDIT .sX
</pre>
(X is the sheet number) or the combo box in the action toolbar of the
editor window can be used. If the given sheet number doesn't exist,
a new sheet is created.
<p>
You can also switch between sheets by clicking on an icon of the sheet
thumbnail preview. Drag&amp;drop in the thumbnail preview allows you to
reorder sheets. Note that adding, removing or reordering sheets clears
the undo buffer, while simply switching between existing sheets doesn't.
<p>
Symbols, devices or packages may only be edited if a library is first
opened with the OPEN command.
<h2>Which Directory?</h2>
EDIT loads files from the
<a href=#14>project directory</a>.


<a name=48>
<h1>ERC</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Electrical Rule Check.
<dt>
<b>Syntax</b>
<dd>
<tt>ERC</tt>
</dl>
<b>See also</b> <a href=#46>DRC</a>,
<a href=#49>ERRORS</a>,
<a href=#355>Consistency Check</a>
<p>
This command is used to test schematics for electrical errors. The
result of the check is presented in the <a href=#49>ERRORS</a>
dialog.
<h2>Consistency Check</h2>
The ERC command also performs a
<a href=#355>Consistency Check</a>
between a schematic and its corresponding board, provided the board file
has been loaded before starting the ERC.
As a result of this check the automatic
<a href=#354>Forward&amp;Back Annotation</a>
will be turned on or off, depending on whether the files have been found
to be consistent or not.
<p>
Please note that the ERC detects inconsistencies between the implicit power
and supply pins in the schematic and the actual signal connections in the board.
Such inconsistencies can occur if the supply pin configuration is modified
after the board has been created with the BOARD command. Since the power
pins are only connected "implicitly", these changes can't always be forward
annotated.<br>
If such errors are detected, <a href=#354>Forward&amp;Back Annotation</a>
will still be performed, but the supply pin configuration should be checked!


<a name=49>
<h1>ERRORS</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Shows the errors found by the ERC or DRC command.
<dt>
<b>Syntax</b>
<dd>
<tt>ERRORS</tt><br>
<tt>ERRORS CLEAR</tt>
</dl>
<b>See also</b> <a href=#48>ERC</a>,
<a href=#46>DRC</a>
<p>
The command ERRORS is used to show the errors found by the Electrical Rule Check (ERC)
or the Design Rule Check (DRC). If selected, a window is opened in which
all errors are listed. If no ERC or DRC has been run for the loaded drawing, yet,
the respective check will be started first.
<p>
The list view in the ERRORS dialog has up to four sections that contain
<i>Consistency errors</i>, <i>Errors</i>, <i>Warnings</i> and <i>Approved</i>
messages, respectively.
<p>
Selecting an entry with the mouse causes the error to be marked in the editor
window with a rectangle and a line from the upper left corner of the screen.
<p>
Double clicking an entry centers the drawing to the area where the error is located.
Checking the "Centered" checkbox causes this to happen automatically.
<h2>Marking a message as processed</h2>
The <i>Processed</i> button marks a message as processed. It is still contained
in the list, but there is no error indicator in the editor window any more (except
if the list entry is selected). This can be used to mark messages as "done" after
fixing the related problem, without having to run the check again. After the next
ERC/DRC the message will be either gone, or marked as unprocessed again if the
problem still persists.
<h2>Approving a message</h2>
If an error or warning can't be fixed, but apparently doesn't matter (which the
user has to decide), it can be moved to the <i>Approved</i> section by pressing
the <i>Approve</i> button. Messages in that section will not draw error indicators
in the editor window (except if the list entry is selected) and are implicitly
marked as "processed". If any of these messages no longer apply after the
next ERC/DRC, they will be deleted. All approved messages are stored in the drawing
file, so that it is documented which ones have been explicitly approved by the
user. Note that consistency errors can not be approved - they always have to
be fixed in order to activate <a href=#354>Forward&amp;Back Annotation</a>.
<h2>Clearing the list</h2>
The <i>Clear all</i> button deletes all entries form the list, except for the
approved messages. This can be used to get rid of the error indicators in
the editor window. The next ERC/DRC will regenerate the messages again, if
they still apply.
<p>
The list can also be cleared by entering the command
<pre>
ERRORS CLEAR
</pre>



<a name=50>
<h1>EXPORT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Generation of data files.
<dt>
<b>Syntax</b>
<dd>
<tt>EXPORT SCRIPT    filename;</tt><br>
<tt>EXPORT NETLIST   filename;</tt><br>
<tt>EXPORT NETSCRIPT filename;</tt><br>
<tt>EXPORT PARTLIST  filename;</tt><br>
<tt>EXPORT PINLIST   filename;</tt><br>
<tt>EXPORT DIRECTORY filename;</tt><br>
<tt>EXPORT IMAGE     filename|CLIPBOARD [MONOCHROME|WINDOW] resolution;</tt>
</dl>
<b>See also</b> <a href=#91>SCRIPT</a>,
<a href=#90>RUN</a>
<p>
The EXPORT command is used to provide you with ASCII text files which
can be used e.g. to transfer data from EAGLE to other programs, or to
generate an image file from the current drawing.
<p>
By default the output file is written into the <b>Project</b> directory.
<p>
The command generates the following output files:
<h2>SCRIPT</h2>
A library previously opened with the OPEN command will be output as
a script file. When a library has been exported and is to be imported
again with the SCRIPT command, a new library should be opened in order
to avoid duplication - e.g. the same symbol is defined more than
once. Reading script files can be accelerated if the command
<pre>
Set Undo_Log Off;
</pre>
is given before.
<h2>NETLIST</h2>
Generates a netlist for the loaded schematic or board. Only nets which
are connected to elements are listed.
<h2>NETSCRIPT</h2>
Generates a netlist for the loaded schematic in the form of a script
file. This file can be used to read a new or changed netlist into
a board where elements have already been placed or previously routed
tracks have been deleted with <tt>DELETE SIGNALS</tt>.
Note that while reading such a script into a board no schematic that
is consistent with this board may be loaded.
<h2>PARTLIST</h2>
Generates a component list for schematics or boards. Only elements
with pins/pads are included.
<h2>PINLIST</h2>
Generates a list with pads and pins, containing the pin directions and
the names of the nets connected to the pins.
<h2>DIRECTORY</h2>
Lists the directory of the currently opened library.
<h2>IMAGE</h2>
Exporting an <i>IMAGE</i> generates an image file with a format corresponding
to the given filename extension. The following image formats are available:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>.bmp</tt></td>   <td width=20><td>Windows Bitmap Files</td></tr>
<tr><td><tt>.png</tt></td>   <td width=20><td>Portable Network Graphics Files</td></tr>
<tr><td><tt>.pbm</tt></td>   <td width=20><td>Portable Bitmap Files</td></tr>
<tr><td><tt>.pgm</tt></td>   <td width=20><td>Portable Grayscale Bitmap Files</td></tr>
<tr><td><tt>.ppm</tt></td>   <td width=20><td>Portable Pixelmap Files</td></tr>
<tr><td><tt>.tif</tt></td>   <td width=20><td>TIFF Files</td></tr>
<tr><td><tt>.xbm</tt></td>   <td width=20><td>X Bitmap Files</td></tr>
<tr><td><tt>.xpm</tt></td>   <td width=20><td>X Pixmap Files</td></tr>
</table>
<p>
The <i>resolution</i> parameter defines the image resolution (in 'dpi').
<p>
If <i>filename</i> is the special name CLIPBOARD (upper or lowercase doesn't matter)
the image will be copied into the system's clipboard.
<p>
The optional keyword <i>MONOCHROME</i> creates a black&amp;white image.
<p>
The optional keyword <i>WINDOW</i> creates an image of the currently visible
area in the editor window. Without this keyword, the image will contain the
entire drawing.


<a name=51>
<h1>FRAME</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds a frame to a drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>FRAME [ columns [ rows ] ] [ borders ] &#149; &#149;</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.
</dl>
<b>See also</b> <a href=#60>LABEL</a>
<p>
The FRAME command draws a frame with numbered columns and rows.
The two points define two opposite corners of the frame. Pressing the center
mouse button changes the layer to which the frame is to be added.
<p>
The <tt>columns</tt> parameter defines the number of columns in the frame.
There can be up to 127 columns. By default the columns are numbered from
left to right. If the <tt>columns</tt> value is negative, they are numbered
from right to left.
<p>
The <tt>rows</tt> parameter defines the number of rows in the frame.
There can be up to 26 rows. Rows are marked from top to bottom with letters,
beginning with 'A'. If the <tt>rows</tt> value is negative, they are marked
from bottom to top. If <tt>rows</tt> is given, it must be preceeded by
<tt>columns</tt>.
<p>
The <tt>borders</tt> parameter, if given, defines which sides of the frame
will have a border with numbers or letters displayed. Valid options for this
parameter are <tt>Left</tt>, <tt>Top</tt>, <tt>Right</tt> and <tt>Bottom</tt>.
By default all four sides of the frame will have a border. If any of these
options is given, only the requested sides will have a border. The special
options <tt>None</tt> and <tt>All</tt> can be used to have no borders at all,
or all sides marked.
<p>
Even though you can draw several frames in the same drawing, only the first
one will be used for calculating the positions of parts and nets. These positions
can be used, for instance, in a <a href=#138>User Language</a> Program
to generate a list of parts with their locations in their respective frame.
They are also used internally to automatically generate cross references
for <a href=#60>labels</a>.
<p>
Due to the special nature of the frame object, it doesn't have a rotation of
its own, and it doesn't get rotated with the <a href=#88>ROTATE</a>
command.
<p>
A frame can be drawn directly into a board or schematic, but more typically you
will want to create a special symbol or package drawing that perhaps also
contains a title block, which you can then use in all your drawings.
The "frames" library that comes with EAGLE contains several drawing frames.
<h2>Example</h2>
<pre>
FRAME 10 5 TOP LEFT &#149; &#149;
</pre>
draws a frame with 10 columns (numbered from left to right) and 5 rows (marked
'A' to 'E' from top to bottom) that has the column and row indicators drawn only
at the top and left border.


<a name=52>
<h1>GATESWAP</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Swaps equivalent gates on a schematic.
<dt>
<b>Syntax</b>
<dd>
<tt>GATESWAP &#149; &#149;..;</tt><br>
<tt>GATESWAP gate_name gate_name..;</tt>
</dl>
<b>See also</b> <a href=#29>ADD</a>
<p>
Using this command two gates may be swapped within a schematic. Both
gates must be identical with the same number of pins and must be allocated
the same Swaplevel in the device definition. They do not, however,
need to be in the same device.
<p>
The name used in the GATESWAP command is the displayed name on the
schematic (e.g. U1A for gate A in device U1).
<p>
If a device is not used anymore after the GATESWAP command, it is
deleted automatically from the drawing.


<a name=53>
<h1>GRID</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines grid.
<dt>
<b>Syntax</b>
<dd>
<tt>GRID option..;</tt><br>
<tt>GRID;</tt>
<dt>
<b>Keyboard</b>
<dd>
<tt>F6: GRID;</tt>   turns the grid on or off.
</dl>
<b>See also</b> <a href=#91>SCRIPT</a>
<p>
The GRID command is used to specify the grid and the current unit.
Given without an option, this command switches between  GRID ON
and GRID OFF.
<p>
The following options exist:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>GRID ON;</tt>        </td><td width=20><td>Displays the grid on the screen</td></tr>
<tr><td><tt>GRID OFF;</tt>       </td><td width=20><td>Turns off displayed grid</td></tr>
<tr><td><tt>GRID DOTS;</tt>      </td><td width=20><td>Displays the grid as dots</td></tr>
<tr><td><tt>GRID LINES;</tt>     </td><td width=20><td>Displays the grid as solid lines</td></tr>
<tr><td><tt>GRID MIC;</tt>       </td><td width=20><td>Sets the grid units to micron</td></tr>
<tr><td><tt>GRID MM;</tt>        </td><td width=20><td>Sets the grid units to mm</td></tr>
<tr><td><tt>GRID MIL;</tt>       </td><td width=20><td>Sets the grid units to mil</td></tr>
<tr><td><tt>GRID INCH;</tt>      </td><td width=20><td>Sets the grid units to inch</td></tr>
<tr><td><tt>GRID FINEST;</tt>    </td><td width=20><td>Sets the grid to 0.1 micron</td></tr>
<tr><td><tt>GRID grid_size;</tt> </td><td width=20><td>Defines the distance between</td></tr>
<tr><td>                     </td><td width=20><td>the grid points in the actual unit</td></tr>
<tr><td><tt>GRID LAST;</tt>      </td><td width=20><td>Sets grid to the most recently</td></tr>
<tr><td>                     </td><td width=20><td>used values</td></tr>
<tr><td><tt>GRID DEFAULT;</tt>   </td><td width=20><td>Sets grid to the standard values</td></tr>
<tr><td><tt>GRID grid_size grid_multiple;</tt> </td><td width=20><td></td></tr>
<tr><td>                     </td><td width=20><td>grid_size = grid distance</td></tr>
<tr><td>                     </td><td width=20><td>grid_multiple = grid factor</td></tr>
<tr><td><tt>GRID ALT ...;</tt>   </td><td width=20><td>Defines the alternate grid</td></tr>
</table>
<h2>Examples</h2>
<pre>
Grid mm;
Set Diameter_Menu 1.0 1.27 2.54 5.08;
Grid Last;
</pre>
In this case you can change back to the last grid definition
although you don't know what the definition looked like.
<pre>
GRID mm 1 10;
</pre>
for instance specifies that the distance between the grid points is
1 mm and that every 10th grid line will be displayed.
<p>
Note: The first number in the GRID command always represents the grid
distance, the second - if existing - represents the grid multiple.
<p>
The GRID command may contain multiple parameters:
<pre>
GRID inch 0.05 mm;
</pre>
In this case the grid distance is first defined as 0.05 inch. Then
the coordinates of the cursor are chosen to be displayed in mm.
<pre>
GRID DEFAULT;
</pre>
Sets grid to the standard value for the current drawing type.
<pre>
GRID mil 50 2 lines on alt mm 1 mil;
</pre>
Defines a 50 mil grid displayed as lines (with only every other line visible), and sets the alternate grid size to 1 mm,
but displays it in mil.
<p>
Pressing the <tt>Alt</tt> key switches to the alternate Grid.
This can typically be a finer grid than the normal one, which allows you to quickly
do some fine positioning in a dense area, for instance, where the normal grid might
be too coarse.
The alternate grid remains active as long as the <tt>Alt</tt> key is held pressed down.
<h2>Parameter Aliases</h2>
Parameter aliases can be used to define certain parameter settings to the
GRID command, which can later be referenced by a given name.
The aliases can also be accessed by clicking on the GRID button
and holding the mouse button pressed until the list pops up.
A right click on the button also pops up the list.
<p>
The syntax to handle these aliases is:
<dl>
<dt>
<tt>GRID = <i>name</i> <i>parameters</i></tt>
<dd>
Defines the alias with the given <i>name</i> to expand to the given
<i>parameters</i>. The <i>name</i> may consist of any number of letters,
digits and underlines, and is treated case insensitive. It must begin
with a letter or underline and may not be one of the option keywords.
<dt>
<tt>GRID = <i>name</i> @</tt>
<dd>
Defines the alias with the given <i>name</i> to expand to the current
parameter settings of the command.
<dt>
<tt>GRID = ?</tt>
<dd>
Asks the user to enter a name for defining an alias for the current
parameter settings of the command.
<dt>
<tt>GRID = <i>name</i></tt>
<dd>
Opens the GRID dialog and allows the user to adjust the grid
parameters and define an alias for them under the given <i>name</i>.
<dt>
<tt>GRID = <i>name</i>;</tt>
<dd>
Deletes the alias with the given <i>name</i>.
<dt>
<tt>GRID <i>name</i></tt>
<dd>
Expands the alias with the given <i>name</i> and executes the GRID command with
the resulting set of parameters. The <i>name</i> may be abbreviated and
there may be other parameters before and after the alias (even other
aliases). Note that in case <i>name</i> is an abbreviation, aliases have precedence
over other parameter names of the command.
</dl>
Example:
<p>
<tt>GRID = MyGrid inch 0.1 lines on</tt>
<p>
Defines the alias "MyGrid" which, when used as in
<p>
<tt>GRID myg</tt>
<p>
will change the current grid to the given settings.
Note the abbreviated use of the alias and the case insensitivity.


<a name=54>
<h1>GROUP</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a group.
<dt>
<b>Syntax</b>
<dd>
<tt>GROUP &#149;..</tt><br>
<tt>GROUP ALL</tt><br>
<tt>GROUP;</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Left&amp;Drag</mb> defines a rectangular group.<br>
<mb>Shift+Left</mb> adds the new group to an existing one.<br>
<mb>Ctrl+Left</mb> toggles the group membership of the selected object.<br>
<mb>Ctrl+Shift+Left</mb> toggles the group membership of the higher level object.<br>
<mb>Right</mb> closes the group polygon.
</dl>
<b>See also</b> <a href=#36>CHANGE</a>,
<a href=#42>CUT</a>,
<a href=#74>PASTE</a>,
<a href=#65>MIRROR</a>,
<a href=#43>DELETE</a>
<p>
The GROUP command is used to define a group of objects
for a successive command. Also a whole drawing or an element can be
defined as a group. Objects are selected - after activating the
GROUP command - by click&amp;dragging a rectangle or by drawing a polygon with the mouse. The easiest
way to close the polygon is to use the right mouse button. Only objects
from displayed layers can become part of the group.
<p>
The keyword <tt>ALL</tt> can be used to define a group that includes
the entire drawing area.
<p>
The group includes:
<ul>
<li>all objects whose origin is inside the polygon
<li>all wires with at least one end point inside the polygon
<li>all circles whose center is inside the polygon
<li>all rectangles with any corner inside the polygon
</ul>
<h2>Move Group</h2>
In order to move a group it is necessary to select the MOVE command
with the right mouse button. When moving wires (tracks) with
the GROUP command that have only one end point in the polygon, this
point is moved while the other one remains at its previous position.
<p>
For instance: In order to change several pad shapes, select
CHANGE and SHAPE with the left mouse button and select the group with
the right mouse button.
<p>
The group definition remains until a new drawing is loaded
or the command
<pre>
GROUP;
</pre>
is executed.
<h2>Extending the group</h2>
If you press the <tt>Shift</tt> key together with any mouse click when
defining the group, the newly defined group will be added to the existing group (if
any).
<h2>Individual objects</h2>
You can toggle the group membership of an individual object by clicking on it
with the <tt>Ctrl</tt> key pressed. If you also press the <tt>Shift</tt> key
when doing so, the group membership of the next higher level object is toggled.
For instance, when clicking on a net wire in a schematic with the GROUP command
and <tt>Ctrl+Shift</tt> pressed, the group membership of the entire segment will
be toggled.


<a name=55>
<h1>HELP</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Help for the current command.
<dt>
<b>Syntax</b>
<dd>
<tt>HELP</tt><br>
<tt>HELP command</tt>
<dt>
<b>Keyboard</b>
<dd>
<tt>F1: HELP</tt>   activates the context sensitive help.
</dl>
This command opens a context sensitive help window.
<p>
A <tt>command</tt> name within the HELP command shows the help page of that
command.
<h2>Example</h2>
<pre>
HELP GRID;
</pre>
displays the help page for the GRID command.


<a name=56>
<h1>HOLE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Add drill hole to a board or package.
<dt>
<b>Syntax</b>
<dd>
<tt>HOLE drill &#149;..</tt>
</dl>
<b>See also</b> <a href=#104>VIA</a>,
<a href=#73>PAD</a>,
<a href=#36>CHANGE</a>
<p>
This command is used to define e.g. mounting holes (has no electrical
connection between the different layers) in a board or in a package.
The parameter drill defines the diameter of the hole in the
actual unit. It may be up to 0.51602 inch (13.1 mm).
<h2>Example</h2>
<pre>
HOLE 0.20 &#149;
</pre>
If the actual unit is "inch", the hole will have a diameter
of 0.20 inch.
<p>
The entered value for the diameter (also used for via-holes and pads)
remains as a presetting for successive operations. It may be changed
with the command:
<pre>
CHANGE DRILL value &#149;
</pre>
A hole can only be selected if the Holes layer is displayed.
<p>
A hole generates a symbol in the Holes layer as well as a circle with
the diameter of the hole in the Dimension layer. The relation between
certain diameters and symbols is defined in the "Options/Set/Drill" dialog.
The circle in the Dimension layer is used by the Autorouter. As
it will keep a (user-defined) minimum distance between via-holes/wires
and dimension lines, it will automatically keep this distance to the
hole.
<p>
Holes generate Annulus symbols in supply layers.
<p>
In the layers tStop and bStop, holes generate the solder
stop mask, whose diameter is determined by the <a href=#133>Design Rules</a>.


<a name=57>
<h1>INFO</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Display and modify object properties.
<dt>
<b>Syntax</b>
<dd>
<tt>INFO &#149;..</tt><br>
<tt>INFO name ..</tt>
</dl>
<b>See also</b> <a href=#36>CHANGE</a>,
<a href=#93>SHOW</a>
<p>
The INFO command displays further details about an object's properties
on screen, e.g. wire width, layer number, text size etc.
It is also possible to modify properties in this dialog.
<p>
Parts, pads, smds, pins and gates can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area. Note that when selecting a multi-gate part in a schematic by name,
you will need to enter the full instance name, consisting of part
and gate name.
<p>
Attributes of parts can be selected by entering the concatenation of
part name and attribute name, as in <tt>R5&gt;VALUE</tt>.


<a name=58>
<h1>INVOKE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Call a specific symbol from a device.
<dt>
<b>Syntax</b>
<dd>
<tt>INVOKE &#149; orientation &#149;</tt><br>
<tt>INVOKE part_name gate_name orientation &#149;</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> mirrors the gate.<br>
<mb>Right</mb> rotates the gate.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#41>COPY</a>,
<a href=#29>ADD</a>
<p>
See the ADD command for an explanation of Addlevel und Orientation.
<p>
The INVOKE command is used to select a particular gate from a device
which is already in use and place it in the schematic (e.g. a power
symbol with Addlevel = Request).
<p>
Gates are activated in the following way:
<ul>
<li>Enter the part name (e.g. IC5) and select the gate from the popup dialog that appears.
<li>Define device and gate name from the keyboard (e.g. INVOKE IC5 POWER).
<li>Select an existing gate from the device with the mouse and then select the desired gate from the popup menu which appears.
</ul>
The final mouse click positions the new gate.
<p>
If an already invoked gate is selected in the dialog, the default button changes
to "Show", and a click on it zooms the editor window in on the selected gate,
switching to a different sheet if necessary.
<h2>Gates on Different Sheets</h2>
If a gate from a device on a different sheet is to be added
to the current sheet, the name of the part has to be specified in
the INVOKE command. In this case the right column of the popup menu
shows the sheet numbers where the already used gates are placed.


<a name=59>
<h1>JUNCTION</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Places a dot at intersecting nets.
<dt>
<b>Syntax</b>
<dd>
<tt>JUNCTION &#149;..</tt>
</dl>
<b>See also</b> <a href=#69>NET</a>
<p>
This command is used to draw a connection dot at the intersection
of nets which are to be connected to each other. Junction points may
be placed only on a net. If placed on the intersection of different
nets, the user is given the option to connect the nets.
<p>
If a net wire is placed at a point where there are at least two other
net wires and/or pins, a junction will automatically be placed.
This function can be disabled with "<tt>SET AUTO_JUNCTION OFF;</tt>",
or by unchecking "Options/Set/Misc/Auto set junction".
<p>
On the screen junction points are displayed at least with a diameter
of five pixels.


<a name=60>
<h1>LABEL</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Attaches text labels to buses and nets.
<dt>
<b>Syntax</b>
<dd>
<tt>LABEL [XREF] [orientation] &#149; &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.<br>
<mb>Right</mb> rotates the label.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#68>NAME</a>,
<a href=#35>BUS</a>,
<a href=#51>FRAME</a>
<p>
Bus or net names may be placed on a schematic in any location by using
the label command. When the bus or net is clicked on with the mouse,
the relevant label attaches to the mouse cursor and may be rotated,
changed to another layer, or moved to a different location. The second
mouse click defines the location of the label.
<p>
The orientation of the label may be defined textually
using the usual definitions as listed in the <a href=#29>ADD</a> command (R0, R90
etc.).
<p>
Buses and nets may have any number of labels.
<p>
Labels cannot be changed with "CHANGE TEXT".
<p>
Labels are handled by the program as text, but their value corresponds
to the name of the appropriate bus or net. If a bus or net is renamed
with the NAME command, all associated labels are renamed automatically.
<p>
If a bus, net, or label is selected with the SHOW command, all connected
buses, nets and labels are highlighted.
<h2>Cross-reference labels</h2>
If the optional keyword <tt>XREF</tt> is given, the label will be a
"cross-reference" label. Cross-reference labels can be used in multi-sheet
schematics to indicate the next sheet a particular net appears on (note that
this only works for nets, not for busses!).
The <tt>XREF</tt> keyword is mainly for use in scripts. Normally the setting
is taken from what has previously been set with <a href=#36>CHANGE XREF</a>,
or by clicking on the Xref button in the parameter toolbar.
<p>
The format in which a cross-reference label is displayed can be controlled
through the "Xref label format" string, which is defined in the "Options/Set/Misc"
dialog, or with the <a href=#92>SET</a> command.
The following placeholders are defined, and can be used in any order:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>%F</tt></td>  <td width=20><td>enables drawing a flag border around the label</td></tr>
<tr><td><tt>%N</tt></td>  <td width=20><td>the name of the net</td></tr>
<tr><td><tt>%S</tt></td>  <td width=20><td>the next sheet number</td></tr>
<tr><td><tt>%C</tt></td>  <td width=20><td>the column on the next sheet</td></tr>
<tr><td><tt>%R</tt></td>  <td width=20><td>the row on the next sheet</td></tr>
</table>
<p>
The default format string is <tt>"%F%N/%S.%C%R"</tt>. Apart from the defined
placeholders you can also use any other ASCII characters.
<p>
The column and row values only work if there is a <a href=#51>frame</a>
on the next sheet on which the net appears. If <tt>%C</tt> or <tt>%R</tt> is
used and there is no frame on that sheet, they will display a question mark (<tt>'?'</tt>).
<p>
When determining the column and row of a net on a sheet, first the column and then
the row within that column is taken into account. Here XREF labels take precedence
over normal labels, which again take precedence over net wires.
For a higher sheet number, the frame coordinates of the left- and topmost field
are taken, while for a lower sheet number those of the right- and bottommost field
are used.
<p>
The orientation of a cross-reference label defines whether it will point to
a "higher" or a "lower" sheet number. Labels with an orientation of R0 or R270 point
to the right or bottom border of the drawing, and will therefore refer to
a higher sheet number. Accordingly, labels with an orientation of R90 or R180 will
refer to a lower sheet number. If a label has an orientation of R0 or R270, but the
net it is attached to is not present on any higher sheet, a reference to the next
lower sheet is displayed instead (the same applies accordingly to R90 and R180).
If the net appears only on the current sheet, no cross-reference is shown at all,
and only the net name is displayed (surrounded by the flag border, if the format
string contains the <tt>%F</tt> placeholder).
<p>
A cross-reference label that is placed on the end of a net wire will connect to
the wire so that the wire is moved with the label, and vice versa.
<p>
The cross-reference label format string is stored within the schematic drawing file.
<p>
A cross-reference label can be changed to a normal label either through the
<a href=#36>CHANGE</a> command or the label's <i>Properties</i> dialog.
<h2>Selecting the layer</h2>
Unlike other commands (like WIRE, for instance), the LABEL command keeps track
of its last used layer by itself. This has the advantage of making sure that
labels are always drawn into the right layer, no matter what layers other
commands draw into. The downside of this is that the usual way of setting the layer
in a script, as in
<pre>
LAYER <i>layer</i>;
WIRE (1 2) (3 4);
</pre>
doesn't work here. The layer needs to be selected while the LABEL command is
already active, which can be done like this
<pre>
LABEL <i>parameters</i>
LAYER <i>layer</i>
<i>more parameters</i>;
</pre>
Note that the LABEL line is <b>not</b> terminated with a <tt>';'</tt>, and
that the LAYER command starts on a new line.<br>
The commands
<pre>
LABEL
LAYER <i>layer</i>;
</pre>
set the layer to use with subsequent LABEL commands.


<a name=61>
<h1>LAYER</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Changes and defines layers.
<dt>
<b>Syntax</b>
<dd>
<tt>LAYER layer_number</tt><br>
<tt>LAYER layer_name</tt><br>
<tt>LAYER layer_number layer_name</tt><br>
<tt>LAYER [??] -layer_number</tt>
</dl>
<b>See also</b> <a href=#45>DISPLAY</a>
<h2>Choose Drawing Layer</h2>
The LAYER command with one parameter is used to change the current
layer, i.e. the layer onto which wires, circles etc. will be drawn.
If LAYER is selected from the menu, a popup menu will appear in which
you may change to the desired layer. If entered from the command line,
'layer_number' may be the number of any valid layer, and 'layer_name'
may be the name of a layer as displayed in the popup menu.
<p>
Certain layers are not available in all modes.
<p>
Please note that only those signal layers (1 through 16) are available
that have been entered into the layer setup in the <a href=#133>Design Rules</a>.
<h2>Define Layers</h2>
The LAYER command with two parameters is used to define a new layer
or to rename an existing one.
If you type in at the command prompt e.g.
<pre>
LAYER 101 SAMPLE;
</pre>
you define a new layer with layer number 101 and layer name SAMPLE.
<p>
If a package contains layers not yet specified in the board, these
layers are added to the board as soon as you place the package into
the board (ADD or REPLACE).
<p>
The predefined layers have a special function.
You can change their names, but their functions (related with their
number) remain the same.
<p>
If you define your own layers, you should use only numbers
greater than 100. Numbers below may be assigned for special purposes
in later EAGLE versions.
<h2>Delete Layers</h2>
The LAYER command with the minus sign and a layer_number deletes the
layer with the specified number, e.g.
<pre>
LAYER -103;
</pre>
deletes the layer number 103. Layers to be deleted must be empty.
If this is not the case, the program generates the error message
<p>
"layer is not empty: #"
<p>
where "#" represents the layer number.
If you want to avoid any error messages in a layer delete operation
you can use the '??' option. This may be
useful in scripts that try to delete certain layers, but don't consider
it an error if any of these layers is not empty or not present at all.
<p>
The predefined standard layers cannot be deleted.
<h2>Supply Layers</h2>
Layers 2...15 are treated as <i>supply layers</i> if their name starts with the <tt>'$'</tt>
character and there is a signal with an identical name but without the leading <tt>'$'</tt>.
<p>
Any pads or vias belonging to that signal are implicitly considered connected by the
<a href=#81>RATSNEST</a> command and the <a href=#131>Autorouter</a>.
<p>
Supply layers are viewed "inverted", which means that any objects visible on such a layer
will result in "copper free" areas on the board. The program automatically generates
Thermal and Annulus objects to connect and isolate pads and vias to/from these layers.
<p>
You should not draw any additional objects into a supply layer, except, for instance, wires
along the outlines of the board, which prevent the copper area from extending to the very
edges and thus possibly causing short circuits through a metal casing or mounting screw.
Note that there are <b>no checks whether a supply layer really connects all pads and vias</b>.
If e. g. a user drawn object isolates a pad that should be connected to the supply
layer, there will be no airwire generated for that (missing) connection. The same applies if several
Annulus symbols form a "ring" around a Thermal symbol (and would thus completely isolate
that pad from its signal).
<b>Also note that the size of the annulus symbols used in a supply layer is only
derived from the value given under "Annulus" in the "Supply" tab of the
<a href=#133>Design Rules</a>, and that neither the minimum distances
under "Clearance" nor those  in the <a href=#38>net classes</a> go
into this calculation.</b>
<p>
For a safer and more flexible way of implementing supply layers you should use the
<a href=#77>POLYGON</a> command.
<h2>Predefined EAGLE Layers</h2>
<h3>Layout</h3>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>1   Top       </td><td width=20><td>Tracks, top side</td></tr>
<tr><td>2   Route2    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>3   Route3    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>4   Route4    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>5   Route5    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>6   Route6    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>7   Route7    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>8   Route8    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>9   Route9    </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>10  Route10   </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>11  Route11   </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>12  Route12   </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>13  Route13   </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>14  Route14   </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>15  Route15   </td><td width=20><td>Inner layer (signal or supply)</td></tr>
<tr><td>16  Bottom    </td><td width=20><td>Tracks, bottom side</td></tr>
<tr><td>17  Pads      </td><td width=20><td>Pads (through-hole)</td></tr>
<tr><td>18  Vias      </td><td width=20><td>Vias (through-hole)</td></tr>
<tr><td>19  Unrouted  </td><td width=20><td>Airwires (rubberbands)</td></tr>
<tr><td>20  Dimension </td><td width=20><td>Board outlines (circles for holes)</td></tr>
<tr><td>21  tPlace    </td><td width=20><td>Silk screen, top side</td></tr>
<tr><td>22  bPlace    </td><td width=20><td>Silk screen, bottom side</td></tr>
<tr><td>23  tOrigins  </td><td width=20><td>Origins, top side</td></tr>
<tr><td>24  bOrigins  </td><td width=20><td>Origins, bottom side</td></tr>
<tr><td>25  tNames    </td><td width=20><td>Service print, top side</td></tr>
<tr><td>26  bNames    </td><td width=20><td>Service print, bottom side</td></tr>
<tr><td>27  tValues   </td><td width=20><td>Component VALUE, top side</td></tr>
<tr><td>28  bValues   </td><td width=20><td>Component VALUE, bottom side</td></tr>
<tr><td>29  tStop     </td><td width=20><td>Solder stop mask, top side</td></tr>
<tr><td>30  bStop     </td><td width=20><td>Solder stop mask, bottom side</td></tr>
<tr><td>31  tCream    </td><td width=20><td>Solder cream, top side</td></tr>
<tr><td>32  bCream    </td><td width=20><td>Solder cream, bottom side</td></tr>
<tr><td>33  tFinish   </td><td width=20><td>Finish, top side</td></tr>
<tr><td>34  bFinish   </td><td width=20><td>Finish, bottom side</td></tr>
<tr><td>35  tGlue     </td><td width=20><td>Glue mask, top side</td></tr>
<tr><td>36  bGlue     </td><td width=20><td>Glue mask, bottom side</td></tr>
<tr><td>37  tTest     </td><td width=20><td>Test and adjustment inf., top side</td></tr>
<tr><td>38  bTest     </td><td width=20><td>Test and adjustment inf. bottom side</td></tr>
<tr><td>39  tKeepout  </td><td width=20><td>Nogo areas for components, top side</td></tr>
<tr><td>40  bKeepout  </td><td width=20><td>Nogo areas for components, bottom side</td></tr>
<tr><td>41  tRestrict </td><td width=20><td>Nogo areas for tracks, top side</td></tr>
<tr><td>42  bRestrict </td><td width=20><td>Nogo areas for tracks, bottom side</td></tr>
<tr><td>43  vRestrict </td><td width=20><td>Nogo areas for via-holes</td></tr>
<tr><td>44  Drills    </td><td width=20><td>Conducting through-holes</td></tr>
<tr><td>45  Holes     </td><td width=20><td>Non-conducting holes</td></tr>
<tr><td>46  Milling   </td><td width=20><td>Milling</td></tr>
<tr><td>47  Measures  </td><td width=20><td>Measures</td></tr>
<tr><td>48  Document  </td><td width=20><td>General documentation</td></tr>
<tr><td>49  Reference </td><td width=20><td>Reference marks</td></tr>
<tr><td>51  tDocu     </td><td width=20><td>Part documentation, top side</td></tr>
<tr><td>52  bDocu     </td><td width=20><td>Part documentation, bottom side</td></tr>
</table>
<h3>Schematic</h3>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>91  Nets      </td><td width=20><td>Nets</td></tr>
<tr><td>92  Busses    </td><td width=20><td>Buses</td></tr>
<tr><td>93  Pins      </td><td width=20><td>Connection points for component symbols</td></tr>
<tr><td>              </td><td width=20><td>with additional information</td></tr>
<tr><td>94  Symbols   </td><td width=20><td>Shapes of component symbols</td></tr>
<tr><td>95  Names     </td><td width=20><td>Names of component symbols</td></tr>
<tr><td>96  Values    </td><td width=20><td>Values/component types</td></tr>
<tr><td>97  Info      </td><td width=20><td>General information</td></tr>
<tr><td>98  Guide     </td><td width=20><td>Guide lines</td></tr>
</table>


<a name=62>
<h1>LOCK</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Locks the position and orientation of a part in the board.
<dt>
<b>Syntax</b>
<dd>
<tt>LOCK &#149;..</tt><br>
<tt>LOCK name ..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Right</mb> applies the command to the group.<br>
<mb>Shift+Left</mb> reverses the lock operation ("unlocks" the part).<br>
<mb>Ctrl+Shift+Right</mb> "unlocks" all parts in the group.
</dl>
<b>See also</b> <a href=#67>MIRROR</a>,
<a href=#67>MOVE</a>,
<a href=#88>ROTATE</a>
<a href=#95>SMASH</a>
<p>
The LOCK command can be applied to parts in a board, and prevents them
from being moved, rotated, or mirrored. This is useful for things like
connectors, which need to be mounted at a particular location and must
not be inadvertently moved.
<p>
The origin of a locked part is displayed as an 'x' to have a visual
indication that the part is locked.
<p>
If a group is moved and it contains locked parts, these parts (together
with any wires ending at their pads) will not move with the group.
<p>
Detached texts of a locked part can still be moved individually, but
they won't move with a group.
<p>
Parts can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area.
<p>
A "locked" part can be made "unlocked" by clicking on it with the
<tt>Shift</tt> key pressed (and of course the LOCK command activated).


<a name=63>
<h1>MARK</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a mark on the drawing area.
<dt>
<b>Syntax</b>
<dd>
<tt>MARK &#149;</tt><br>
<tt>MARK;</tt>
</dl>
<b>See also</b> <a href=#53>GRID</a>
<p>
The MARK command allows you to define a point
on the drawing area and display the coordinates of the mouse cursor relative
to that point at the upper left corner of the screen (with a leading
'R' character). This command is useful especially when board dimensions
or cutouts are to be defined. Entering MARK; turns the mark
on or off.
<p>
Please choose a grid fine enough before using the MARK command.


<a name=64>
<h1>MENU</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Customizes the textual command menu.
<dt>
<b>Syntax</b>
<dd>
<tt>MENU option ..;</tt><br>
<tt>MENU;</tt>
</dl>
<b>See also</b> <a href=#31>ASSIGN</a>,
<a href=#91>SCRIPT</a>
<p>
The MENU command can be used to create a user specific command menu.
<p>
The complete syntax specification for the <tt>option</tt> parameters is
<pre>
option    := command | menu | delimiter
command   := text [ ':' text ]
menu      := text '{' option [ '|' option ] '}'
delimiter := '---'
</pre>
A menu option can either be a simple command, as in
<pre>
MENU Display Grid;
</pre>
which would set the menu to the commands <tt>Display</tt> and <tt>Grid</tt>;
an aliased command, as in
<pre>
MENU 'MyDisp : Display None Top Bottom Pads Vias;' 'MyGrid : Grid mil 100 lines on;';
</pre>
which would set the menu to show the command aliases <tt>MyDisp</tt> and <tt>MyGrid</tt>
and actually execute the command sequence behind the <tt>':'</tt> of each option when
the respective button is clicked;
or a submenu button as in
<pre>
MENU 'Grid { Fine : Grid inch 0.001; | Coarse : Grid inch 0.1; }';
</pre>
which would define a button labelled <tt>Grid</tt> that, when clicked opens a
submenu with the two options <tt>Fine</tt> and <tt>Coarse</tt>.
<p>
The special option <tt>'---'</tt> can be used to insert a delimiter, which
may be useful for grouping buttons.
<p>
Note that any <i>option</i> that consists of more than a single word, or that
might be interpreted as a command, must be enclosed in single quotes.
If you want to use the MENU command in a script to define a complex menu,
and would like to spread the menu definitions over several lines to make
them more readable, you need to end the lines with a backslash character (<tt>'\'</tt>)
as in
<pre>
MENU 'Grid {\
             Fine : Grid inch 0.001; |\
             Coarse : Grid inch 0.1;\
           }';
</pre>
<h2>Example</h2>
<pre>
MENU Move Delete Rotate Route ';' Edit;
</pre>
would create a command menu that contains the commands Move...Route,
the semicolon, and the Edit command.
<p>
The command
<pre>
MENU;
</pre>
switches back to the default menu.
<p>
Note that the ';' entry should always be added
to the menu. It is used to terminate many commands.


<a name=65>
<h1>MIRROR</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Mirrors objects and groups.
<dt>
<b>Syntax</b>
<dd>
<tt>MIRROR &#149;..</tt><br>
<tt>MIRROR name..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Right</mb> mirrors the group.
</dl>
<b>See also</b> <a href=#88>ROTATE</a>,
<a href=#62>LOCK</a>,
<a href=#99>TEXT</a>
<p>
Using the MIRROR command, objects may be mirrored about the y axis.
One application for this command is to mirror components to be placed
on the reverse side of the board.
<p>
Parts, pads, smds and pins can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area.
<p>
Attributes of parts can be selected by entering the concatenation of
part name and attribute name, as in <tt>R5&gt;VALUE</tt>.
<p>
Components can be mirrored only if the appropriate tOrigins/bOrigins
layer is visible.
<p>
When packages are selected for use with the MIRROR
command, connected wires on the outer layers are mirrored, too (beware of short
circuits!).
<p>
Note that any objects on inner layers (2...15) don't change their layer
when they are mirrored. The same applies to vias.
<p>
Parts cannot be mirrored if they are <a href=#62>locked</a>,
or if any of their connected pads would extend outside the allowed area
(in case you are using a <a href=#360>limited edition</a> of EAGLE).
<h2>Mirror a Group</h2>
In order to mirror a group of elements, the group is first defined
with the GROUP command and polygon in the usual manner. The MIRROR
command is then selected and the right mouse button is used to execute
the change. The group will be mirrored about the vertical axis through
the next grid point.
<p>
Wires, circles, pads and polygons may not be individually
mirrored unless included in a group.
<h2>Mirror Texts</h2>
Text on the solder side of a pc board (Bottom and bPlace layers) is
mirrored automatically so that it is readable when you look at the
solder side of the board.
<p>
Mirrored text in a schematic will be printed on the other side of its origin point,
but it will still remain normally readable.


<a name=66>
<h1>MITER</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Miters wire joints.
<dt>
<b>Syntax</b>
<dd>
<tt>MITER [radius] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Left&amp;Drag</mb> dynamically modifies the miter.<br>
<mb>Right</mb> toggles between round and straight mitering.
</dl>
<b>See also</b> <a href=#97>SPLIT</a>,
<a href=#106>WIRE</a>,
<a href=#89>ROUTE</a>,
<a href=#77>POLYGON</a>
<p>
The MITER command can be used to take the edge off a point where two wires join.
The two existing wires need to be on the the same layer and must have the same
width and wire style.
<h2>Mitering a point</h2>
If you select a point where exactly two straight wires join, an additional wire will
be inserted between these two wires, according to the given <i>radius</i>.
If you click&amp;drag on such a point with the left mouse button, you can define
the mitering wire dynamically.
<h2>Mitering a wire</h2>
If you select a wire (which may also be an arc) somewhere in the middle between its
end points, and that wire is connected to exactly two other straight wires (one at each
end), the selected wire will be "re-mitered" according to the given <i>radius</i>.
If you click&amp;drag on such a wire with the left mouse button, you can define
the mitering wire dynamically.
<h2>Straight versus round mitering</h2>
If <i>radius</i> is positive, the inserted wire will be an arc with the given radius;
if it is negative, a straight wire will be inserted (imagine the <tt>'-'</tt> sign as
indicating "straight"). You can toggle between round and straight mitering by pressing
the right mouse button.
<h2>Miter radius and wire bend style</h2>
The <i>radius</i> you give in the MITER command will be used in all other commands
that draw wires in case the wire bend style is one of the 90 or 45 degree styles.
If you have set round mitering, it will apply to both the 90 and 45 degree bend styles;
in case of straight mitering only the 90 degree bend styles are affected.


<a name=67>
<h1>MOVE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Moves objects.
<dt>
<b>Syntax</b>
<dd>
<tt>MOVE &#149; &#149;..</tt><br>
<tt>MOVE name &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Left</mb> selects an object at its origin or modifies it (see note).<br>
<mb>Ctrl+Right</mb> selects the group.<br>
<mb>Left&amp;Drag</mb> immediately moves the object.<br>
<mb>Ctrl+Right&amp;Drag</mb> immediately moves the group.<br>
<mb>Center</mb> mirrors the selected object or the group.<br>
<mb>Right</mb> rotates the selected object or the group.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
<dt>
<b>Keyboard</b>
<dd>
<tt>F7: MOVE</tt>   activates the MOVE command.
</dl>
<b>See also</b> <a href=#54>GROUP</a>,
<a href=#62>LOCK</a>,
<a href=#81>RATSNEST</a>
<p>
The MOVE command is used to move objects.
<p>
Parts, pads, smds, pins and gates can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area. Note that when selecting a multi-gate part in a schematic by name,
you will need to enter the full instance name, consisting of part
and gate name.
<p>
Attributes of parts can be selected by entering the concatenation of
part name and attribute name, as in <tt>R5&gt;VALUE</tt>.
<p>
Elements can be moved only if the appropriate tOrigins/bOrigins
layer is visible.
<p>
The MOVE command has no effect on layers that are not
visible (refer to DISPLAY).
<p>
The ends of wires (tracks) that are connected to an element cannot
be moved at this point.
<p>
When moving elements, connected wires (tracks) that belong to a signal
are moved too (beware of short circuits!).
<p>
If an object is selected with the left mouse button and the button is
not released, the object can be moved immediately ("click&amp;drag").
The same applies to groups when using the right mouse button.
In this mode, however, it is not possible to rotate or mirror the object
while moving it.
<p>
Parts cannot be moved if they are <a href=#62>locked</a>,
or if any of their connected pads would extend outside the allowed area
(in case you are using a <a href=#360>limited edition</a> of EAGLE).
<h2>Move Wires</h2>
If, following a MOVE command, two wires from different
signals are shorted together, they are maintained as separate signals
and the error will be flagged by the DRC command.
<h2>Move Groups</h2>
In order to move a group, the selected objects are defined in the
normal way (GROUP command and polygon) before selecting the MOVE command
and clicking the group with the right mouse button. The entire group
can now be moved and rotated with the right mouse button.
<h2>Hints for Schematics</h2>
If a supply pin (Direction Sup) is placed on a net, the pin name is
allocated to this net.
<p>
Pins placed on each other are connected together.
<p>
If unconnected pins of an element are placed on nets or pins then
they are connected with them.
<p>
If nets are moved over pins they are not connected with them.
<h2>Selecting objects at their origin</h2>
Normally a selected object remains within the grid it has been originally
placed on. If you press <tt>Ctrl</tt> while selecting an object, the point
where you have selected the object is pulled towards the cursor and snapped into
the current grid.
<p>
If you select a <i>wire</i> somewhere in the middle (not at one of its end points)
with <tt>Ctrl</tt> pressed, the end points stay fixed and you can bend the wire,
which changes it into an arc. The same way the curvature of an arc (which is basically
a wire) can be modified.
<p>
If you select a <i>rectangle</i> at one of its corners with <tt>Ctrl</tt> pressed,
you can resize both the rectangle's width and height. Selecting an edge of the
rectangle with <tt>Ctrl</tt> pressed lets you resize the rectangle's width or height,
respectively. Selecting the rectangle at its center with <tt>Ctrl</tt> pressed
pulls it towards the cursor and snaps it into the current grid.
<p>
If you select a <i>circle</i> at its circumference with <tt>Ctrl</tt> pressed, the
center stays fixed and you can resize the circle's diameter. Selecting the center point
this way pulls it towards the cursor and snaps it into the current grid.
<h2>Move part of a sheet to an other sheet</h2>
You can move part of a sheet to an other sheet of the same schematic without
affecting the board (in case <a href=#354>Forward&amp;Back Annotation</a>
is active) by defining a <a href=#54>GROUP</a> that contains the objects
you want to move, selecting that group with the MOVE command and then switching to
the desired sheet, with the MOVE command still active and having the group attached
to the cursor. In the new sheet the MOVE command will be active again and will have
the previously defined group attached to the cursor. Now place the group as usual,
and all the affected objects will be transferred from the original sheet to the
current sheet. If the current sheet is the same as the original sheet, nothing
happens.
<p>
Note that only wires that have both ends in the group will be transferred, and
any part that is transferred takes all its electrical connections with it, even if
a net wire attached to one of its pins is not transferred because its other end
is not in the group.
In case a pin in the new sheet has an electrical connection, but no other pin,
wire or junction attached to it to make this visible, a junction will be
automatically generated at this point.
<p>
This process can even be scripted. For instance
<pre>
edit .s1
group (1 1) (1 2) (2 2) (2 1) (1 1)
move (&gt; 0 0)
edit .s2
(0 0)
</pre>
would switch to the first sheet, define a group, select that group with MOVE,
switch to the second sheet and place the group. Note the final <tt>(0 0)</tt>,
which are coordinates to the implicitly invoked MOVE command.
<p>
See the <a href=#47>EDIT</a> command if you want to just reorder the
sheets.


<a name=68>
<h1>NAME</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Displays and changes names.
<dt>
<b>Syntax</b>
<dd>
<tt>NAME &#149;..</tt><br>
<tt>NAME new_name &#149;</tt><br>
<tt>NAME old_name new_name</tt>
</dl>
<b>See also</b> <a href=#93>SHOW</a>,
<a href=#95>SMASH</a>,
<a href=#103>VALUE</a>
<p>
The NAME command is used to display or edit the name of the selected object.
<p>
Parts, pads, smds, pins and gates can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area.
<h2>Library</h2>
When in library edit mode, the NAME command is used to display or
edit the name of the selected pad, smd, pin or gate.
<h2>Automatic Naming</h2>
EAGLE generates names automatically: E$.. for elements, S$.. for signals,
P$.. for pads, pins and smds. In general, it is convenient to substitute
commonly used names (e.g. 1...14 for a 14-pin dual inline package)
in place of these automatically generated names.
<h2>Schematic</h2>
If nets or buses are to be renamed, the program has to distinguish
between three cases because they can consist of several segments placed
on different sheets. Thus a menu will ask the user:
<p>
This segment<br>
Every segment on this sheet<br>
All segments on all sheets
<p>
These questions appear in a popup menu if necessary
and can be answered either by selecting the appropriate item with
the mouse or by pressing the appropriate hot key (T, E, A).
<h2>Polygon</h2>
When renaming a signal polygon in a board, you can choose whether to rename
only this polygon (and thus move it from one signal into another), or to
give the entire signal a different name.


<a name=69>
<h1>NET</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Draws nets on a schematic.
<dt>
<b>Syntax</b>
<dd>
<tt>NET [net_name] &#149; [curve | @radius] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Right</mb> changes the wire bend style (see <a href=#92>SET Wire_Bend</a>).<br>
<mb>Shift+Right</mb> reverses the direction of switching bend styles.<br>
<mb>Ctrl+Right</mb> toggles between corresponding bend styles.
</dl>
<b>See also</b> <a href=#35>BUS</a>,
<a href=#68>NAME</a>,
<a href=#38>CLASS</a>,
<a href=#92>SET</a>
<p>
The net command is used to draw individual connections (nets) onto
the Net layer of a schematic drawing. The first mouse click marks
the starting point for the net, the second marks the end point of
a segment. Two mouse clicks on the same point end the net.
<p>
If a net wire is placed at a point where there is already another net
or bus wire or a pin, the current net wire will be ended at that point.
This function can be disabled with "<tt>SET AUTO_END_NET OFF;</tt>",
or by unchecking "Options/Set/Misc/Auto end net and bus".
<p>
If a net wire is placed at a point where there are at least two other
net wires and/or pins, a junction will automatically be placed.
This function can be disabled with "<tt>SET AUTO_JUNCTION OFF;</tt>",
or by unchecking "Options/Set/Misc/Auto set junction".
<p>
If the <i>curve</i> or <i>@radius</i> parameter is given, an arc can be drawn as part of the net
(see the detailed description in the <a href=#106>WIRE</a> command).
<h2>Select Bus Signal</h2>
If a net is started on a bus, a popup menu opens from which one of
the bus signals can be selected. The net then is named correspondingly
and becomes part of the same signal. If the bus includes several part
buses, a further popup menu opens from which the relevant part bus
can be selected.
<h2>Net Names</h2>
If the NET command is used with a net name
then the net is named accordingly.
<p>
If no net name is included in the command line and the net is not
started on a bus, then a name in the form of N$1 is automatically
allocated to the net.
<p>
Nets or net segments that run over different sheets of a schematic and use
the same net name are connected.
<p>
Net names should not contain a comma (<tt>','</tt>), because this
is the delimiting character in <a href=#35>busses</a>.
<h2>Line Width</h2>
The width of the line drawn by the net command may be changed with
the command:
<pre>
SET NET_WIRE_WIDTH width;
</pre>
(Default: 6 mil).
<h2>Inverted signals</h2>
The name of an inverted signal ("active low") can be displayed overlined if it
is preceded with an exclamation mark (<tt>'!'</tt>), as in
<pre>
  !RESET
</pre>
which would result in
<pre>
  _____
  RESET
</pre>
You can find further details about this in the description of the <a href=#99>TEXT</a> command.


<a name=70>
<h1>OPEN</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a library for editing.
<dt>
<b>Syntax</b>
<dd>
<tt>OPEN library_name</tt>
</dl>
<b>See also</b> <a href=#39>CLOSE</a>,
<a href=#102>USE</a>,
<a href=#47>EDIT</a>,
<a href=#91>SCRIPT</a>
<p>
The OPEN command is used to open an existing library or create a new
library. Once the library has been opened or created, an existing
or new symbol, device, or package may be edited.
<p>
This command is mainly used in script files.


<a name=71>
<h1>OPTIMIZE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Joins wire segments together.
<dt>
<b>Syntax</b>
<dd>
<tt>OPTIMIZE;</tt><br>
<tt>OPTIMIZE signal_name ..</tt><br>
<tt>OPTIMIZE &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Right</mb> optimizes the group.
</dl>
<b>See also</b> <a href=#92>SET</a>,
<a href=#97>SPLIT</a>,
<a href=#67>MOVE</a>,
<a href=#89>ROUTE</a>
<p>
The OPTIMIZE command joins wire segments which lie
in one straight line. The individual segments must be on the same
layer and have the same width. This command is useful to reduce the
number of objects in a drawing and to facilitate moving a complete
track instead of individual segments.
<p>
If signal names are given, or a signal is selected, the command affects
only the respective signals.
<h2>Automatic Optimization</h2>
This wire optimization takes place automatically after MOVE, SPLIT,
or ROUTE commands unless it is disabled with the command:
<pre>
SET OPTIMIZING OFF;
</pre>
or you have clicked the same spot twice with the SPLIT command.
<p>
The OPTIMIZE command works in any case, no matter if Optimizing
is enabled or disabled.


<a name=72>
<h1>PACKAGE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a package variant for a device.
<dt>
<b>Syntax</b>
<dd>
<tt>PACKAGE</tt><br>
<tt>PACKAGE pname vname</tt><br>
<tt>PACKAGE pname@lname vname</tt><br>
<tt>PACKAGE name</tt><br>
<tt>PACKAGE -old_name new_name</tt><br>
<tt>PACKAGE -name</tt>
</dl>
<b>See also</b> <a href=#40>CONNECT</a>,
<a href=#98>TECHNOLOGY</a>,
<a href=#78>PREFIX</a>
<p>
This command is used in the device edit mode to define, delete or rename
a package variant.
In the schematic or board editor the PACKAGE command behaves exactly
like "<a href=#36>CHANGE PACKAGE</a>".
<p>
Without parameters a dialog is opened that allows you to select a package
and define this variant's name.
<p>
The parameters <tt>pname vname</tt> assign the package <tt>pname</tt> to
the new variant <tt>vname</tt>.
<p>
The notation <tt>pname@lname vname</tt> fetches the package <tt>pname</tt>
from library <tt>lname</tt> and creates a new package variant.
This can also be done through the library objects'
<a href=#13>context menu</a> or via <i>Drag&amp;Drop</i> from
the Control Panel's tree view.
<p>
The single parameter <tt>name</tt> switches to the given existing package
variant. If no package variants have been defined yet, and a package of the
given name exists, a new package variant named '' (an "empty" name) with the
given package will be created (this is for compatibility with version 3.5).
<p>
If <tt>-old_name new_name</tt> is given, the package variant <tt>old_name</tt>
is renamed to <tt>new_name</tt>.
<p>
The single parameter <tt>-name</tt> deletes the given package variant.
<p>
The name of a package variant will be appended to the device set name to
form the full device name. If the device set name contains the character <tt>'?'</tt>,
that character will be replaced by the package variant name.
Note that the package variant is processed after the technology, so if the device set
name contains neither a <tt>'*'</tt> nor a <tt>'?'</tt> character, the resulting device
name will consist of <i>device_set_name</i><tt>+</tt><i>technology</i><tt>+</tt><i>package_variant</i>.
<p>
Following the PACKAGE command, the CONNECT command is used to define
the correspondence of pins in the schematic device to pads on the
package.
<p>
The maximum number of technologies per device set is 254.
<p>
When the <a href=#34>BOARD</a> command is used in schematic
editing mode to create a new board, each device is represented on a board
layout with the appropriate package as already defined with the
PACKAGE command.


<a name=73>
<h1>PAD</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds pads to a package.
<dt>
<b>Syntax</b>
<dd>
<tt>PAD [diameter] [shape] [orientation] [flags] ['name'] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Right</mb> rotates the pad.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#96>SMD</a>,
<a href=#36>CHANGE</a>,
<a href=#45>DISPLAY</a>,
<a href=#92>SET</a>,
<a href=#68>NAME</a>,
<a href=#104>VIA</a>,
<a href=#133>Design Rules</a>
<p>
The PAD command is used to add pads to a package. When the PAD command
is active, a pad symbol is attached to the cursor and can be moved
around the screen. Pressing the left mouse button places a pad at
the current position.
Entering a number changes the diameter of the pad (in the actual unit).
Pad diameters can be up to 0.51602 inch (13.1 mm).
<p>
The <tt>orientation</tt> (see description in <a href=#29>ADD</a>)
may be any angle in the range <tt>R0</tt>...<tt>R359.9</tt>. The <tt>S</tt>
and <tt>M</tt> flags can't be used here.
<h2>Example</h2>
<pre>
PAD 0.06 &#149;
</pre>
The pad will have a diameter of 0.06 inch, provided the actual unit
is "inch". This diameter remains as a presetting for successive
operations.
<h2>Pad Shapes</h2>
A pad can have one of the following shapes:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Square    </td><td width=20><td></td></tr>
<tr><td>Round     </td><td width=20><td></td></tr>
<tr><td>Octagon   </td><td width=20><td>octagonal</td></tr>
<tr><td>Long      </td><td width=20><td>elongated</td></tr>
<tr><td>Offset    </td><td width=20><td>elongated with offset</td></tr>
</table>
<p>
These shapes only apply to the outer layers (Top and Bottom).
In inner layers the shape is always "round".
<p>
With elongated pads, the given diameter defines the smaller side of the pad.
The ratio between the two sides of elongated pads is given by the
parameter Shapes/Elongation in the <a href=#133>Design Rules</a>
of the board (default is 100%, which results in a ratio of 2:1).
<p>
The pad shape or diameter can be selected while the PAD command is
active, or it can be changed with the CHANGE command, e.g.:
<pre>
CHANGE SHAPE OCTAGON &#149;
</pre>
The drill size may also be changed using the CHANGE command. The existing
values then remain in use for successive pads.
<p>
Because displaying different pad shapes and drill holes in their real
size slows down the screen refresh, EAGLE lets you change between
real and fast display mode by the use of the SET commands:
<pre>
SET DISPLAY_MODE REAL | NODRILL;
</pre>
Note that the actual shape and diameter of a pad will be determined by the
<a href=#133>Design Rules</a> of the board the part is used in.
<h2>Pad Names</h2>
Pad names are generated by the program automatically
and can be changed with the NAME command. The name can also be defined
in the PAD command. Pad name display can be turned on or off by means
of the commands:
<pre>
SET PAD_NAMES OFF | ON;
</pre>
This change will be visible after the next screen refresh.
<h2>Flags</h2>
The following <i>flags</i> can be used to control the appearance of a pad:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>NOSTOP</tt>  </td><td width=20><td>don't generate solder stop mask</td></tr>
<tr><td><tt>NOTHERMALS</tt>       </td><td width=20><td>don't generate thermals</td></tr>
<tr><td><tt>FIRST</tt>            </td><td width=20><td>this is the "first" pad (which may be drawn with a special shape)</td></tr>
</table>
<p>
By default a pad automatically generates solder stop mask and thermals as necessary.
However, in special cases it may be desirable to have particular pads not do this.
The above <tt>NO...</tt> flags can be used to suppress these features.<br>
If the <a href=#133>Design Rules</a> of a given board specify that the
"first pad" of a package shall be drawn with a particular shape, the pad marked with
the <tt>FIRST</tt> flag will be displayed that way.<br>
A newly started PAD command resets all flags to their defaults. Once a flag is given
in the command line, it applies to all following pads placed within this PAD command
(except for <tt>FIRST</tt>, which applies only to the pad immediately following this
option).
<h2>Single Pads</h2>
Single pads in boards can be used only by defining a package
with one pad. Via-holes can be placed in board but they don't have
an element name and therefore don't show up in the netlist.
<h2>Alter Package</h2>
It is not possible to add or delete pads in packages which
are already used by a device, because this would change the pin/pad
allocation defined with the CONNECT command.


<a name=74>
<h1>PASTE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Copies the contents of the paste buffer to a drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>PASTE [ orientation ] &#149;</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> mirrors the contents of the paste buffer.<br>
<mb>Right</mb> rotates the contents of the paste buffer.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#42>CUT</a>,
<a href=#54>GROUP</a>
<p>
See the <a href=#29>ADD</a> command for an explanation of Orientation.
<p>
Using the commands GROUP, CUT, and PASTE, parts of a drawing/library
can be copied to the same or different drawings/libraries. When using
the PASTE command, the following points should be observed:
<ul>
<li>CUT/PASTE cannot be used in device editing mode.
<li>Elements and signals on a board can only be copied to a board.
<li>Elements, buses and nets on a schematic can only be copied to a schematic.
<li>Pads and smds can only be copied from package to package.
<li>Pins can only be copied from symbol to symbol.
<li>When copying elements, signals, pads, smds and pins, a new name is
allocated if the previous name is already used in the new drawing.
<li>Buses retain the same names.
<li>Nets retain the same name as long as one of the net segments
has a label. If no label is present, a new name is generated if the previous
name is already in use.
</ul>
If there are modified versions of devices or packages in the paste buffer,
an automatic <a href=#101>library update</a> will be started to replace
the objects in the schematic or board with the ones from the paste buffer.
<b>Note: You should always run a <a href=#46>Design Rule Check</a> (DRC) and an
<a href=#48>Electrical Rule Check</a> (ERC) after a library update has been performed!</b>


<a name=75>
<h1>PIN</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines connection points for symbols.
<dt>
<b>Syntax</b>
<dd>
<tt>PIN 'name' options &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Right</mb> rotates the pin.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#68>NAME</a>,
<a href=#93>SHOW</a>,
<a href=#36>CHANGE</a>
<h2>Options</h2>
There are six possible options:
<p>
Direction<br>
Function<br>
Length<br>
Orientation<br>
Visible<br>
Swaplevel
<h3>Direction</h3>
The logical direction of signal flow. It is essential for the Electrical
Rule Check (ERC) and for the automatic wiring of the power supply
pins. The following possibilities may be used:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>NC   </td><td width=20><td>not connected</td></tr>
<tr><td>In   </td><td width=20><td>input</td></tr>
<tr><td>Out  </td><td width=20><td>output (totem-pole)</td></tr>
<tr><td>I/O  </td><td width=20><td>in/output (bidirectional)</td></tr>
<tr><td>OC   </td><td width=20><td>open collector or open drain</td></tr>
<tr><td>Hiz  </td><td width=20><td>high impedance output (e.g. 3-state)</td></tr>
<tr><td>Pas  </td><td width=20><td>passive (for resistors, capacitors etc.)</td></tr>
<tr><td>Pwr  </td><td width=20><td>power input pin (Vcc, Gnd, Vss, Vdd, etc.)</td></tr>
<tr><td>Sup  </td><td width=20><td>general supply pin (e.g. for ground symbol)</td></tr>
</table>
<p>
Default: I/O
<p>
If Pwr pins are used on a symbol and a corresponding Sup pin exists
on the schematic, nets are connected automatically. The Sup pin is
not used for components.
<h3>Function</h3>
The graphic representation of the pin:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>None    </td><td width=20><td>no special function</td></tr>
<tr><td>Dot     </td><td width=20><td>inverter symbol</td></tr>
<tr><td>Clk     </td><td width=20><td>clock symbol</td></tr>
<tr><td>DotClk  </td><td width=20><td>inverted clock symbol</td></tr>
</table>
<p>
Default: None
<h3>Length</h3>
Length of the pin symbol:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Point   </td><td width=20><td>pin with no connection or name</td></tr>
<tr><td>Short   </td><td width=20><td>0.1 inch long connection</td></tr>
<tr><td>Middle  </td><td width=20><td>0.2 inch long connection</td></tr>
<tr><td>Long    </td><td width=20><td>0.3 inch long connection</td></tr>
</table>
<p>
Default: Long
<h3>Orientation</h3>
The orientation of the pin. When placing pins manually the right mouse
button rotates the pin. The parameter "orientation" is mainly
used in script files:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>R0    </td><td width=20><td>connection point on the right</td></tr>
<tr><td>R90   </td><td width=20><td>connection point above</td></tr>
<tr><td>R180  </td><td width=20><td>connection point on the left</td></tr>
<tr><td>R270  </td><td width=20><td>connection point below</td></tr>
</table>
<p>
Default: R0
<h3>Visible</h3>
This parameter defines if pin and/or pad name are visible in the schematic:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Off    </td><td width=20><td>pin and pad name not drawn</td></tr>
<tr><td>Pad    </td><td width=20><td>pad name drawn, pin name not drawn</td></tr>
<tr><td>Pin    </td><td width=20><td>pin name drawn, pad name not drawn</td></tr>
<tr><td>Both   </td><td width=20><td>pin and pad name drawn</td></tr>
</table>
<p>
Default: Both
<h3>Swaplevel</h3>
A number between 0 and 255. Swaplevel = 0 indicates that a pin can
not be swapped with another. The allocation of a number greater than
0 indicates that a pin may be swapped with any other in the same symbol
with the same swaplevel number. For example: The inputs of a NAND
gate could be allocated the same swaplevel number as they are all
identical.
<p>
Default: 0
<h2>Using the PIN Command</h2>
The PIN command is used to define connection points on a symbol for
nets. Pins are drawn onto the Symbols layer while additional information
appears on the Pins layer. Individual pins may be assigned various
options in the command line. The options can be listed in any order
or omitted. In this case the default options are valid.
<p>
If a name is used in the PIN command, it must be enclosed in
apostrophes. Pin names can be changed in the symbol edit mode
using the NAME command.
<h2>Automatic Naming</h2>
Pins may be automatically numbered in the following way. In order
to place the pins D0...D7 on a symbol, the first pin is placed with
the following command:
<pre>
PIN 'D0' *
</pre>
and the location for the other pins defined with a mouse click for each.
<h2>Predefine options with CHANGE</h2>
All options may be predefined with CHANGE commands. The options remain
in use until edited by a new PIN or CHANGE command.
<p>
The SHOW command may be used to show pin options such as Direction
and Swaplevel.
<h2>Pins with the same Name</h2>
If it is required to define several pins in a component with the same
name, the following procedure can be used:
<p>
For example, suppose that three pins are required for
GND. The pins are allocated the names GND@1, GND@2 and GND@3 during
the symbol definition. Then only the characters before the "@"
sign appear in the schematic.
<p>
It is not possible to add or delete pins in symbols
which are already used by a device because this would change the pin/pad
allocation defined with the CONNECT command.
<h2>Pin Lettering</h2>
The position of pin and pad names on a symbol relative
to the pin connection point can not be changed, nor can the text size.
When defining new symbols please ensure their size is consistent with
existing symbols.
<h2>Inverted pins</h2>
The name of an inverted pin ("active low") can be displayed overlined if it
is preceded with an exclamation mark (<tt>'!'</tt>), as in
<pre>
  !RESET
</pre>
which would result in
<pre>
  _____
  RESET
</pre>
You can find further details about this in the description of the <a href=#99>TEXT</a> command.


<a name=76>
<h1>PINSWAP</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Swap pins or pads.
<dt>
<b>Syntax</b>
<dd>
<tt>PINSWAP &#149; &#149;..</tt>
</dl>
<b>See also</b> <a href=#75>PIN</a>
<p>
The PINSWAP command is used to swap pins within the same symbol which
have been allocated the same swaplevel (&gt; 0). Swaplevel, see PIN command.
If a board is tied to a schematic via
<a href=#354>Back Annotation</a>
two pads can only
be swapped if the related pins are swappable.
<p>
On a board without a schematic this command permits two pads in the
same package to be swapped. The Swaplevel is not checked in this case.
<p>
Wires attached to the swapped pins are moved with the pins so that
short circuits may appear. Please perform the DRC and correct possible
errors.


<a name=77>
<h1>POLYGON</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Draws polygon areas.
<dt>
<b>Syntax</b>
<dd>
<tt>POLYGON [signal_name] [width] &#149; [curve | @radius] &#149; &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.<br>
<mb>Right</mb> changes the wire bend style (see <a href=#92>SET Wire_Bend</a>).<br>
<mb>Shift+Right</mb> reverses the direction of switching bend styles.<br>
<mb>Ctrl+Right</mb> toggles between corresponding bend styles.<br>
<mb>Ctrl+Left</mb> when placing a wire end point defines arc radius.<br>
<mb>Left</mb> twice at the same point closes the polygon.
</dl>
<b>See also</b> <a href=#36>CHANGE</a>,
<a href=#43>DELETE</a>,
<a href=#81>RATSNEST</a>,
<a href=#87>RIPUP</a>,
<a href=#106>WIRE</a>,
<a href=#66>MITER</a>
<p>
The POLYGON command is used to draw polygon areas. Polygons in the
layers Top, Bottom, and Route2..15 are treated as signals. Polygons
in the layers t/b/vRestrict are protected areas for the Autorouter.
<p>
If the <i>curve</i> or <i>@radius</i> parameter is given, an arc can be drawn as part of the polygon
definition (see the detailed description in the <a href=#106>WIRE</a>
command).
<h2>Note</h2>
You should avoid using very small values for the <i>width</i> of a
polygon, because this can cause extremely large amounts of data when
processing a drawing with the <a href=#113>CAM Processor</a>.<br>
The polygon <i>width</i> should always be larger than the hardware
resolution of the output device. For example when using a Gerber photoplotter
with a typical resolution of 1 mil, the polygon <i>width</i> should
not be smaller than, say, 6 mil. Typically you should keep the polygon
<i>width</i> in the same range as your other wires.
<p>
If you want to give the polygon a name that starts with a digit (as in <tt>0V</tt>),
you must enclose the name in single quotes to distinguish it from a <i>width</i> value.
<p>
The parameters <tt>Isolate</tt> and <tt>Rank</tt> only have a meaning for polygons
in layers Top...Bottom.
<h2>Outlines or Real Mode</h2>
Polygons belonging to a signal can be displayed in two different
modes:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>1.&nbsp;Outlines   </td><td width=20><td>only the outlines as defined by the user are displayed.</td></tr>
<tr><td>2.&nbsp;Real&nbsp;mode  </td><td width=20><td>all of the areas are visible as calculated by the program.</td></tr>
</table>
<p>
In "outlines" mode a polygon is drawn with dotted wires, so that it can be
distinguished from other wires.
The board file contains only the "outlines".
<p>
The default display mode is "outlines" as the calculation is a time
consuming operation.
<p>
When a drawing is generated with the CAM Processor all polygons are
calculated.
<p>
The <a href=#81>RATSNEST</a>
command starts the calculation of the polygons
(this can be turned off with
<tt><a href=#92>SET</a> POLYGON_RATSNEST OFF;</tt>).
Clicking the STOP button terminates the calculation of the polygons. Already
calculated polygons are shown in "real mode", all others are shown in
"outline mode".
<p>
The
<a href=#87>RIPUP</a>
command changes the display mode of a polygon to "outline".
<p>
CHANGE operations re-calculate a polygon if it was shown in "real
mode" before.
<h2>Other commands and Polygons</h2>
Polygons are selected at their edges (like wires).
<p>
SPLIT: Inserts a new polygon edge.
<p>
DELETE: Deletes a polygon corner (if only three corners are left the
whole polygon is deleted).
<p>
CHANGE LAYER: Changes the layer of the whole polygon.
<p>
CHANGE WIDTH: Changes the parameter width of the whole polygon.
<p>
MOVE: Moves a polygon edge or corner (like wire segments).
<p>
COPY: Copies the whole polygon.
<p>
NAME: If the polygon is located in a signal layer the name of the
signal is changed.
<h2>Parameters</h2>
<h3>Width</h3>
Line width of the polygon edges. Also used for filling.
<h3>Layer</h3>
Polygons can be drawn into any layer.
Polygons in signal layers belong to a signal and keep the distance
defined in the design rules and net classes from other signals.
Objects in the tRestrict layer are substracted from polygons in the
Top layer (the same applies to bRestrict/Bottom). This allows you, for
instance, to generate "negative" text on a ground area.
<h3>Pour</h3>
Fill mode (Solid [default] or Hatch).
<h3>Rank</h3>
Defines how polygons are subtracted from each other. Polygons with
a lower 'rank' appear "first" and thus get subtracted from polygons with a higher 'rank'.<br>
Valid ranks are <tt>1..6</tt> for signal polygons and <tt>0</tt> or <tt>7</tt> for
polygons in packages. Polygons with the same rank are checked against each other
by the <a href=#46>Design Rule Check</a>. The rank parameter only has a
meaning for polygons in signal layers (<tt>1..16</tt>) and will be ignored for
polygons in other layers. The default is <tt>1</tt> for signal polygons and <tt>7</tt>
for package polygons.
<h3>Thermals</h3>
Defines how pads and smds are connected (On
= thermals are generated [default], Off = no thermals).
<h3>Spacing</h3>
Distance between fill lines when Pour = Hatch
(default: 50 Mil).
<h3>Isolate</h3>
Distance between polygon areas and other signals or objects in
the Dimension layer (default: 0).
If a particular polygon is given an Isolate value that exceeds that from the
design rules and net classes, the larger value will be taken.
See also <a href=#133>Design Rules</a> under <b>Distance</b> and <b>Supply</b>, respectively.
<b>Note that if you give a polygon an Isolate value that exceeds that from the
design rules and net classes, small gaps may result between the calculated polygon
and objects belonging to the same signal as the polygon itself, which may lead
to problems during manufacturing! It is therefore recommended to leave this
parameter at 0, unless you know exactly what you are doing!</b>
<h3>Orphans</h3>
As a polygon automatically keeps a certain distance
to other signals it can happen that the polygon is separated into
a number of smaller polygons. If such a polygon has no electrical
connection to any other (non-polygon) object of its signal,
the user might want it to disappear. With the parameter Orphans&nbsp;=&nbsp;Off
[default] these isolated zones will disappear. With Orphans&nbsp;=&nbsp;On they
will remain. If a signal consists only of polygons and has no other electrically
connected objects, all polygon parts will remain, independent of the setting of
the Orphans parameter.
<p>
Under certain circumstances, especially with Orphans&nbsp;=&nbsp;Off,
a polygon can disappear completely.
In that case the polygon's original outlines will be displayed on the
screen, to make it possible to delete or otherwise modify it.
When going to the printer or CAM Processor these outlines will not
be drawn in order to avoid short circuits.
A polygon is also displayed with its original outlines if there are
other non-polygon objects in the signal, but none of them is connected
to the polygon.
<h2>Thermal dimensions</h2>
The width of the conducting path in the thermal symbol is calculated
as follows:
<ul>
<li>Pads: half the drill diameter of the pad
<li>Smds: half the smaller side of the smd
<li>at least the width of the polygon
<li>a maximum of twice the width of the polygon
</ul>
<h2>Outlines data</h2>
The special signal name _OUTLINES_ gives a polygon certain properties that
are used to generate <a href=#130>outlines data</a> (for example
for milling prototype boards).
This name should not be used otherwise.
<h2>Hatched polygons and airwires </h2>
Depending on the value of the <i>spacing</i> parameter, pads, smds, vias and wires inside a
hatched polygon that are connected to the same signal as the polygon may "fall through"
the raster and thus have airwires generated to indicate their connection to the
signal.
<p>
When calculating whether such an object is actually solidly connected to the
hatched polygon, it is reduced to several "control points". For a round pad, for
instance, these would be the north, east, west and south point on the pad's
circumference, while for a wire it's the two end points. A solid connection is
considered to exist if there is at least one line in the calculated polygon (outline
or hatch line) that runs through these points with its center line.
<p>
Thermal and annulus rings inside a hatched polygon that do not have solid contact to
any of the polygon lines are not generated.


<a name=78>
<h1>PREFIX</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines the prefix for a symbol name.
<dt>
<b>Syntax</b>
<dd>
<tt>PREFIX prefix_string;</tt>
</dl>
<b>See also</b> <a href=#40>CONNECT</a>,
<a href=#72>PACKAGE</a>,
<a href=#103>VALUE</a>
<p>
This command is used in the device editor mode to determine the initial
characters of automatically generated symbol names when a symbol is
placed in a schematic using the ADD command.
<h2>Example</h2>
<pre>
PREFIX U;
</pre>
If this command is used when editing, for example, a 7400 device, then
gates which are later placed in a schematic using the ADD command
will be allocated the names  U1, U2, U3 in sequence. These names may
be changed later with the NAME command.


<a name=79>
<h1>PRINT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Prints a drawing to the system printer.
<dt>
<b>Syntax</b>
<dd>
<tt>PRINT [factor] [-limit] [options] [;]</tt>
</dl>
<b>See also</b> <a href=#113>CAM Processor</a>,
<a href=#109>printing to the system printer</a>
<p>
The PRINT command prints the currently edited drawing to the system printer.
<p>
Colors and fill styles are used as set in the editor window. This can be
changed with the <tt>SOLID</tt> and <tt>BLACK</tt> options.
The color palette used for the printout is always that for white background.
<p>
If you want to print pads and vias "filled" (without the drill holes
being visible), use the command
<pre>
<a href=#92>SET</a> DISPLAY_MODE NODRILL;
</pre>
<b>Please note that polygons in boards will not be automatically calculated
when printing via the PRINT command! Only the outlines will be drawn.
To print polygons in their calculated shape you have to use the
<a href=#81>RATSNEST</a> command before printing.</b>
<p>
You can enter a <tt>factor</tt> to scale the output.
<p>
The <tt>limit</tt> parameter is the maximum number of pages you want the
output to use. The number has to be preceded with a <tt>'-'</tt> to
distinguish it from the <tt>factor</tt>.
In case the drawing does not fit on the given number of pages, the <tt>factor</tt>
will be reduced until it fits.
Set this parameter to <tt>-0</tt> to allow any number of pages (and thus making sure
the printout uses exactly the given scale factor).
<p>
If the PRINT command is not terminated with a <tt>';'</tt>,
a <a href=#110>print dialog</a> will allow you to set
print options.
Note that options entered via the command line will not be stored permanently in the print setup
unless they have been confirmed in the <a href=#110>print dialog</a>
(i.e. if the command has not been terminated with a <tt>';'</tt>).
<p>
The following <tt>options</tt> exist:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>MIRROR</tt>        </td><td width=20><td>mirrors the output</td></tr>
<tr><td><tt>ROTATE</tt>        </td><td width=20><td>rotates the output by 90&deg;</td></tr>
<tr><td><tt>UPSIDEDOWN</tt>    </td><td width=20><td>rotates the drawing by 180&deg;. Together with <tt>ROTATE</tt>, the drawing is rotated by a total of 270&deg;</td></tr>
<tr><td><tt>BLACK</tt>         </td><td width=20><td>ignores the color settings of the layers and prints everything in black</td></tr>
<tr><td><tt>SOLID</tt>         </td><td width=20><td>ignores the fill style settings of the layers and prints everything in solid</td></tr>
<tr><td><tt>CAPTION</tt>       </td><td width=20><td>prints a caption at the bottom of the page</td></tr>
<tr><td><tt>FILE</tt>          </td><td width=20><td>prints the output into a file; the file name must immediately follow this option</td></tr>
<tr><td><tt>PRINTER</tt>       </td><td width=20><td>prints to a specific printer; the printer name must immediately follow this option</td></tr>
<tr><td><tt>PAPER</tt>         </td><td width=20><td>prints on the given paper size; the paper size must immediately follow this option</td></tr>
<tr><td><tt>SHEETS</tt>        </td><td width=20><td>prints the given range of sheets; the range (from-to) must immediately follow this option</td></tr>
<tr><td><tt>WINDOW</tt>        </td><td width=20><td>prints the currently visible window selection of the drawing</td></tr>
<tr><td><tt>PORTRAIT</tt>      </td><td width=20><td>prints in portrait orientation</td></tr>
<tr><td><tt>LANDSCAPE</tt>     </td><td width=20><td>prints in landscape orientation</td></tr>
</table>
<p>
If any of the <tt>options</tt> <tt>MIRROR</tt>...<tt>CAPTION</tt> is preceeded with a <tt>'-'</tt>, that option is turned off in case
it is currently on (from a previous PRINT).
A <tt>'-'</tt> by itself turns off all <tt>options</tt>.
<h2>Printing to a file</h2>
The <tt>FILE</tt> option can be used to print the output into a file.
If this option is present, it must be immediately followed by the name of the output file.
<p>
If the output file name has an extension of <tt>".pdf"</tt> (case insensitive),
a PDF file will be created. A PDF file can also be created by selecting "Print to File (PDF)"
from the "Printer" combo box in the <a href=#110>print dialog</a>.
Texts in a PDF file can be searched in a PDF viewer, as long as they are not
using the vector font.
<p>
If the output file name has an extension of <tt>".ps"</tt> (case insensitive),
a Postscript file will be created.
<p>
If the file name is only an <tt>"*"</tt> or <tt>"*.ext"</tt> (an asterisk followed
by an extension, as in <tt>"*.pdf"</tt>, for instance), a file dialog will be opened
that allows the user to select or enter the actual file name.
<p>
If the file name is only an extension, as in <tt>".pdf"</tt>, the output file name
will be the same as the drawing file name, with the extension changed to the given
string.
<p>
The file name may contain one or more of the following placeholders, which
will be replaced with the respective string:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>%E</tt>     </td><td width=20><td>the loaded file's extension (without the <tt>'.'</tt>)</td></tr>
<tr><td><tt>%N</tt>     </td><td width=20><td>the loaded file's name (without path and extension)</td></tr>
<tr><td><tt>%P</tt>     </td><td width=20><td>the loaded file's directory path (without file name)</td></tr>
<tr><td><tt>%%</tt>     </td><td width=20><td>the character <tt>'%'</tt></td></tr>
</table>
<p>
For example, the file name
<p>
<tt>%N.cmp.pdf</tt>
<p>
would create <tt><i>boardname</i>.cmp.pdf</tt>.
<p>
If both the <tt>FILE</tt> and the <tt>PRINTER</tt> option are present, only the last one
given will be taken into account
<h2>Printing to a given paper size</h2>
The <tt>PAPER</tt> option defines the size of the paper to print on.
It must be immediately followed by one of the paper size names listed in
the <i>Paper</i> combo box of the PRINT dialog, like <tt>A4</tt>, <tt>Letter</tt> etc.
If a custom paper size shall be set, it has to be given in the format
<pre>
Width x Height Unit
</pre>
(without blanks), as in
<pre>
PRINT PAPER 200x300mm
PRINT PAPER 8.0x11.5inch
</pre>
<i>Width</i> and <i>Height</i> can be floating point numbers, and the <i>Unit</i>
may be either <tt>mm</tt> or <tt>inch</tt> (the latter may be abbreviated as <tt>in</tt>).
Paper names must be given in full, and are case insensitive.
If both the <tt>PRINTER</tt> and <tt>PAPER</tt> option are used, the <tt>PRINTER</tt>
option must be given first.
Custom paper sizes may not work with all printers. They are mainly for use
with Postscript or PDF output.
<h2>Printing a range of sheets</h2>
The <tt>SHEETS</tt> option can be used to print a range of sheets from a schematic.
The range is given as two numbers, delimited by a <tt>'-'</tt>, as in <tt>2-15</tt>.
Without this option, only the currently edited sheet is printed.
To print all sheets, the range <tt>ALL</tt> can be used (which is case insensitive,
but must be written in full).
A range can also consist of just a single number, as in <tt>42</tt>, which will
print exactly that sheet.
If no schematic is loaded, this option has no meaning.
<h2>Examples</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PRINT</tt>     </td><td width=20><td>opens the <a href=#110>print dialog</a> in which you can set print options</td></tr>
<tr><td><tt>PRINT;</tt>    </td><td width=20><td>immediately prints the drawing with the default options</td></tr>
<tr><td><tt>PRINT - MIRROR BLACK SOLID;</tt>  </td><td width=20><td>prints the drawing mirrored, with everything in black and solid</td></tr>
<tr><td><tt>PRINT 2.5 -1;</tt>              </td><td width=20><td>prints the drawing enlarged by a factor of 2.5, but makes sure that it does not exceed <b>one</b> page</td></tr>
<tr><td><tt>PRINT FILE .pdf;</tt>           </td><td width=20><td>prints the drawing into a PDF file with the same name as the drawing file</td></tr>
<tr><td><tt>PRINT SHEETS 2-15 FILE .pdf;</tt> </td><td width=20><td>prints the sheets 2 through 15 into a PDF file with the same name as the drawing file</td></tr>
</table>


<a name=80>
<h1>QUIT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Quits the program
<dt>
<b>Syntax</b>
<dd>
<tt>QUIT</tt>
</dl>
This command ends the editing session. If any changes have been made
but the drawing has not yet been saved, a popup menu will ask you
if you want to save the drawing/library first.
<p>
You can also exit from EAGLE at any time by pressing <tt>Alt+X</tt>.


<a name=81>
<h1>RATSNEST</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Calculates the shortest possible airwires and polygons.
<dt>
<b>Syntax</b>
<dd>
<tt>RATSNEST</tt><br>
<tt>RATSNEST signal_name ..</tt><br>
<tt>RATSNEST ! signal_name ..</tt>
</dl>
<b>See also</b> <a href=#94>SIGNAL</a>,
<a href=#67>MOVE</a>,
<a href=#77>POLYGON</a>,
<a href=#87>RIPUP</a>
<p>
The RATSNEST command assesses the airwire connections in order
to achieve the shortest possible paths, for instance, after components
have been moved. After reading a netlist via the
<a href=#91>SCRIPT</a>
command, it is also useful to use the RATSNEST command to optimize the
length of airwires.
<p>
The RATSNEST command also calculates all polygons belonging to a
signal. This is necessary in order to avoid the calculation of
airwires for pads already connected through polygons. All of the calculated
polygon areas are then being displayed in the "real mode".
You can switch back to the faster
"outline mode" with the RIPUP command.<br>
The automatic calculation of the polygons can be turned off with
<pre>
<a href=#92>SET</a> POLYGON_RATSNEST OFF;
</pre>
RATSNEST ignores airwires representing signals which have
their own layer in a multilayer board (e.g. layer $GND for signal
GND), apart from signals connecting smd pads to a supply layer with
a via-hole.
<p>
Note that RATSNEST doesn't mark the board drawing as modified, since the
calculated polygon data (if any) is not stored in the board, and the
recalculated airwires don't really constitute a modification of the drawing.
<h2>Zero length airwires</h2>
If two or more wires of the same signal on different routing layers end
at the same point without being connected through a pad or a via, a
<i>zero length airwire</i> is generated, which will be displayed
as an X-shaped cross in the Unrouted layer. The same applies to smds that
belong to the same signal and are placed on opposite sides of the board.
<p>
Such <i>zero length airwires</i> can be picked up with the
<a href=#89>ROUTE</a> command just like ordinary airwires.
They may also be handled by placing a <a href=#104>VIA</a>
at that point.
<h2>Making sure everything has been routed</h2>
If there is nothing left to be routed, the RATSNEST command will respond
with the message
<pre>
Ratsnest: Nothing to do!
</pre>
Otherwise, if there are still airwires that have not been routed, the
message
<pre>
Ratsnest: xx airwires.
</pre>
will be displayed, where <tt>xx</tt> gives the number of unrouted airwires.
<h2>Wildcards</h2>
If a <tt>signal_name</tt> parameter is given, the characters <tt>'*'</tt>, <tt>'?'</tt>
and <tt>'[]'</tt> are <i>wildcards</i> and have the following meaning:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>*</tt>    </td><td width=20><td>matches any number of any characters</td></tr>
<tr><td><tt>?</tt>    </td><td width=20><td>matches exactly one character</td></tr>
<tr><td><tt>[...]</tt></td><td width=20><td>matches any of the characters between the brackets</td></tr>
</table>
<p>
If any of these characters shall be matched exactly as such, it has to be enclosed
in brackets. For example, <tt>abc[*]ghi</tt> would match <tt>abc*ghi</tt> and not
<tt>abcdefghi</tt>.
<p>
A range of characters can be given as <tt>[a-z]</tt>, which results in any character
in the range <tt>'a'</tt>...<tt>'z'</tt>.
<h2>Hiding selected airwires</h2>
Sometimes it may be useful to hide the airwires of selected signals, for instance
if these will later be connected through a polygon. Typically this could be supply
signals, which have a lot of airwires that will never be routed explicitly and
just obscure the other signals' airwires.
<p>
To hide airwires the RATSNEST command can be given the exclamation mark (<tt>'!'</tt>),
followed by a list of signals, as in
<pre>
RATSNEST ! GND VCC
</pre>
which would hide the airwires of the signals <tt>GND</tt> and <tt>VCC</tt>.<br>
To have the airwires displayed again just enter the RATSNEST command without the
<tt>'!'</tt> character, and the list of signals:
<pre>
RATSNEST GND VCC
</pre>
This will activate the display of the airwires of the signals <tt>GND</tt> and <tt>VCC</tt>
and also recalculates them. You can also recalculate the airwires (and polygons) of
particular signals this way.
<p>
The signal names may contain wildcards, and the two variants may be combined, as in
<pre>
RATSNEST D* ! ?GND VCC
</pre>
which would recalculate and display the airwires of all signals with names beginning
with <tt>'D'</tt>, and hide the airwires of all the various GND signals (like AGND, DGND etc.)
and the VCC signal. Note that the command is processed from left to right, so in case
there is a DGND signal the example would first process it for display, but then
hide its airwires.
<p>
To make sure all airwires are displayed enter
<pre>
RATSNEST *
</pre>
Note that the <a href=#94>SIGNAL</a> command will automatically
make the airwires of a signal visible if a new airwire is created for that signal.
The <a href=#87>RIPUP</a> command on the other hand will not change
the state of hiding airwires if a wire of a signal is changed into an airwire.


<a name=82>
<h1>RECT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds rectangles to a drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>RECT [orientation] &#149; &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.
</dl>
<b>See also</b> <a href=#37>CIRCLE</a>
<p>
The RECT command is used to add rectangles to a drawing. The two points
define two opposite corners of the rectangle. Pressing the center
mouse button changes the layer to which the rectangle is to be added.
<p>
The <tt>orientation</tt> (see description in <a href=#29>ADD</a>)
may be any angle in the range <tt>R0</tt>...<tt>R359.9</tt>. The <tt>S</tt>
and <tt>M</tt> flags can't be used here.
Note that the coordinates are always defined at an orientation of <tt>R0</tt>.
The possibility of entering an <tt>orientation</tt> in the RECT command is
mainly for use in scripts, where the rectangle data may have been derived
through a User Language Program from the <a href=#200>UL_RECTANGLE</a>
object. When entering a non-zero orientation interactively, the corners of
the rectangle may not appear at the actual cursor position.
Use the <a href=#88>ROTATE</a> command to interactively rotate
a rectangle.
<h2>Not Part of Signals</h2>
Rectangles in the signal layers Top, Bottom, or Route2...15 don't
belong to signals. Therefore the DRC reports errors if they overlap
with wires, pads etc.
<h2>Restricted Areas</h2>
If used in the layers tRestrict, bRestrict, or vRestrict, the RECT
command defines restricted areas for the Autorouter.


<a name=83>
<h1>REDO</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Executes a command that was reversed by UNDO.
<dt>
<b>Syntax</b>
<dd>
<tt>REDO;</tt>
<dt>
<b>Keyboard</b>
<dd>
<tt>F10:          REDO</tt>   execute the REDO command.<br>
<tt>Shift+Alt+BS: REDO</tt>
</dl>
<b>See also</b> <a href=#100>UNDO</a>,
<a href=#354>Forward&amp;Back Annotation</a>
<p>
In EAGLE it is possible to reverse previous actions with the UNDO
command. These actions can be executed again by the REDO command.
UNDO and REDO operate with a command memory which exists back to the
last EDIT, OPEN, AUTO or REMOVE command.
<p>
UNDO/REDO is completely integrated within Forward&amp;Back Annotation.


<a name=84>
<h1>REMOVE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Deletes files, devices, symbols, packages, and sheets.
<dt>
<b>Syntax</b>
<dd>
<tt>REMOVE name</tt><br>
<tt>REMOVE name.Sxx</tt>
</dl>
<b>See also</b> <a href=#70>OPEN</a>,
<a href=#85>RENAME</a>
<h2>Files</h2>
The REMOVE command is used to delete the file <tt>name</tt> if in
board or schematic editing mode.
<h2>Devices, Symbols, Packages</h2>
The REMOVE command is used to delete the device, symbol or package
"name" from the presently opened library.
The name may include an extension (for example REMOVE name.pac). If the name is given without
extension, you have to be in the respective mode to remove an object
(i.e. editing a package if you want to remove packages).
<p>
Symbols and packages can be erased from a library only
if not used by a device.
<h2>Sheets</h2>
The REMOVE command may also be used to delete a sheet from a schematic.
The name of the presently loaded schematic can be omitted.
The parameter xx represents the sheet number, for example:
<pre>
REMOVE .S3
</pre>
deletes sheet number 3 from the presently loaded schematic.
<p>
If you delete the currently loaded sheet, sheet number 1 will be loaded
after the command has been executed. All sheets with a higher number
than the one deleted will get a number reduced by one.
<p>
UNDO does not work with this command. If you have deleted a sheet
accidentally it will be present in the "old" schematic file
as long as the "new" file has not been saved.
<p>
REMOVE clears the UNDO buffer.


<a name=85>
<h1>RENAME</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Renames symbols, devices or packages.
<dt>
<b>Syntax</b>
<dd>
<tt>RENAME old_name new_name;</tt>
</dl>
<b>See also</b> <a href=#70>OPEN</a>
<p>
The RENAME command is used to change the name of a symbol, device
or package. The appropriate library must have been opened by the OPEN
command before.
<p>
The names may include extensions (for example RENAME name1.pac name2[.pac] - note that the
extension is optional in the second parameter). If the first parameter
is given without extension, you have to be in the respective mode to
rename an object (i.e. editing a package if you want to rename packages).
<p>
RENAME clears the UNDO buffer.


<a name=86>
<h1>REPLACE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Replace a part.
<dt>
<b>Syntax</b>
<dd>
<tt>REPLACE &#149;..</tt><br>
<tt>REPLACE device_name &#149;..</tt><br>
<tt>REPLACE part_name device_name ..</tt><br>
<tt>REPLACE package_name &#149;..</tt><br>
<tt>REPLACE element_name package_name ..</tt>
</dl>
<b>See also</b> <a href=#92>SET</a>,
<a href=#101>UPDATE</a>
<p>
The REPLACE command can be used to replace a part with a different
device (even from a different library). The old and new device must
be compatible, which means that their used gates and connected pins/pads must
match, either by their names or their coordinates.
<p>
Without parameters the REPLACE command opens a dialog from which a device
can be selected from all libraries that are currently in <a href=#102>use</a>.
After such a device has been selected, subsequent mouse clicks on parts
will replace those parts' devices with the selected one if possible.
<p>
If a <tt>device_name</tt> is given, that device will be used for the replace
operation.
<p>
With both a <tt>part_name</tt> and a <tt>device_name</tt>, the device of
the given part will be replaced (this is useful when working with scripts).
<p>
If only a board is being edited (without a schematic), or if elements in the
board are being replaced that have no matching part in the schematic,
the REPLACE command has two different modes that are chosen by the
SET command.
<p>
The first mode (default) is activated by the command:
<pre>
SET REPLACE_SAME NAMES;
</pre>
In this mode the new package must have the same pad and smd names
as the old one. It may be taken from a different library and it may
contain additional pads and smds. The position of pads
and smds is irrelevant.
<p>
The second mode is activated by the command
<pre>
SET REPLACE_SAME COORDS;
</pre>
In this mode, pads and smds of the new package must
be placed at the same coordinates as in the old one (relative to the
origin). Pad and smd names may be different. The new package may be
taken from a different library and may contain additional pads and
smds.
<p>
Pads of the old package connected with signals must be present in the
new package. If this condition is true the new package may have less
pads than the old one.
<p>
REPLACE functions only when the appropriate tOrigins/bOrigins
layer is displayed.
<p>
If there is already a package with the same name (from the same library) in the drawing,
and the library has been modified after the original object was added, an automatic
<a href=#101>library update</a> will be started and you will be asked whether
objects in the drawing shall be replaced with their new versions.
<p>
<b>Note: A REPLACE operation automatically updates all involved library objects
as necessary. This means that other parts (on other schematic sheets or in
other locations on the board) may be changed, too.
You should always run a <a href=#46>Design Rule Check</a> (DRC) and an
<a href=#48>Electrical Rule Check</a> (ERC) after a REPLACE operation!</b>


<a name=87>
<h1>RIPUP</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Changes routed wires and vias into airwires.<br>
Changes the display of polygons to "outlines".
<dt>
<b>Syntax</b>
<dd>
<tt>RIPUP;</tt><br>
<tt>RIPUP [ @ ] [ ! ] &#149;..</tt><br>
<tt>RIPUP [ @ ] [ ! ] signal_name..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Right</mb> rips up the group.
</dl>
<b>See also</b> <a href=#43>DELETE</a>,
<a href=#54>GROUP</a>,
<a href=#77>POLYGON</a>,
<a href=#81>RATSNEST</a>
<p>
The RIPUP command changes routed wires (tracks) into airwires. That
can be done for:
<ul>
<li>all signals (RIPUP;)
<li>all signals except certain ones (e.g. RIPUP ! GND VCC;)
<li>one or more signals (e.g. RIPUP D0 D1 D2;)
<li>certain segments (chosen with one or more mouse clicks)
<li>all polygons (RIPUP @;)
<li>all polygons of certain signals (e.g. RIPUP @ GND VCC;)
<li>all polygons except those of certain signals (e.g. RIPUP @ ! GND VCC;)
</ul>
Selecting an airwire with RIPUP converts all adjacent routed wires and vias
into airwires, up to the next pad, smd or airwire.
<pre>
RIPUP signal_name..
</pre>
rips up the complete signal "signal_name" (several signals may be
listed, e.g. <tt>RIPUP D0 D1 D2;</tt>).
<pre>
RIPUP &#149;..
</pre>
rips up segments selected by the mouse click up to the next pad/smd.
<pre>
RIPUP;
</pre>
removes only signals which are connected to elements
(e.g. board crop marks are not affected). The same applies if RIPUP
is used on a group.
<p>
<b>Note:</b> in all cases the RIPUP command only acts on objects that
are in layers that are currently visible!
<h2>Wildcards</h2>
If a <tt>signal_name</tt> parameter is given, the characters <tt>'*'</tt>, <tt>'?'</tt>
and <tt>'[]'</tt> are <i>wildcards</i> and have the following meaning:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>*</tt>    </td><td width=20><td>matches any number of any characters</td></tr>
<tr><td><tt>?</tt>    </td><td width=20><td>matches exactly one character</td></tr>
<tr><td><tt>[...]</tt></td><td width=20><td>matches any of the characters between the brackets</td></tr>
</table>
<p>
If any of these characters shall be matched exactly as such, it has to be enclosed
in brackets. For example, <tt>abc[*]ghi</tt> would match <tt>abc*ghi</tt> and not
<tt>abcdefghi</tt>.
<p>
A range of characters can be given as <tt>[a-z]</tt>, which results in any character
in the range <tt>'a'</tt>...<tt>'z'</tt>.
<h2>Polygons</h2>
If the RIPUP command with a name is applied to a signal which contains a polygon
the polygon will be displayed with its outlines (faster screen
redraw!). Use the <a href=#81>RATSNEST</a> command to have polygons
displayed in the "real mode" again.


<a name=88>
<h1>ROTATE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Rotates objects.
<dt>
<b>Syntax</b>
<dd>
<tt>ROTATE orientation &#149;..</tt><br>
<tt>ROTATE orientation name..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Right</mb> rotates the group.<br>
<mb>Left&amp;Drag</mb> rotates the object by any angle.<br>
<mb>Ctrl+Right&amp;Drag</mb> rotates the group by any angle.
</dl>
<b>See also</b> <a href=#29>ADD</a>,
<a href=#65>MIRROR</a>,
<a href=#67>MOVE</a>,
<a href=#62>LOCK</a>,
<a href=#54>GROUP</a>
<p>
The ROTATE command is used to change the orientation of objects.
<p>
If <tt>orientation</tt> (see description in <a href=#29>ADD</a>) is given,
that value will be added to the orientation of the selected object instead.
<p>
Prepending <tt>orientation</tt> with the character <tt>'='</tt> causes the value
not to be added, but instead to be set absolutely.
<p>
Parts, pads, smds and pins can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area.
For example
<p>
<pre>
ROTATE =MR90 IC1
</pre>
<p>
would set the orientation of element IC1 to MR90, regardless of its previous setting.
<p>
Attributes of parts can be selected by entering the concatenation of
part name and attribute name, as in <tt>R5&gt;VALUE</tt>.
<p>
If <tt>element_name</tt> could be mistaken as an orientation parameter
you need to quote that name, as in
<p>
<pre>
ROTATE R45 'R1'
</pre>
<p>
You can use Click&amp;Drag to rotate an object by any angle.
Just click on the object and move the mouse (with the mouse
button held down) away from the object. After having moved the mouse a
short distance, the object will start rotating. Move the mouse until the
desired angle has been reached and then release the mouse button. If, at
some point, you decide to rather not rotate the object, you can press the
ESCape key while still holding the mouse button pressed.
The same operation can be applied to a group by using the right mouse button.
The group will be rotated around the point where the right mouse button has
been pressed down.
<p>
Parts cannot be rotated if they are <a href=#62>locked</a>,
or if any of their connected pads would extend outside the allowed area
(in case you are using a <a href=#360>limited edition</a> of EAGLE).
<h2>Elements</h2>
When rotating an element, wires (tracks) connected to the element are
moved at the connection points (beware of short circuits!).
<p>
Elements can only be rotated if the appropriate tOrigins/bOrigins
layer is visible.
<h2>Text</h2>
Text is always displayed so that it can be read from the bottom
or from the right - even when rotated. Therefore after every
two rotations it appears the same way, but the origin has moved from
the lower left to the upper right corner. Remember this if a text
appears to be unselectable!
<p>
If you want to have text that is printed "upside down", you can set the "Spin"
flag for that text.


<a name=89>
<h1>ROUTE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Converts unrouted connections into routed wires (tracks).
<dt>
<b>Syntax</b>
<dd>
<tt>ROUTE [width] &#149; [curve | @radius] &#149;..</tt><br>
<tt>ROUTE name ..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Left</mb> starts routing at any given point along a wire or via.<br>
<mb>Shift+Left</mb> starts routing with the same width as an existing wire.<br>
<mb>Center</mb> selects the layer.<br>
<mb>Right</mb> changes the wire bend style (see <a href=#92>SET Wire_Bend</a>).<br>
<mb>Shift+Right</mb> reverses the direction of switching bend styles.<br>
<mb>Ctrl+Right</mb> toggles between corresponding bend styles.<br>
<mb>Shift+Left</mb> places a via at the end point.<br>
<mb>Ctrl+Left</mb> when placing a wire end point defines arc radius.
</dl>
<b>See also</b> <a href=#33>AUTO</a>,
<a href=#100>UNDO</a>,
<a href=#106>WIRE</a>,
<a href=#66>MITER</a>,
<a href=#94>SIGNAL</a>,
<a href=#92>SET</a>,
<a href=#81>RATSNEST</a>
<p>
The ROUTE command activates the manual router which allows you to
convert airwires (unrouted connections) into real wires.
<p>
The first point selects an unrouted connection (a wire
in the Unrouted layer) and replaces one end of it by a wire (track).
The end which is closer to the mouse cursor will be taken. Now the
wire can be moved around (see also <a href=#106>WIRE</a>).
The right mouse button will change the wire bend and the center mouse
button will change the layer.
Please note that only those signal layers (1 through 16) are available
that have been entered into the layer setup in the <a href=#133>Design Rules</a>.
<p>
When the final position of the wire
is reached, a further click of the left mouse button will place the
wire and a new wire segment will be attached to the cursor.
If the <tt>Shift</tt> key is held down in such a situation, a Via will
be generated at that point if this is possible and the airwire hasn't already
been completely routed. The generated Via will have either the appropriate
length or, if such a length can't be determined, will go from layer 1 through 16.
<p>
When the layer has been changed and a via-hole is thus necessary,
it will be added automatically as the wire is placed. When the complete
connection has been routed a 'beep' will be given and the next unrouted
connection can be selected for routing.
<p>
Only the minimum necessary vias will be set (according to the layer setup in the
<a href=#133>Design Rules</a>). It may happen that an already existing via of the same signal is
extended accordingly, or that existing vias are combined to form a longer via if
that's necessary to allow the desired layer change.
If a via is placed at the start or end point, and there is an SMD pad
at that location, the via will be a <i>micro via</i> if the current routing
layer is one layer away from the SMD's layer (this applies only if micro vias
have been enabled in the <a href=#133>Design Rules</a>).
<p>
While the ROUTE command is active the wire width can be entered
from the keyboard.
<p>
If the <i>curve</i> or <i>@radius</i> parameter is given, an arc can be drawn as part of the track
(see the detailed description in the <a href=#106>WIRE</a> command).
<p>
If the <tt>Ctrl</tt> key is pressed while selecting the starting point and there
is no airwire at that point, a new airwire will be created automatically. The starting
point of that airwire will be that point on the selected wire or via that is closest to
the mouse cursor (possibly snapped to the nearest grid point). The far end of the
airwire will dynamically point to a target segment that is different from the
selected one. If the selected signal is already completely routed, the far end will
point to the starting point instead.
If the selected wire is an arc, the airwire will start at the closest end point
of the wire.
<p>
If a <tt>name</tt> is given, the airwire of that signal that is closest
to the mouse cursor is selected. If <tt>name</tt> could be interpreted
as a <i>with</i>, <i>curve</i> or <i>@radius</i> it has to be written
in single quotes.
<h2>Selecting the routing layer and wire width</h2>
When you select an airwire, the initial layer in which to route is
determined by considering the objects at the starting point as follows:
<ul>
<li>if there is an object in the current layer, the current layer is kept
<li>else one of the layers of the objects at that point will be taken
</ul>
When selecting an airwire, the wire width for routing
will be that defined by the Design Rules and the net class of the selected signal
if the flag "Options/Set/Misc/Auto set route width and drill" is set.
You can select a different width wile the airwire is attached to the cursor, and
the track will be rerouted with the new width. The same applies to the via data.
<p>
When routing an airwire that starts at an already routed wire, the new
wire's width is automatically adjusted to that of the existing wire
if the <tt>Shift</tt> key is pressed when selecting the airwire.
<h2>Snap Function</h2>
The end point of the dynamically calculated airwire is always used as an
additional snap point, even if it is off grid. If the remaining airwire has
a length that is shorter than SNAP_LENGTH, the routed wire automatically
snaps to the airwire's end point, and stays there until the mouse pointer
is moved at least SNAP_LENGTH away from that point.
The minimum distance for this snap function can be defined with the command
<pre>
SET SNAP_LENGTH distance;
</pre>
where "distance" is the snap radius in the current grid unit.
<h2>Follow-me Router</h2>
With the special <a href=#92>wire bend styles</a> <tt>8</tt> and <tt>9</tt>,
the ROUTE command works as a "Follow-me" router. This means that the selected airwire
will be routed fully automatically by the <a href=#131>Autorouter</a>.
<p>
Wire bend style <tt>8</tt> routes only the shorter side of the selected airwire,
while <tt>9</tt> routes both sides. Once the automatic routing process is complete
(which may take a while, so be patient), the airwire will be replaced by the
actual routed wires and vias. If the routing couldn't be completed (for instance
due to Design Rules restrictions), the cursor changes into a "forbidden" sign.
With bend style <tt>9</tt> it is possible that only one side of the airwire can
be routed, while the other side can't.
<p>
Whenever the mouse is moved, any previous result is discarded and a new calculation
is started. Once the result is acceptable, just click the left mouse button to
place it.
<p>
The Follow-me router works by marking the grid point at the current mouse position
as a starting point, and uses the Autorouter to find a path from that point to any
point along the signal segment at which the selected airwire ends (which is not
necessarily the exact end point of the airwire). The starting point also considers
the currently selected layer, so don't be surprised if the router places a via
at that point. By changing the current layer you can influence the routing result.
<p>
The routing grid is taken from the actual grid setting at the time the airwire
is selected.
<p>
The routing parameters (like cost factors, preferred directions etc.) are those defined
in the dialog of the <a href=#33>AUTO</a> command.
<p>
The following particularities apply:
<ul>
<li>The Follow-me router doesn't calculate the polygons. If you want them to be
    calculated, run the <a href=#81>RATSNEST</a> command first.
<li>Since the starting point has to be part of the routed track, the result may
    be a T-shaped connection, with an unnecessary wire reaching to the starting
    point. Simply move the mouse cursor towards the actual connection to avoid this.
<li>Both ends of the airwire are routed separately in bend style <tt>9</tt>, which
    may lead to wires and/or vias overlapping each other. Move the mouse cursor
    until such unwanted effects go away.
<li>Depending on the selected routing layer for the start point it may happen that
    unnecessary vias are created. Select a different routing layer to avoid this.
<li>If the maximum number of allowed vias is set to <tt>0</tt> in the Follow-me
    router parameters, and you change the layer while an airwire is attached to
    the mouse cursor, the router may place a via at the starting point of the
    short end of the selected airwire (if this is at all possible according to
    the Design Rules, restricted areas etc.).
<li>When in Follow-me mode, the right mouse button toggles between routing only the
    shorter end of the selected airwire, or both ends. To get back to manual routing
    you need to click on one of the bend style buttons, or enter the
    <a href=#92>SET Wire_Bend</a> command with a value smaller than <tt>8</tt>.
<li>The Follow-me router can only place round or octagonal shaped Vias, not square ones.
<li>The Miter parameter has no meaning in Follow-me mode.
<li>The parameters for the Follow-me router are stored together with the rest of
    the Autorouter parameters, but in a separate section. This is because basically
    the Follow-me parameters should behave like those of the "Route" section in the
    Autorouter parameters (in order to not obscure too much area), but also might
    have a tendency towards those of the optimize sections.
<li>If a board file containing Autorouter parameters is saved with this version of
    EAGLE and loaded into an older version, the Autorouter parameters may be
    reported as invalid by the older version, and it will use default values.
    You can save the Autorouter parameters into a *.ctl file and explicitly load
    them into the older version if necessary.
<li>The special mouse key functions
    <mb>Ctrl+Left</mb> (start routing at any given point along a wire or via),
    <mb>Shift+Left</mb> (place a via at the end point) and
    <mb>Ctrl+Left</mb> (define arc radius) don't work in Follow-me mode.
</ul>


<a name=90>
<h1>RUN</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Executes a <a href=#138>User Language</a> Program.
<dt>
<b>Syntax</b>
<dd>
<tt>RUN file_name [argument ...]</tt>
</dl>
<b>See also</b> <a href=#91>SCRIPT</a>
<p>
The RUN command starts the User Language Program from the file <tt>file_name</tt>.<br>
The optional <tt>argument</tt> list is available to the ULP through the
<a href=#242>Builtin Variables</a> <tt>argc</tt> and <tt>argv</tt>.
<h2>Running a ULP from a script file</h2>
If a ULP is executed from a script file and the program returns an integer value
other than <tt>0</tt> (either because it has been terminated through a
call to the <tt><a href=#262>exit()</a></tt> function or because
the STOP button was clicked), execution of the script file will be terminated.
<h2>Editor commands resulting from running a ULP</h2>
A ULP can also use the <tt><a href=#262>exit()</a></tt> function with a <tt>string</tt>
parameter to send a command string back to the editor window.


<a name=91>
<h1>SCRIPT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Executes a command file.
<dt>
<b>Syntax</b>
<dd>
<tt>SCRIPT file_name;</tt>
</dl>
<b>See also</b> <a href=#92>SET</a>,
<a href=#64>MENU</a>,
<a href=#31>ASSIGN</a>,
<a href=#50>EXPORT</a>,
<a href=#90>RUN</a>
<p>
The SCRIPT command is used to execute sequences of commands that are
stored in a script file. If SCRIPT is typed in at the keyboard and "file_name"
has no extension, the program automatically uses ".scr".
<h2>Examples</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>SCRIPT nofill</tt>     </td><td width=20><td>executes nofill.scr</td></tr>
<tr><td><tt>SCRIPT myscr.</tt>     </td><td width=20><td>executes myscr (no Suffix)</td></tr>
<tr><td><tt>SCRIPT myscr.old</tt>  </td><td width=20><td>executes myscr.old</td></tr>
</table>
<p>
Please refer to the EXPORT command for different possibilities
of script files.
<p>
If the SCRIPT command is selected with the mouse, a popup menu will
show all of the files which have the extension ".scr" so that
they can be selected and executed.
<p>
The SCRIPT command provides the ability to customize
the program according to your own wishes. For instance:
<ul>
<li>change the command menu
<li>assign keys
<li>load pc board shapes
<li>change colors
</ul>
SCRIPT files contain EAGLE commands according to the syntax rules.
Lines beginning with <tt>'#'</tt> are comment.
<h2>Continued Lines</h2>
SCRIPT files contain one or more commands in every line according
to the syntax rules. The character '\' at the end of a command line ensures
that the first word of the next line is not interpreted as a command.
This feature allows you to avoid apostrophes in many cases.
<h2>Set Default Parameters</h2>
The SCRIPT file eagle.scr - if it exists in the project
directory or in the <a href=#14>script path</a> - is executed each time
a new drawing is loaded into an editor window (or when the drawing type is changed
in a library).
<h2>Execute Script Files in the Library Editor</h2>
All of the layers are recognized only if the library editor has previously been loaded.


<a name=92>
<h1>SET</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Alters system parameters
<dt>
<b>Syntax</b>
<dd>
<tt>SET</tt><br>
<tt>SET options;</tt>
</dl>
Parameters which affect the behavior of the program, the screen display, or the user interface can be specified with the SET command. The precise syntax is described below.
<p>
A dialog in which all the parameters can be set appears if the SET command is entered without parameters.
<h2>User Interface</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Snap function            </td><td width=20><td><tt>SET SNAP_LENGTH number;</tt></td></tr>
<tr><td>                         </td><td width=20><td>This sets the limiting value for the snap function in the <a href=#89>ROUTE</a> command (using the current unit).</td></tr>
<tr><td>                         </td><td width=20><td>Default: 20 mil</td></tr>
<tr><td>                         </td><td width=20><td>If tracks are being laid with the <a href=#89>ROUTE</a> command to pads that are not on the grid, the snap function will ensure that a route will be laid to the pad within the snap-length.</td></tr>
<tr><td>                         </td><td width=20><td><tt>SET CATCH_FACTOR value;</tt></td></tr>
<tr><td>                         </td><td width=20><td>Defines the distance from the cursor up to which objects are taken into account when clicking with the mouse. The value is entered relative to the height (or width, whichever is smaller) of the presently visible part of the drawing. It applies to a zoom level that displays at least a range of 4 inch and inrceases logarithmically when zooming further in. A value of 0 turns this limitation off.<br>Default: 0.05 (5%).</td></tr>
<tr><td>                         </td><td width=20><td><tt>SET SELECT_FACTOR value;</tt></td></tr>
<tr><td>                         </td><td width=20><td>This setting controls the distance from the cursor within which nearby objects will be suggested for <a href=#20>selection</a>. The value is entered relative to the height (or width, whichever is smaller) of the presently visible part of the drawing.<br>Default: 0.02 (2%).</td></tr>
<tr><td>Menu contents            </td><td width=20><td><tt>SET USED_LAYERS name | number;</tt></td></tr>
<tr><td>                         </td><td width=20><td>Specifies the layers which will be shown in the associated EAGLE menus. See the example file <tt>mylayers.scr</tt>.</td></tr>
<tr><td>                         </td><td width=20><td>The layers Pads, Vias, Unrouted, Dimension, Drills and Holes will in any case remain in the menu, as will the schematic layers. Any used signal layers also remain in the menus. <tt>SET Used_Layers All</tt> activates all layers.</td></tr>
<tr><td>                         </td><td width=20><td><tt>SET WIDTH_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td><tt>SET DIAMETER_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td><tt>SET DRILL_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td><tt>SET SMD_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td><tt>SET SIZE_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td><tt>SET ISOLATE_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td><tt>SET SPACING_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td><tt>SET MITER_MENU value..;</tt></td></tr>
<tr><td>                         </td><td width=20><td>The content of the associated popup menus can be configured with the above command for the parameters <i>width</i> etc.. A maximum of 16 values is possible for each menu (16 value-pairs in the SMD menu). Without any values (as in <tt>SET WIDTH_MENU;</tt>) the program default values will be restored.</td></tr>
<tr><td>                         </td><td width=20><td>Example:<br><tt>Grid Inch;</tt><br><tt>Set Width_Menu 0.1 0.2 0.3;</tt></td></tr>
<tr><td>Bend angle for wires     </td><td width=20><td><tt>SET WIRE_BEND bend_nr;</tt></td></tr>
<tr><td>                         </td><td width=20><td><i>bend_nr</i> can be one of:</td></tr>
<tr><td>                         </td><td width=20><td><tt>0</tt>: Starting point - horizontal - vertical - end</td></tr>
<tr><td>                         </td><td width=20><td><tt>1</tt>: Starting point - horizontal - 45&deg; - end</td></tr>
<tr><td>                         </td><td width=20><td><tt>2</tt>: Starting point - end (straight connection)</td></tr>
<tr><td>                         </td><td width=20><td><tt>3</tt>: Starting point - 45&deg; - horizontal - end</td></tr>
<tr><td>                         </td><td width=20><td><tt>4</tt>: Starting point - vertical - horizontal - end</td></tr>
<tr><td>                         </td><td width=20><td><tt>5</tt>: Starting point - arc - horizontal - end</td></tr>
<tr><td>                         </td><td width=20><td><tt>6</tt>: Starting point - horizontal - arc - end</td></tr>
<tr><td>                         </td><td width=20><td><tt>7</tt>: "Freehand" (arc that fits to wire at start, straight otherwise)</td></tr>
<tr><td>                         </td><td width=20><td><tt>8</tt>: Route short end of airwire in <a href=#89>Follow-me router</a></td></tr>
<tr><td>                         </td><td width=20><td><tt>9</tt>: Route both ends of airwire in <a href=#89>Follow-me router</a></td></tr>
<tr><td>                         </td><td width=20><td>Note that <tt>0</tt>, <tt>1</tt>, <tt>3</tt> and <tt>4</tt> may contain additional miter wires (see <a href=#66>MITER</a>).</td></tr>
<tr><td>                         </td><td width=20><td><tt>SET WIRE_BEND @ bend_nr ...;</tt></td></tr>
<tr><td>                         </td><td width=20><td>Defines the bend angles that shall be actually used when switching with the right mouse button.</td></tr>
<tr><td>                         </td><td width=20><td><tt>SET WIRE_BEND @;</tt></td></tr>
<tr><td>                         </td><td width=20><td>Switches back to using all bend angles.</td></tr>
<tr><td>Beep on/off              </td><td width=20><td><tt>SET BEEP OFF | ON;</tt></td></tr>
</table>
<h2>Screen display</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Color for grid lines</td><td width=20><td><tt>SET COLOR_GRID color;</tt></td></tr>
<tr><td>Layer color              </td><td width=20><td><tt>SET COLOR_LAYER layer color;</tt></td></tr>
<tr><td>Fill pattern for layer   </td><td width=20><td><tt>SET FILL_LAYER layer fill;</tt></td></tr>
<tr><td>Grid parameters          </td><td width=20><td><tt>SET MIN_GRID_SIZE pixels;</tt></td></tr>
<tr><td>                         </td><td width=20><td>The grid is only displayed if the grid size is greater than the set number of pixels.</td></tr>
<tr><td>Min. text size shown     </td><td width=20><td><tt>SET MIN_TEXT_SIZE size;</tt></td></tr>
<tr><td>                         </td><td width=20><td>Text less than <tt>size</tt> pixels high is shown as a rectangle on the screen. The setting <tt>0</tt> means that all text will be displayed readably.</td></tr>
<tr><td>Net wire display         </td><td width=20><td><tt>SET NET_WIRE_WIDTH width;</tt></td></tr>
<tr><td>Pad display              </td><td width=20><td><tt>SET DISPLAY_MODE REAL | NODRILL;</tt></td></tr>
<tr><td>                         </td><td width=20><td>REAL: Pads are displayed as they will be plotted.<br>NODRILL: Pads are shown without drill hole.</td></tr>
<tr><td>                         </td><td width=20><td><tt>SET PAD_NAMES OFF | ON;</tt></td></tr>
<tr><td>                         </td><td width=20><td>Pad names are displayed/not displayed.</td></tr>
<tr><td>Bus line display         </td><td width=20><td><tt>SET BUS_WIRE_WIDTH width;</tt></td></tr>
<tr><td><a href=#46>DRC</a>-Parameter </td><td width=20><td><tt>SET DRC_FILL fill_name;</tt></td></tr>
<tr><td>Polygon calculation      </td><td width=20><td><tt>SET POLYGON_RATSNEST OFF | ON;</tt></td></tr>
<tr><td>                         </td><td width=20><td>See <a href=#77>POLYGON</a> command.</td></tr>
<tr><td>Vector font              </td><td width=20><td><tt>SET VECTOR_FONT OFF | ON;</tt></td></tr>
<tr><td>                         </td><td width=20><td>See <a href=#99>TEXT</a> command.</td></tr>
<tr><td>Cross-reference labels   </td><td width=20><td><tt>SET XREF_LABEL_FORMAT string;</tt></td></tr>
<tr><td>                         </td><td width=20><td>See <a href=#60>LABEL</a> command.</td></tr>
<tr><td>Part cross-references    </td><td width=20><td><tt>SET XREF_PART_FORMAT string;</tt></td></tr>
<tr><td>                         </td><td width=20><td>See <a href=#99>TEXT</a> command.</td></tr>
</table>
<h2>Mode parameters</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Package check            </td><td width=20><td><tt>SET CHECK_CONNECTS OFF | ON;</tt></td></tr>
<tr><td>                         </td><td width=20><td>The <a href=#29>ADD</a> command checks whether a pin has been connected to every pad (with <a href=#40>CONNECT</a>). This check can be switched off. Nevertheless, no board can be generated from a schematic if a device is found which does not have a package.</td></tr>
<tr><td><a href=#86>REPLACE</a> mode </td><td width=20><td><tt>SET REPLACE_SAME NAMES | COORDS;</tt></td></tr>
<tr><td><a href=#100>UNDO</a> buffer on/off </td><td width=20><td><tt>SET UNDO_LOG OFF | ON;</tt></td></tr>
<tr><td>Wire optim. on/off </td><td width=20><td><tt>SET OPTIMIZING OFF | ON;</tt></td></tr>
<tr><td>                         </td><td width=20><td>If set <i>on</i>, wires which lie in one line after a MOVE, ROUTE or SPLIT are subsumed into a single wire. See also <a href=#71>OPTIMIZE</a>.</td></tr>
</table>
<h2>Colors</h2>
There are three <i>palettes</i> for black, white and colored background,
respectively. Each palette has 64 color entries, which can be set to any
ARGB value. The palette entry number 0 is used as the background color
(in the "white" palette this entry cannot be modified, since this palette
will also be used for printing, where the background is always white).
<p>
The color palettes can be modified either through the dialog under
"Options/Set.../Colors" or by using the command
<pre>
SET PALETTE <i>index</i> <i>argb</i>
</pre>
where <i>index</i> is a number in the range 0..63 and <i>argb</i> is a hexadecimal
value defining the Alpha, Red, Green and Blue components of the color, like 0xFFFFFF00
(which would result in a bright yellow). The alpha component defines how "opaque"
the color is. A value of 0x00 means it is completely transparent (i.e. invisible),
while 0xFF means it is totally opaque.
The alpha component of the background color is always 0xFF.
Note that the ARGB value must begin with "0x", otherwise it would be taken as a
decimal number. You can use
<pre>
SET PALETTE BLACK|WHITE|COLORED
</pre>
to switch to the black, white or colored background palette, respectively.
Note that there will be no automatic window refresh after this command, so
you should do a WINDOW; command after this.
<p>
By default only the palette entries 0..15 are used and they contain the
colors listed below.
<p>
The palette entries are grouped into "normal" and "highlight" colors. There
are always 8 "normal" colors, followed by the corresponding 8 "highlight"
colors. So colors 0..7 are "normal" colors, 8..15 are their "highlight"
values, 16..23 are another 8 "normal" colors with 24..31 being their
"highlight" values and so on. The "highlight" colors are used to visualize
objects, for instance in the SHOW command.
<p>
<tt>Color</tt>, listed according to color numbers, which can be used instead of the color names. Used to specify colors:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>0       </td><td width=20><td>Black</td></tr>
<tr><td>1       </td><td width=20><td>Blue</td></tr>
<tr><td>2       </td><td width=20><td>Green</td></tr>
<tr><td>3       </td><td width=20><td>Cyan</td></tr>
<tr><td>4       </td><td width=20><td>Red</td></tr>
<tr><td>5       </td><td width=20><td>Magenta</td></tr>
<tr><td>6       </td><td width=20><td>Brown</td></tr>
<tr><td>7       </td><td width=20><td>LGray</td></tr>
<tr><td>8       </td><td width=20><td>DGray</td></tr>
<tr><td>9       </td><td width=20><td>LBlue</td></tr>
<tr><td>10      </td><td width=20><td>LGreen</td></tr>
<tr><td>11      </td><td width=20><td>LCyan</td></tr>
<tr><td>12      </td><td width=20><td>LRed</td></tr>
<tr><td>13      </td><td width=20><td>LMagenta</td></tr>
<tr><td>14      </td><td width=20><td>Yellow</td></tr>
<tr><td>15      </td><td width=20><td>White</td></tr>
</table>
<p>
<tt>Fill</tt> specifies the style with which wires and rectangles in a particular layer are to be filled. This parameter can also be replaced with the number at the beginning of each line:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>0       </td><td width=20><td>Empty</td></tr>
<tr><td>1       </td><td width=20><td>Solid</td></tr>
<tr><td>2       </td><td width=20><td>Line</td></tr>
<tr><td>3       </td><td width=20><td>LtSlash</td></tr>
<tr><td>4       </td><td width=20><td>Slash</td></tr>
<tr><td>5       </td><td width=20><td>BkSlash</td></tr>
<tr><td>6       </td><td width=20><td>LtBkSlash</td></tr>
<tr><td>7       </td><td width=20><td>Hatch</td></tr>
<tr><td>8       </td><td width=20><td>XHatch</td></tr>
<tr><td>9       </td><td width=20><td>Interleave</td></tr>
<tr><td>10      </td><td width=20><td>WideDot</td></tr>
<tr><td>11      </td><td width=20><td>CloseDot</td></tr>
<tr><td>12      </td><td width=20><td>Stipple1</td></tr>
<tr><td>13      </td><td width=20><td>Stipple2</td></tr>
<tr><td>14      </td><td width=20><td>Stipple3</td></tr>
<tr><td>15      </td><td width=20><td>Stipple4</td></tr>
</table>
<h2>EagleRc Parameters</h2>
Sometimes a small detail of functionality needs to be made adjustable, for
instance because some users absolutely need to have it work differently.
These parameters are not available in any dialogs, but can only be changed
through an entry in the eaglerc file. In order to make this easier, any
parameter that is not found amoung the keywords listed above will be looked
up in the eaglerc parameters and can thus be changed using the SET command.
Note that the parameter names must be written in full and exactly as
listed below (case sensitive). The parameter value is typically '0' or '1',
to turn the functionality 'off' or 'on', respectively. After changing any
of these parameters that influence the way the screen display is drawn, a
window refresh may be necessary.
<p>
<b>Example</b>
<pre>
SET Option.DrawUnprocessedPolygonEdgesContinuous 1;
</pre>
The following eaglerc parameters parameters are available:
<p>
<dl>
<dt><b>Cmd.Delete.WireJointsWithoutCtrl</b>
<dd>
If you insist on having the DELETE command delete wire joints
without pressing the Ctrl key, you can set this parameter to '1'.
<dt><b>Cmd.Wire.IgnoreCtrlForRadiusMode</b>
<dd>
If you don't like the special mode in wire drawing commands that allows
for the definition of an arc radius by pressing the Ctrl key when placing
the wire, you can set this parameter to '1'.
This will turn this feature off for all commands that draw wires.
<dt><b>ControlPanel.View.AutoOpenProjectFolder</b>
<dd>
The automatic opening of the project folder at program start (or when
activating a project by clicking on its gray button) can be disabled
by setting this parameter to '0'.
<dt><b>Erc.AllowUserOverrideConsistencyCheck</b>
<dd>
In order to handle board/schematic pairs that have only minor inconsistencies,
the user can enable a dialog that allows him to force the editor to
perform forward-/backannotation, even if the ERC detects that the files are
inconsistent. This can be done by setting this parameter to '1'.
<b>PLEASE NOTE THAT YOU ARE DOING THIS AT YOUR OWN RISK</b> - if the files get
corrupted in the process, there may be nothing anybody can do to recover
them. After all, the ERC <b>did</b> state that the files were inconsistent!
<dt><b>Interface.MouseButtonReleaseTimeout</b>
<dd>
The time (in milliseconds) within which a mouse button release that follows
a mouse button press on a button (like, for instance, toolbar buttons)
triggers the button's action, even if the mouse button release happened
outside the button's area. Default is 500, set this to 0 to turn off this
feature. If this parameter is 0 when the program is started, any change
to it will only take effect the next time the program is started.
<dt><b>Interface.PreferredUnit</b>
<dd>
When displaying a numerical value in dialog input fields, the units are determined
automatically, so that the representation with the least number of decimal
digits is chosen. This can be controlled by setting this parameter to
'0' for automatic unit determination (default),
'1' for imperial units, and
'2' for metric units.
<dt><b>Interface.UseCtrlForPanning</b>
<dd>
Panning is done by moving the mouse while holding the center mouse button
(or mouse wheel) down. In older versions this was done by pressing the Ctrl
key instead. If you want the old functionality back, you can set this
parameter to '1'.
Note, though, that the Ctrl key is now used for special functions in some
commands, so when using these special functions (like selecting an object
at its origin in MOVE) with this parameter enabled you may inadvertently
pan your draw window.
<dt><b>Option.DrawUnprocessedPolygonEdgesContinuous</b>
<dd>
If you don't like the way unprocessed polygons display their edges (as dotted lines),
you can set this parameter to '1'. The edges of unprocessed polygons will then be
displayed as continuous lines, as was the case before version 5 (however, they will
not be highlighted).
<dt><b>Option.LayerSequence</b>
<dd>
The internal layers are rendered in a sequence that mimics the actual layer
stack, so that the result looks useful even on printers and PDF or Postscript
files, where layers are not transparent. Sometimes user defined layers may need to
be rendered before internal layers instead of after them. This parameter can be
used to define the sequence in which layers are rendered. It consists of a string of
layer numbers or layer ranges, followed by an optional 't' or 'b'.
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>123</td> <td width=20><td>renders layer 123</td></tr>
<tr><td>123t</td><td width=20><td>renders layer 123 if the output is "viewed from top" (not mirrored)</td></tr>
<tr><td>123b</td><td width=20><td>renders layer 123 if the output is "viewed from bottom" (mirrored)</td></tr>
<tr><td>123-140</td><td width=20><td>renders layers 123 through 140 in the given sequence</td></tr>
<tr><td>140-123</td><td width=20><td>renders layers 140 through 123 in the given sequence</td></tr>
<tr><td>*</td><td width=20><td>inserts the default sequence of the internal layers</td></tr>
<tr><td>123b * 123t</td><td width=20><td>makes layer 123 always be rendered first</td></tr>
</table>
<dd>
Note that each layer is rendered only once, even if it is listed several times.
The default sequence of the internal layers is<br>
48t 49t 19t 47t 20t 46t 23 27 25 59 57 55 53 50 51 21 44t 45t 37 35 31 29 33 39 41 43t 18t 17t 1-16 17b 18b 43b 42 40 34 30 32 36 38 45b 44b 22 52 54 56 58 60 26 28 24 46b 20b 47b 19b 49b 48b 61-99.<br>
When viewed from top, the layer sequence is rendered from right to left, while
when viewed from bottom (mirrored) it is rendered from left to right. For instance,
layer 48 (Document) is entered as 48t and 48b to always have it rendered as the last one.
Layers 21 (tPlace) and 22 (bPlace), on the other hand, are listed only once, to have
them rendered at the proper place, depending on whether the output is mirrored or not.<br>
Any layers that are not explicitly mentioned in the layer sequence are rendered after
the given sequence in ascending order.
<dt><b>Option.RatsnestLimit</b>
<dd>
The RATSNEST command processes all points of a signal, even if that
signal is very complex (in previous versions it dropped wire end points
from processing if the total number of connection points exceeded 254).
This requires more memory when calculating the ratsnest. In case this
is a problem on your system, you can revert to the original method
by setting this parameter to '254'.  The value given
here is the number of connection points up to which all wire end points
will be taken into account and thus limits the amount of memory used
(processing will use up to the square of this value in bytes, so a value
of 1024 will limit the used memory to 1MB). A value of '0' means there is
no limit. A value of '1' will result in airwires being connected only to
pads, smds and vias.
<dt><b>Option.RepositionMouseCursorAfterContextMenu</b>
<dd>
Normally EAGLE doesn't automatically position the mouse cursor. However,
some users want the cursor to be repositioned to the point where it has been
before a context menu in the drawing editor was opened. Set this parameter to
'1' to get this functionality.
<dt><b>Option.ShowPartOrigins</b>
<dd>
The origins of parts in a schematic are indicated by small crosses.
Set this parameter to '0' to turn this off.
<dt><b>Option.ShowTextOrigins</b>
<dd>
The origins of texts are indicated by small crosses.
Set this parameter to '0' to turn this off.
<dt><b>Option.ToggleCtrlForGroupSelectionAndContextMenu</b>
<dd>
Since the context menu function on the right mouse button interferes
with the selection of groups as it was done before version 5, a group is
now selected with Ctrl plus right mouse button. If you want to have the old
method of selecting groups back, you can can set this parameter to '1'.
This will allow selecting groups with the right mouse button only and require
Ctrl plus right mouse button for context menus.
<dt><b>Sch.Cmd.Add.AlwaysUseDeviceNameAsValue</b>
<dd>
Some users always want to use the device name as part value, even if the
part needs a user supplied value. Those who want this can set this
parameter to '1'.
<dt><b>Warning.PartHasNoUserDefinableValue</b>
<dd>
If you don't want the warning message about a part not having a user
definable value, you can turn it off by setting this parameter to '0'.
<dt><b>Warning.SupplyPinAutoOverwriteGeneratedNetName</b>
<dd>
Some users don't want the warning message about a supply pin overwriting
a generated net name. Setting this option to '1' disables that warning.
</dl>


<a name=93>
<h1>SHOW</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Highlights objects.
<dt>
<b>Syntax</b>
<dd>
<tt>SHOW &#149;..</tt><br>
<tt>SHOW name..</tt><br>
<tt>SHOW @ name..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Left</mb> toggles the show state of the selected object.
</dl>
<b>See also</b> <a href=#57>INFO</a>
<p>
The SHOW command is used to highlight objects.
Details are listed in the status bar.
Complete signals and nets can be highlighted with the SHOW command.
If a bus is selected, all nets belonging to that bus will also be
highlighted.
<h2>Cross Probing</h2>
With active <a href=#354>Forward&amp;Back Annotation</a> an object
that is highlighted with the SHOW command in a board will also be
highlighted in the schematic, and vice versa.
<h2>Different Objects</h2>
If you select different objects with the SHOW command every single
object is highlighted separately.
You can select more than one object for highlighting by pressing the
Ctrl key when clicking on the objects. When you click on an object that
is already highlighted with the Ctrl key pressed, that object will
be displayed non-highlighted again.
<p>
If several names are entered in one line, all matching objects are
highlighted at the same time.
<h2>Small Objects</h2>
If the <tt>@</tt> character is given in the command line, a pointer rectangle
is drawn around the shown object. This is helpful in locating small objects that
wouldn't show up too well just through highlighting. If more than one object is
shown, the rectangle is drawn around all the objects. It may be necessary to
zoom out (or do a WINDOW FIT command) in order to see the pointer.
If an object with the literal name <tt>@</tt> shall be shown, the name must
be enclosed in single quotes.
<h2>Wildcards</h2>
If a <tt>name</tt> parameter is given, the characters <tt>'*'</tt>, <tt>'?'</tt>
and <tt>'[]'</tt> are <i>wildcards</i> and have the following meaning:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>*</tt>  </td><td width=20><td>matches any number of any characters</td></tr>
<tr><td><tt>?</tt>           </td><td width=20><td>matches exactly one character</td></tr>
<tr><td><tt>[...]</tt>       </td><td width=20><td>matches any of the characters between the brackets</td></tr>
</table>
<p>
If any of these characters shall be matched exactly as such, it has to be enclosed
in brackets. For example, <tt>abc[*]ghi</tt> would match <tt>abc*ghi</tt> and not
<tt>abcdefghi</tt>.
<p>
A range of characters can be given as <tt>[a-z]</tt>, which results in any character
in the range <tt>'a'</tt>...<tt>'z'</tt>.
<p>
The special pattern <tt>[number..number]</tt> forms a <a href=#35>bus name range</a>
and is therefore not treated as a wildcard pattern in a schematic.
<h2>Objects on different Sheets</h2>
If an object given by name is not found on the current schematic sheet, a dialog
is presented containing a list of sheets on which the object is found. If the object
is not found on any sheet, the sheet number is '-' in this list. Note that this
dialog only appears if any of the objects given by name (or wildcards) is not found
on the current sheet. If all given objects are found on the current sheet, no dialog
appears (even if some of the objects are also present on other sheets). Once the
dialog appears, it contains all objects found, even those on the current sheet.
<h2>Examples</h2>
<pre>
SHOW IC1
</pre>
IC1 is highlighted and remains highlighted until the SHOW command is ended
or a different name is entered.
<pre>
SHOW IC*
</pre>
Highlights all objects with names starting with "IC".


<a name=94>
<h1>SIGNAL</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines signals.
<dt>
<b>Syntax</b>
<dd>
<tt>SIGNAL &#149; &#149;..</tt><br>
<tt>SIGNAL signal_name &#149; &#149;..</tt><br>
<tt>SIGNAL signal_name element_name pad_name..;</tt>
</dl>
<b>See also</b> <a href=#33>AUTO</a>,
<a href=#89>ROUTE</a>,
<a href=#68>NAME</a>,
<a href=#38>CLASS</a>,
<a href=#106>WIRE</a>,
<a href=#81>RATSNEST</a>,
<a href=#50>EXPORT</a>
<p>
The SIGNAL command is used to define signals (connections between
the various packages). The user must define a minimum of two element_name/pad_name
pairs, as otherwise no airwire can be generated.
<h2>Mouse Input</h2>
To do that you select (with the mouse) the pads (or smds) of the elements
to be connected, step by step. EAGLE displays the part signals as airwires
in the Unrouted layer.
<p>
If input with signal_name the signal will be allocated the specified
name.
<h2>Text Input</h2>
Signals may also be defined completely by text input (via keyboard
or script file). The command
<pre>
SIGNAL GND IC1 7 IC2 7 IC3 7;
</pre>
connects pad 7 of IC1...3. In order to enter a whole netlist, a script
file may be generated, with the extension *.scr. This file
should include all of the necessary SIGNAL commands in the format shown
above.
<h2>On-line Check</h2>
If the SIGNAL command is used to connect pads (or smds) that already
belong to different signals, a popup menu will appear and ask the
user if he wants to connect the signals together, and which name the
signal should get.
<h2>Outlines data</h2>
The special signal name _OUTLINES_ gives a signal certain properties that
are used to generate <a href=#130>outlines data</a>.
This name should not be used otherwise.


<a name=95>
<h1>SMASH</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Separates text variables and attributes from parts or elements.
<dt>
<b>Syntax</b>
<dd>
<tt>SMASH &#149;..</tt><br>
<tt>SMASH name ..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Ctrl+Right</mb> smashes the group.<br>
<mb>Shift+Left</mb> reverses the text separation ("unsmashes" the part).<br>
<mb>Ctrl+Shift+Right</mb> reverses the text separation for the group.
</dl>
<b>See also</b> <a href=#68>NAME</a>,
<a href=#103>VALUE</a>,
<a href=#99>TEXT</a>,
<a href=#32>ATTRIBUTE</a>
<p>
The SMASH command is used with parts or elements in order to separate the text
parameters indicating name, value or attributes. The text may
then be placed in a new and more convenient location with the MOVE
command.
<p>
Parts and elements can also be selected by their name,
which is especially useful if the object is outside the currently shown
window area. Note that when selecting a multi-gate part in a schematic by name,
you will need to enter the full instance name, consisting of part
and gate name.
<p>
Use of the SMASH command allows the text to be treated like any other
text, e.g. CHANGE SIZE, ROTATE, etc., but the actual text may not
be changed.
<p>
A "smashed" element can be made "unsmashed" by clicking on it with the
<tt>Shift</tt> key pressed (and of course the SMASH command activated).


<a name=96>
<h1>SMD</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds smd pads to a package.
<dt>
<b>Syntax</b>
<dd>
<tt>SMD [x_width y_width] [-roundness] [orientation] [flags] ['name'] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.<br>
<mb>Right</mb> rotates the smd.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#73>PAD</a>,
<a href=#36>CHANGE</a>,
<a href=#68>NAME</a>,
<a href=#89>ROUTE</a>,
<a href=#133>Design Rules</a>
<p>
The SMD command is used to add pads for surface mount devices to a
package. When the SMD command is active, an smd symbol is attached
to the cursor. Pressing the left mouse button places an smd pad at
the current position.
Entering numbers changes the x- and y-width of the smd pad, which
can be up to 0.51602 inch (13.1 mm). These parameters
remain as defaults for successive SMD commands and can be changed
with the CHANGE command. Pressing
the center mouse button changes the layer onto which the smd pad will be drawn.
<p>
The <tt>orientation</tt> (see description in <a href=#29>ADD</a>)
may be any angle in the range <tt>R0</tt>...<tt>R359.9</tt>. The <tt>S</tt>
and <tt>M</tt> flags can't be used here.
<h2>Roundness</h2>
The <tt>roundness</tt> has to be entered as an integer number between
<tt>0</tt> and <tt>100</tt>, with a negative sign to distinguish it
from the width parameters. A value of <tt>0</tt> results in fully
rectangular smds, while a value of <tt>100</tt> makes the corners
of the smd fully round. The command
<pre>
SMD 50 50 -100 '1' &#149;
</pre>
for example would create a completely round smd named '1' at the given
mouseclick position. This can be used to create BGA (Ball Grid Array) pads.
<h2>Names</h2>
SMD names are generated automatically and may be modified with the
NAME command. Names may be included
in the SMD command if enclosed in single quotes.
<h2>Flags</h2>
The following <i>flags</i> can be used to control the appearance of an smd:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>NOSTOP</tt>  </td><td width=20><td>don't generate solder stop mask</td></tr>
<tr><td><tt>NOTHERMALS</tt>       </td><td width=20><td>don't generate thermals</td></tr>
<tr><td><tt>NOCREAM</tt>          </td><td width=20><td>don't generate cream mask</td></tr>
</table>
<p>
By default an smd automatically generates solder stop mask, cream mask and thermals as necessary.
However, in special cases it may be desirable to have particular smds not do this.
The above <tt>NO...</tt> flags can be used to suppress these features.<br>
A newly started SMD command resets all flags to their defaults. Once a flag is given
in the command line, it applies to all following smds placed within this SMD command.
<h2>Single Smds</h2>
Single smd pads in boards can only be used by defining
a package with one smd.
<h2>Alter Package</h2>
It is not possible to add or delete smds in packages which
are already used by a device, because this would change the pin/smd
allocation defined with the CONNECT command.


<a name=97>
<h1>SPLIT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Splits wires and polygon edges into segments.
<dt>
<b>Syntax</b>
<dd>
<tt>SPLIT &#149; [curve | @radius] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Right</mb> changes the wire bend style (see <a href=#92>SET Wire_Bend</a>).<br>
<mb>Shift+Right</mb> reverses the direction of switching bend styles.<br>
<mb>Ctrl+Right</mb> toggles between corresponding bend styles.<br>
<mb>Ctrl+Left</mb> when placing a wire end point defines arc radius.
<dt>
<b>Keyboard</b>
<dd>
<tt>F8: SPLIT</tt>   activates the SPLIT command.
</dl>
<b>See also</b> <a href=#66>MITER</a>,
<a href=#67>MOVE</a>,
<a href=#71>OPTIMIZE</a>,
<a href=#92>SET</a>
<p>
The SPLIT command is used to split a wire (or segment) or a polygon
edge into two segments in order, for example, to introduce a bend.
This means you can split wires into parts that can be moved with the
mouse during the SPLIT command. A mouseclick defines the point at
which the wire is split. The shorter of the two new segments follows
the current wire bend rules and may therefore itself become two segments
(see SET Wire_Bend), the longer segment is a straight segment running
to the next end point.
<p>
If the <i>curve</i> or <i>@radius</i> parameter is given, an arc can be drawn as part of the wire segment
(see the detailed description in the <a href=#106>WIRE</a> command).
<p>
On completion of the SPLIT command, the segments are automatically
rejoined if they are in line unless the command
<pre>
SET OPTIMIZING OFF;
</pre>
has previously been given, or the wire has been clicked at the same
spot twice. In this case the split points remain and can be used,
for example, to <b>reduce the width of a segment</b>. This is achieved by
selecting the SPLIT command, marking the part of the wire which is
to be reduced with two mouse clicks, and using the command
<pre>
CHANGE WIDTH width
</pre>
The segment is then clicked on to complete the change.


<a name=98>
<h1>TECHNOLOGY</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines the possible <i>technology</i> parts of a device name.
<dt>
<b>Syntax</b>
<dd>
<tt>TECHNOLOGY name ..;</tt><br>
<tt>TECHNOLOGY -name ..;</tt><br>
<tt>TECHNOLOGY -* ..;</tt>
</dl>
<b>See also</b> <a href=#72>PACKAGE</a>,
<a href=#32>ATTRIBUTE</a>
<p>
This command is used in the device editor mode to define the possible <i>technology</i>
parts of a device name.
In the schematic or board editor the TECHNOLOGY command behaves exactly
like "<a href=#36>CHANGE TECHNOLOGY</a>".
<p>
Exactly one of the names given in the TECHNOLOGY command will
be used to replace the <tt>'*'</tt> in the device set name when an actual device is added
to a schematic.
The term <i>technology</i> stems from the main usage of this feature in creating
different variations of the same basic device, which all have the same schematic
symbol(s), the same package and the same pin/pad connections. They only differ in
a part of their name, which for the classic TTL devices is related to their
different technologies, like "L", "LS" or "HCT".
<p>
The TECHNOLOGY command can only be used if a package variant has been selected with the <a href=#72>PACKAGE</a> command.
<p>
If no <tt>'*'</tt> character is present in the device set name, the technology will
be appended to the device set name to form the full device name. Note that the technology
is processed before the package variant, so if the device set name contains neither
a <tt>'*'</tt> nor a <tt>'?'</tt> character, the resulting device name will consist
of <i>device_set_name</i><tt>+</tt><i>technology</i><tt>+</tt><i>package_variant</i>.
<p>
The names listed in the TECHNOLOGY command will be added to an already existing list
of technologies for the current device.
Starting a name with <tt>'-'</tt> will remove that name from the list of technologies.
If a name shall begin with <tt>'-'</tt>, it has to be enclosed in single quotes.
Using <tt>-*</tt> removes all technologies.
<p>
Only ASCII characters in the range 33..126 may be used in technologies (lowercase characters
will be converted to uppercase), and the maximum number of technologies per device is 254.
<p>
The special "empty" technology can be entered as two single quotes (<tt>''</tt>, an empty string).
<p>
Note that the Technologies dialog contains all technologies from all devices in
the loaded library, with the ones referenced by the current device checked.
<h2>Example</h2>
In a device named "<tt>74*00</tt>" the command
<pre>
TECHNOLOGY -* '' L LS S HCT;
</pre>
would first remove any existing technologies and then create the individual technology variants
<pre>
7400
74L00
74LS00
74S00
74HCT00
</pre>


<a name=99>
<h1>TEXT</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds text to a drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>TEXT  any_text  orientation &#149;..</tt><br>
<tt>TEXT 'any_text' orientation &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.<br>
<mb>Right</mb> rotates the text.<br>
<mb>Shift+Right</mb> reverses the direction of rotating.
</dl>
<b>See also</b> <a href=#36>CHANGE</a>,
<a href=#67>MOVE</a>,
<a href=#65>MIRROR</a>,
<a href=#75>PIN</a>,
<a href=#88>ROTATE</a>,
<a href=#32>ATTRIBUTE</a>
<p>
The TEXT command is used to add text to a library element or drawing.
When entering several texts it is not necessary to invoke the
command each time, as the text command remains active after placing
text with the mouse.
<h2>Orientation</h2>
The orientation of the text may be defined by the TEXT command (orientation)
using the usual definitions as listed in the <a href=#29>ADD</a> command (R0, R90
etc.). The right mouse button will change the rotation of the text
and the center mouse button will change the current layer.
<p>
Text is always displayed so that it can be read from in front or from
the right - even if rotated. Therefore after every two rotations it
appears the same way, but the origin has moved from the lower left
to the upper right corner. Remember this if a text appears to be unselectable.
<p>
If you want to have text that is printed "upside down", you can set the "Spin"
flag for that text.
<h2>Special Characters</h2>
If the text contains several successive blanks or a semicolon, the
whole string has to be enclosed in single quotes. If the text contains
single quotes then each one itself has to be enclosed in single quotes.
If apostrophes are required in the text, each must be enclosed
in single quotes.
<h2>Key Words</h2>
If the TEXT command is active and you want to type in a text that
contains a string that can be mistaken for a command (e.g. "red"
for "REDO") then this string has to be enclosed in single
quotes.
<h2>Text Height</h2>
The height of characters and the line width can be changed with the
CHANGE commands:
<pre>
CHANGE SIZE text_size &#149;..
CHANGE RATIO ratio &#149;..
</pre>
Maximum text height:  2 inches<br>
Maximum line width: 0.51602 inch (13.1 mm)<br>
Ratio: 0...31 (% of text height).
<h2>Text Font</h2>
Texts can have three different fonts:
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>Vector</tt></td>           <td width=20><td>the program's internal vector font</td></tr>
<tr><td><tt>Proportional</tt></td>     <td width=20><td>a proportional pixel font (usually 'Helvetica')</td></tr>
<tr><td><tt>Fixed</tt></td>            <td width=20><td>a monospaced pixel font (usually 'Courier')</td></tr>
</table>
<p>
The text font can be changed with the CHANGE command:
<pre>
CHANGE FONT VECTOR|PROPORTIONAL|FIXED &#149;..
</pre>
The program makes great efforts to output texts with fonts other than
<tt>Vector</tt> as good as possible. However, since the actual font is drawn
by the system's graphics interface, <tt>Proportional</tt> and <tt>Fixed</tt> fonts
may be output with different sizes and/or lengths.
<p>
If you set the option "Always vector font" in the <a href=#16>user interface dialog</a>,
all texts will always be displayed and printed using the builtin vector font.
This option is useful if the system doesn't display the other fonts correctly.<br>
When creating a new board or schematic, the current setting of this option is stored in the
drawing file. This makes sure that the drawing will be printed with the correct
setting if it is transferred to somebody else who has a different setting of
this option.<br>
You can use the <tt><a href=#92>SET</a> VECTOR_FONT OFF|ON</tt> command
to change the setting in an existing board or schematic drawing.
<p>
When creating output files with the CAM Processor, texts will always be drawn with
<tt>Vector</tt> font. Other fonts are not supported.
<p>
If a text with a font other than <tt>Vector</tt> is subtracted from a signal
polygon, only the surrounding rectangle is subtracted. Due to the
above mentioned possible size/length problems, the actually printed
font may exceed that rectangle. Therefore, if you need to subtract
a text from a signal polygon it is recommended that you use the <tt>Vector</tt>
font.
<p>
The <i>Ratio</i> parameter has no meaning for texts with fonts other than <tt>Vector</tt>.
<h2>Character Sets</h2>
Only the characters with ASCII codes below 128 are guaranteed to be printed correctly.
Any characters above this may be system dependent and may yield different results
with the various fonts.
<h2>Text Variables</h2>
Special texts in a symbol or package drawing, marked with the <tt>'&gt;'</tt>
character, will be replaced with actual values in a board or schematic:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>&gt;NAME</tt>             </td><td width=20><td>Component name (ev.+gate name) 1)</td></tr>
<tr><td><tt>&gt;VALUE</tt>            </td><td width=20><td>Comp. value/type 1)</td></tr>
<tr><td><tt>&gt;PART</tt>             </td><td width=20><td>Component name 2)</td></tr>
<tr><td><tt>&gt;GATE</tt>             </td><td width=20><td>Gate name 2)</td></tr>
<tr><td><tt>&gt;XREF</tt>             </td><td width=20><td>Part cross-reference 2)</td></tr>
<tr><td><tt>&gt;CONTACT_XREF</tt>     </td><td width=20><td>Contact cross-reference 2)</td></tr>
<tr><td><tt>&gt;DRAWING_NAME</tt>     </td><td width=20><td>Drawing name</td></tr>
<tr><td><tt>&gt;LAST_DATE_TIME</tt>   </td><td width=20><td>Time of the last modification</td></tr>
<tr><td><tt>&gt;PLOT_DATE_TIME</tt>   </td><td width=20><td>Time of the plot creation</td></tr>
<tr><td><tt>&gt;SHEETNR</tt>          </td><td width=20><td>Sheet number of a schematic 3)</td></tr>
<tr><td><tt>&gt;SHEETS</tt>           </td><td width=20><td>Total number of sheets of a schematic 3)</td></tr>
<tr><td><tt>&gt;SHEET</tt>            </td><td width=20><td>equivalent to "&gt;SHEETNR/&gt;SHEETS" 3)</td></tr>
</table>
<p>
1) Only for package or symbol<br>
2) Only for symbol<br>
3) Only for symbol or schematic
<p>
The format in which a part cross-reference is displayed can be controlled
through the "Xref part format" string, which is defined in the "Options/Set/Misc"
dialog, or with the <a href=#92>SET</a> command.
The following placeholders are defined, and can be used in any order:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>%S</tt></td>  <td width=20><td>the sheet number</td></tr>
<tr><td><tt>%C</tt></td>  <td width=20><td>the column on the sheet</td></tr>
<tr><td><tt>%R</tt></td>  <td width=20><td>the row on the sheet</td></tr>
</table>
<p>
The default format string is <tt>"/%S.%C%R"</tt>. Apart from the defined
placeholders you can also use any other ASCII characters.
<h2>Attributes</h2>
If a symbol or package drawing shall display an <a href=#32>attribute</a>
of the actual part or element, a text with the name of that attribute, marked with
the <tt>'&gt;'</tt> character, can be used. By default, only the actual value of the
given attribute will be displayed. If the attribute name is followed by one of the
special characters <tt>'='</tt>, <tt>'~'</tt> or <tt>'!'</tt>, the actual display
is as follows:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td with=100><tt>&gt;ABC </tt></td><td width=20><td><tt>123</tt></td></tr>
<tr><td><tt>&gt;ABC=</tt></td><td width=20><td><tt>ABC = 123</tt></td></tr>
<tr><td><tt>&gt;ABC~</tt></td><td width=20><td><tt>ABC</tt></td></tr>
<tr><td><tt>&gt;ABC!</tt></td><td width=20><td><tt><i>nothing</i></tt></td></tr>
</table>
<p>
Note that for each attribute name there should be only one such text in any given symbol
or package!
If there is more than one such text in a symbol or package that all reference the
same attribute name, only one of them will be displayed when the part using
this symbol or package is smashed.
<h2>Overlined text</h2>
Text can be <i>overlined</i>, which is useful for instance for the names of inverted
signals ("active low", see also
<a href=#69>NET</a>, <a href=#35>BUS</a> and <a href=#75>PIN</a>).
To do so, the text needs to be preceded with an exclamation mark (<tt>'!'</tt>), as in
<pre>
  !RESET
</pre>
which would result in
<pre>
  _____
  RESET
</pre>
This is not limited to signal names, but can be used in any text. It is
also possible to overline only part of a text, as in
<pre>
  !RST!/NMI
  R/!W
</pre>
which would result in
<pre>
  ___
  RST/NMI
    _
  R/W
</pre>
Note that the second exclamation mark indicates the end of the overline.
There can be any number of overlines in a text. If a text shall contain
an exclamation mark that doesn't generate an overline, it needs to be
escaped by a backslash. In order to keep the need for escaping exclamation
marks at a minimum, an exclamation mark doesn't start an overline if it
is the last character of a text, or if it is immediately followed by a
blank, another exclamation mark, a double or single quote, or by a right
parenthesis, bracket or brace. Any non-escaped exclamation mark or comma
that appears after an exclamation mark that started an overline will end
the overline (the comma as an overline terminator is necessary for busses).


<a name=100>
<h1>UNDO</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Cancels previous commands.
<dt>
<b>Syntax</b>
<dd>
<tt>UNDO;</tt>
<dt>
<b>Keyboard</b>
<dd>
<tt>F9:     UNDO</tt>   execute the UNDO command.
<tt>Alt+BS: UNDO</tt>
</dl>
<b>See also</b> <a href=#83>REDO</a>,
<a href=#92>SET</a>,
<a href=#354>Forward&amp;Back Annotation</a>
<p>
The UNDO command allows you to cancel previously executed commands.
This is especially useful if you have deleted things by accident.
Multiple UNDO commands cancel the corresponding number of commands
until the last EDIT, OPEN, AUTO, or REMOVE command is reached. It
is not possible to "undo" window operations.
<p>
The UNDO command uses up disk space. If you are short of
this you can switch off this function with the SET command
<pre>
SET UNDO_LOG OFF;
</pre>
UNDO/REDO is completely integrated within Forward&amp;Back Annotation.


<a name=101>
<h1>UPDATE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Updates library objects.
<dt>
<b>Syntax</b>
<dd>
<tt>UPDATE</tt><br>
<tt>UPDATE;</tt><br>
<tt>UPDATE library_name..;</tt><br>
<tt>UPDATE package_name@library_name..;</tt><br>
<tt>UPDATE +@ | -@ [library_name..];</tt><br>
<tt>UPDATE old_library_name = new_library_name;</tt>
</dl>
<b>See also</b> <a href=#29>ADD</a>,
<a href=#86>REPLACE</a>
<p>
The UPDATE command checks the parts in a board or schematic against
their respective library objects and automatically updates them if
they are different. If UPDATE is invoked from the library editor, the
packages within the loaded library will be updated from the given
libraries.
<p>
If you activate the UPDATE command without a parameter, a file dialog will
be presented to select the library from which to update.
<p>
If one ore more libraries are given, only parts from those libraries will be checked.
The library names can be either a plain library name (like "ttl" or "ttl.lbr") or a full
file name (like "/home/mydir/myproject/ttl.lbr" or "../lbr/ttl").
<h2>Update in a board or schematic</h2>
If the command is terminated with a <tt>';'</tt>, but has no parameters,
all parts will be checked.
<p>
If the first parameter is <tt>'+@'</tt>, the names of the given libraries (or all libraries,
if none are given) will get a <tt>'@'</tt> character appended, followed by a number.
This can be used to make sure the libraries contained in a drawing will not be modified when
a part from a newer library with the same name is added to the drawing. Library names that
already end with a <tt>'@'</tt> character followed by a number will not be changed.
<p>
If the first parameter is <tt>'-@'</tt>, the <tt>'@'</tt> character (followed by a number) of the given
libraries (or all libraries, if none are given) will be stripped from the library name.
This of course only works if there is no library with that new name already in the drawing.
<p>
Please note that "UPDATE +@;" followed by "UPDATE -@;" (and vice versa) does not necessarily
result in the original set of library names, because the sequence in which the names are processed
depends on the sequence in which the libraries are stored in the drawing file.
<p>
The libraries stored in a board or schematic drawing are identified only by their
base name (e.g. "ttl"). When considering whether an update shall be performed,
only the base name of the library file name will be taken into account.
Libraries will be searched in the directories specified under "Libraries" in the
<a href=#14>directories dialog</a>, from left to right.
The first library of a given name that is found will be taken. Note that the library
names stored in a drawing are handled case insensitive. It does not matter whether
a specific library is currently "in use". If a library is not found, no update
will be performed for that library and there will be no error message.
<p>
Using the UPDATE command in a schematic or board that are connected via active
<a href=#354>Forward&amp;Back Annotation</a> will act on both the
schematic and the board.
<p>
At some point you may need to specify whether gates, pins or pads shall
be mapped by their names or their coordinates. This is the case when the respective library
objects have been renamed or moved. If too many modifications have been made (for example, if
a pin has been both renamed and moved) the automatic update may not be possible. In that case
you can either do the library modification in two steps (one for renaming, another for moving),
or give the whole library object a different name.
<p>
When used with <tt>old_library_name = new_library_name</tt> (note that there has to be
at least one blank before and after the <tt>'='</tt> character), the UPDATE command
locates the library named <i>old_library_name</i> in the current board or schematic,
and updates it with the contents of <i>new_library_name</i>. Note that <i>old_library_name</i>
must be the pure library name, without any path, while <i>new_library_name</i>
may be a full path name. If the update was performed successfully, the library in the current board/schematic file will
also be renamed accordingly - therefore this whole operation is, of course, only
possible if <i>new_library_name</i> has not yet been used in the current board or schematic.
<p>
<b>Note: You should always run a <a href=#46>Design Rule Check</a> (DRC) and an
<a href=#48>Electrical Rule Check</a> (ERC) after a library update has been performed
in a board or a schematic!</b>
<h2>Update in a library</h2>
The update in a library replaces all packages within that library with the versions
from the given libraries.
<p>
By specifying the package name (package_name@library_name) you can have only a
specific package be replaced.


<a name=102>
<h1>USE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Marks a library for use.
<dt>
<b>Syntax</b>
<dd>
<tt>USE</tt><br>
<tt>USE -*;</tt><br>
<tt>USE library_name..;</tt>
</dl>
<b>See also</b> <a href=#29>ADD</a>,
<a href=#86>REPLACE</a>
<p>
The USE command marks a library for later use with the
<a href=#29>ADD</a> or <a href=#86>REPLACE</a> command.
<p>
If you activate the USE command without a parameter, a file dialog
will appear that lets you select a library file.
If a path for libraries has been defined in the
"Options/Directories" dialog,
the libraries from the first entry in this path are shown in the file dialog.
<p>
The special parameter <tt>-*</tt> causes all previously marked libraries
to be dropped.
<p>
<tt>library_name</tt> can be the full name of a library or it can contain
wildcards.
If <tt>library_name</tt> is the name of a directory, all libraries from
that directory will be marked.
<p>
The suffix <tt>.lbr</tt> can be omitted.
<p>
Note that when adding a device or package to a drawing, the complete library
information for that object is copied into the drawing file, so that
you don't need the library for changing the drawing later.
<p>
Changes in a library have no effect on existing drawings.
See the <a href=#101>UPDATE</a> command if you want to
update parts from modified libraries.
<h2>Using Libraries via the Control Panel</h2>
Libraries can be easily marked for use in the <a href=#12>Control Panel</a>
by clicking on their activation icon (which changes its color to indicate that this
library is being used), or by selecting "Use" from the library's context menu.
Through the context menu of the "Libraries" entry in the Control Panel it is also
possible to use <i>all</i> of the libraries or <i>none</i> of them.
<h2>Used Libraries and Projects</h2>
The libraries that are currently in use will be stored in the project file
(if a project is currently open).
<h2>Examples</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>USE</tt>              </td><td width=20><td>opens the file dialog to choose a library</td></tr>
<tr><td><tt>USE -*;</tt>          </td><td width=20><td>drops all previously marked libraries</td></tr>
<tr><td><tt>USE demo trans*;</tt> </td><td width=20><td>marks the library demo.lbr and all libraries with names matching trans*.lbr</td></tr>
<tr><td><tt>USE -* /eagle/lbr;</tt>  </td><td width=20><td>first drops all previously marked libraries and then marks all libraries from the directory /eagle/lbr</td></tr>
</table>


<a name=103>
<h1>VALUE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Displays and changes values.
<dt>
<b>Syntax</b>
<dd>
<tt>VALUE &#149;..</tt><br>
<tt>VALUE value &#149;..</tt><br>
<tt>VALUE name value ..</tt><br>
<tt>VALUE ON;</tt><br>
<tt>VALUE OFF;</tt>
</dl>
<b>See also</b> <a href=#68>NAME</a>,
<a href=#95>SMASH</a>
<h2>In Boards and Schematics</h2>
Elements can be assigned a value, e.g. '1k' for a resistor or '10uF'
for a capacitor. This is done with the VALUE command. The
command selects an element and opens a popup menu that allows you
to enter or to change a value.
<p>
If you type in a value before you select an element, then all of the subsequently
selected elements receive this value. This is very useful if you want
for instance a number of resistors to have the same value.
<p>
If the parameters name and value are specified, the
element name gets the specified value.
<h2>Example</h2>
<pre>
VALUE R1 10k R2 100k
</pre>
In this case more than one element has been assigned a value. This
possibility can be used in script files:
<pre>
VALUE R1   10k \
      R2  100k \
      R3  5.6k \
      C1  10uF \
      C2  22nF \
      ...
</pre>
The '\' prevents the following line from being mistaken for an EAGLE
key word.
<h2>In Device Mode</h2>
If the VALUE command is used in the device edit mode, the parameters
ON and OFF may be used:
<p>
On: Permits the actual value to be changed in the schematic.
<p>
Off: Automatically enters the actual device name into the schematic
(e.g.74LS00N). The user can only modify this value after a confirmation.


<a name=104>
<h1>VIA</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds vias to a board.
<dt>
<b>Syntax</b>
<dd>
<tt>VIA ['signal_name'] [diameter] [shape] [layers] [flags] &#149;..</tt>
</dl>
<b>See also</b> <a href=#96>SMD</a>,
<a href=#36>CHANGE</a>,
<a href=#45>DISPLAY</a>,
<a href=#92>SET</a>,
<a href=#73>PAD</a>,
<a href=#133>Design Rules</a>
<p>
When the VIA command is active, a via symbol is attached to the cursor.
Pressing the left mouse button places a via at the current position.
The via is added to a signal if it is placed on an existing signal wire.
If you try to connect different signals, EAGLE will ask you if you really
want to connect them.
<h2>Signal name</h2>
The <tt>signal_name</tt> parameter is intended mainly to be used in
script files that read in generated data. If a <tt>signal_name</tt>
is given, all subsequent vias will be added to that signal, and no
automatic checks will be performed.<br>
<b>This feature should be used with great care because it could result
in short circuits, if a via is placed in a way that it would connect
wires belonging to different signals. Please run a
<a href=#46>Design Rule Check</a> after using the VIA command
with the <tt>signal_name</tt> parameter!</b>
<h2>Via diameter</h2>
Entering a number changes the diameter of the via (in the actual
unit) and the value remains in use for further vias. Via diameters
can be up to 0.51602 inch (13.1 mm).
<p>
The drill diameter of the via is the same as the diameter set for
pads. It can be changed with
<pre>
CHANGE DRILL diameter &#149;
</pre>
<h2>Shape</h2>
A via can have one of the following shapes:
<p>
     Square<br>
     Round<br>
     Octagon
<p>
These shapes only apply to the outer layers (Top and Bottom).
In inner layers the shape is always "round".
<p>
Vias generate drill symbols in the Drills layer and the solder
stop mask in the tStop/bStop layers.
<p>
Like the diameter, the via shape can be entered while
the VIA command is active, or it can be changed with the CHANGE command.
The shape then remains valid for the next vias and pads.
<p>
Note that the actual shape and diameter of a via will be determined by the
<a href=#133>Design Rules</a> of the board the via is used in.
<h2>Layers</h2>
The <tt>layers</tt> parameter defines the layers this via shall
cover. The syntax is <tt>from-to</tt>, where 'from' and 'to' are the layer numbers
that shall be covered. For instance <tt>2-7</tt> would create a via that goes from
layer 2 to layer 7 (<tt>7-2</tt> would have the same meaning). If that exact via is
not available in the layer setup of the <a href=#133>Design Rules</a>, the next longer via
will be used (or an error message will be issued in case no such via can be
set).
<h2>Flags</h2>
The following <i>flags</i> can be used to control the appearance of a via:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>STOP</tt>  </td><td width=20><td>always generate solder stop mask</td></tr>
</table>
<p>
By default a via with a drill diameter that is less than or equal to the value of
the <a href=#133>Design Rules</a> parameter "Masks/Limit" will not
have a solder stop mask. The above <tt>STOP</tt> flag can be used to force a solder
stop mask for a via.


<a name=105>
<h1>WINDOW</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Zooms in and out of a drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>WINDOW;</tt><br>
<tt>WINDOW &#149;;</tt><br>
<tt>WINDOW &#149; &#149;;</tt><br>
<tt>WINDOW &#149; &#149; &#149;</tt><br>
<tt>WINDOW scale_factor</tt><br>
<tt>WINDOW FIT</tt><br>
<tt>WINDOW LAST</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Left&amp;Drag</mb> defines a rectangular window (shortcut for "<tt>&#149; &#149;;</tt>").
<dt>
<b>Keyboard</b>
<dd>
<tt>Alt+F2: WINDOW FIT </tt>   Fit drawing on the screen<br>
<tt>F2:     WINDOW;    </tt>   Redraw screen<br>
<tt>F3:     WINDOW 2   </tt>   Zoom in by a factor of 2<br>
<tt>F4:     WINDOW 0.5 </tt>   Zoom out by a factor of 2<br>
<tt>F5:     WINDOW (@);</tt>   Cursor pos. is new center (if a command is active)
</dl>
The WINDOW command is used to zoom in and out of the drawing and to
change the position of the drawing on the screen. The command can
be used with up to three mouse clicks. If there are fewer, it must
be terminated with a semicolon.
<h2>Refresh screen</h2>
If you use the WINDOW command followed by a semicolon, EAGLE redraws
the screen without changing the center or the scale. This is useful
if error messages cover part of the drawing.
<h2>New center</h2>
The WINDOW command with one point causes that point to become
the center of a new screen display of the drawing. The scaling of
the drawing remains the same. You can also use the sliders of the
working area to move the visible area of the drawing. The function
key F5 causes the current position of the cursor to be the new center.
<h2>Corner points</h2>
The WINDOW command with two points defines a rectangle with
the specified points at opposite corners. The rectangle expands to
fill the screen providing a close-up view of the specified portion
of the drawing.
<h2>New center and zoom</h2>
You can use the WINDOW command with three points. The first
point defines the new center of the drawing and the display becomes
either larger or smaller, depending on the ratios of the spacing between
the other points. In order to zoom in, the distance between point
1 and point 3 should be greater than the distance between point 1
and 2; to zoom out place point 3 between points 1 and 2.
<h2>Zoom in and out</h2>
<pre>
WINDOW 2;
</pre>
Makes the elements appear twice as large.
<pre>
WINDOW 0.5;
</pre>
Reduces the size of the elements by a factor of two.
<p>
You can specify an integer or real number as the argument to the WINDOW
command to scale the view of the drawing by the amount entered. The
center of the window remains the same.
<h2>The whole drawing</h2>
<pre>
WINDOW FIT;
</pre>
fits the entire drawing on the screen.
<h2>Back to the previous window</h2>
<pre>
WINDOW LAST;
</pre>
switches back to the previous window selection. A window selection is stored by
every WINDOW command, except for zoom-only WINDOW commands and modifications of
the window selection with the mouse.
<h2>Very large zoom factors</h2>
By default the maximum zoom factor is limited in such a way that
an area of 1mm (about 40mil) in diameter will be shown using the full editor window.
If you need to zoom in further, you can uncheck "Options/User interface/Limit zoom factor"
and will then be able to zoom in all the way until the finest editor grid (0.1 micron)
can be seen.
<p>
When zooming very far into a drawing, the following things may happen:
<ul>
<li>Texts that are not using the vector font may not be shown if they are larger
    than the editor window.
<li>Circles and Arcs are approximated and therefore may not appear at their exact
    location (especially if they have a very small width).
<li>Whether or not the finest grid will be visible when zooming all the way in depends
    on your screen resolution, the editor window size and the value of
    "Options/Set/Misc/Min. visible grid size".
</ul>
<h2>Parameter Aliases</h2>
Parameter aliases can be used to define certain parameter settings to the
WINDOW command, which can later be referenced by a given name.
The aliases can also be accessed by clicking on the "WINDOW Select" button
and holding the mouse button pressed until the list pops up.
A right click on the button also pops up the list.
<p>
The syntax to handle these aliases is:
<dl>
<dt>
<tt>WINDOW = <i>name</i> <i>parameters</i></tt>
<dd>
Defines the alias with the given <i>name</i> to expand to the given
<i>parameters</i>. The <i>name</i> may consist of any number of letters,
digits and underlines, and is treated case insensitive. It must begin
with a letter or underline and may not be one of the option keywords.
<dt>
<tt>WINDOW = <i>name</i> @</tt>
<dd>
Defines the alias with the given <i>name</i> to expand to the current
window selection.
<dt>
<tt>WINDOW = ?</tt>
<dd>
Asks the user to enter a name for defining an alias for the current
window settings.
<dt>
<tt>WINDOW = <i>name</i></tt>
<dd>
Allows the user to select a window that will be defined as an alias
under the given <i>name</i>.
<dt>
<tt>WINDOW = <i>name</i>;</tt>
<dd>
Deletes the alias with the given <i>name</i>.
<dt>
<tt>WINDOW <i>name</i></tt>
<dd>
Expands the alias with the given <i>name</i> and executes the WINDOW command with
the resulting set of parameters. The <i>name</i> may be abbreviated and
there may be other parameters before and after the alias (even other
aliases). Note that in case <i>name</i> is an abbreviation, aliases have precedence
over other parameter names of the command.
</dl>
Example:
<p>
<tt>WINDOW = MyWindow (0 0) (4 3);</tt>
<p>
Defines the alias "MyWindow" which, when used as in
<p>
<tt>WINDOW myw</tt>
<p>
will zoom to the given window area.
Note the abbreviated use of the alias and the case insensitivity.


<a name=106>
<h1>WIRE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Adds wires (tracks) to a drawing.
<dt>
<b>Syntax</b>
<dd>
<tt>WIRE ['signal_name'] [width] &#149; &#149;..</tt><br>
<tt>WIRE ['signal_name'] [width] [ROUND | FLAT] &#149; [curve | @radius] &#149;..</tt>
<dt>
<b>Mouse keys</b>
<dd>
<mb>Center</mb> selects the layer.<br>
<mb>Right</mb> changes the wire bend style (see <a href=#92>SET Wire_Bend</a>).<br>
<mb>Shift+Right</mb> reverses the direction of switching bend styles.<br>
<mb>Ctrl+Left</mb> when starting a wire snaps it to the next existing wire end point.<br>
<mb>Ctrl+Right</mb> toggles between corresponding bend styles.<br>
<mb>Ctrl+Left</mb> when placing a wire end point defines arc radius.
</dl>
<b>See also</b> <a href=#66>MITER</a>,
<a href=#94>SIGNAL</a>,
<a href=#89>ROUTE</a>,
<a href=#36>CHANGE</a>,
<a href=#69>NET</a>,
<a href=#35>BUS</a>,
<a href=#43>DELETE</a>,
<a href=#87>RIPUP</a>,
<a href=#30>ARC</a>
<p>
The WIRE command is used to add wires (tracks) to a drawing. The wire
begins at the first point specified and runs to the second. Additional
points draw additional wire segments. Two mouse clicks at the same
position finish the wire and a new one can be started at the position
of the next mouse click.
<p>
Depending on the currently active wire bend, one or two wire segments will
be drawn between every two points. The wire bend defines the angle
between the segments and can be changed with the right mouse button (holding
the Shift key down while clicking the right mouse button reverses the direction
in which the bend styles are gone through, and the Ctrl key makes it toggle
between corresponding bend styles).
<p>
Pressing the center mouse button brings up a popup menu from which you
may select the layer into which the wire will be drawn.
<p>
The special keywords <tt>ROUND</tt> and <tt>FLAT</tt>, as well as the <i>curve</i>
parameter, can be used to draw an arc (see below).
<p>
Starting a WIRE with the Ctrl key pressed snaps the starting point
of the new wire to the coordinates of the closest existing wire. This
is especially useful if the existing wire is off grid. It also adjusts
the current width, layer and style to those of the existing wire.
If the current bend style is 7 ("Freehand"), the new wire will form a
smooth continuation of the existing wire.
<h2>Signal name</h2>
The <tt>signal_name</tt> parameter is intended mainly to be used in
script files that read in generated data. If a <tt>signal_name</tt>
is given, all subsequent wires will be added to that signal and no
automatic checks will be performed.<br>
<b>This feature should be used with great care because it could result
in short circuits, if a wire is placed in a way that it would connect
different signals. Please run a
<a href=#46>Design Rule Check</a> after using the WIRE command
with the <tt>signal_name</tt> parameter!</b>
<h2>Wire Width</h2>
Entering a number after activating the WIRE command changes the width
of the wire (in the present unit) which can be up to 0.51602 inch
(13.1 mm).
<p>
The wire width can be changed with the command
<pre>
CHANGE WIDTH width &#149;
</pre>
at any time.
<h2>Wire Style</h2>
Wires can have one of the following <i>styles</i>:
<ul>
<li>Continuous
<li>LongDash
<li>ShortDash
<li>DashDot
</ul>
The wire style can be changed with the <a href=#36>CHANGE</a> command.
<p>
Note that the DRC and Autorouter will always treat wires as "Continuous",
even if their style is different. Wire styles are mainly for electrical
and mechanical drawings and should not be used on signal layers. It is
an explicit DRC error to use a non-continuous wire as part of a signal
that is connected to any pad.
<h2>Signals in Top, Bottom, and Route Layers</h2>
Wires (tracks) in the layers Top, Bottom, and ROUTE2...15
are treated as signals. If you draw a wire in either of these layers
starting from an existing signal, then all of the segments of this wire
belong to that signal (only if the center of the wire is placed exactly onto
the center of the existing wire or pad). If you finish this drawing operation with a
wire segment connected to a different signal, then EAGLE will ask
you if you want to connect the two signals.
<p>
Note that EAGLE treats each wire segment as a single object
(e.g. when deleting a wire).
<p>
When the WIRE command is active the center mouse button
can be used to change the layer on which the wire is drawn.
<p>
Do not use the WIRE command for nets, buses, and airwires.
See <a href=#69>NET</a>,
<a href=#35>BUS</a> and
<a href=#94>SIGNAL</a>.
<h2>Drawing Arcs</h2>
Wires and arcs are basically the same objects, so you can draw an arc either by
using the <a href=#30>ARC</a> command, or by adding the necessary parameters
to the WIRE command. To make a wire an arc it needs either the <i>curve</i> parameter, which
defines the "curvature" of the arc, or the <i>@radius</i> parameter, which defines
the radius of the arc (note the <tt>'@'</tt>, which is necessary to be able to tell
apart <i>curve</i> and <i>radius</i>).
<p>
The valid range for <i>curve</i> is <tt>-360</tt>..<tt>+360</tt>, and its value means what
part of a full circle the arc consists of. A value of <tt>90</tt>, for instance,
would result in a <tt>90&deg;</tt> arc, while <tt>180</tt> would give you a semicircle.
The maximum value of <tt>360</tt> can only be reached theoretically, since this would
mean that the arc consists of a full circle, which, because the start and end points
have to lie on the circle, would have to have an infinitely large diameter.  Positive
values for <i>curve</i> mean that the arc is drawn in a mathematically positive sense
(i.e. counterclockwise). If <i>curve</i> is <tt>0</tt>, the arc is a straight line
("no curvature"), which is actually a wire. Note that in order to distinguish the
<i>curve</i> parameter from the <i>width</i> parameter, it always has to be given with
a sign (<tt>'+'</tt> or <tt>'-'</tt>), even if it is a positive value.<br>
<p>
As an example, the command
<pre>
WIRE (0 0) +180 (0 10);
</pre>
would draw a semicircle from the point (0 0) to (0 10), in counterclockwise
direction.
<p>
If a <i>radius</i> is given, the arc will have that radius. Just like the <i>curve</i>
parameter, <i>radius</i> also must have a sign in order to determine the arcs
orientation.
For example, the command
<pre>
WIRE (0 0) @+100 (0 200);
</pre>
would draw a semicircle from the point (0 0) to (0 200) (with a radius of 100),
in counterclockwise direction. Note that if the end point is more than twice the
radius away from the start point, a straight line will be drawn.
<p>
The arc radius can also be defined by placing the wire end point with the <tt>Ctrl</tt>
key pressed (typically at the center of the circle on which the arc shall lie).
In that case the point is not taken as an actual end point, but is rather
used to set the radius of an arc. You can then move the cursor around and place an
arc with the given radius (the right mouse button together with <tt>Ctrl</tt> will
toggle the arc's orientation). If you move the cursor more than twice the radius
away from the start point, a straight line will be drawn.
<p>
In order to be able to draw any arc with the WIRE command (which is especially important
for generated script files), the keywords <tt>ROUND</tt> and <tt>FLAT</tt> are also
allowed in the WIRE command. Note, though, that these apply only to actual arcs
(straight wires always have round endings). By default, arcs created with the WIRE
command have round endings.


<a name=107>
<h1>WRITE</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Saves the current drawing or library.
<dt>
<b>Syntax</b>
<dd>
<tt>WRITE;</tt><br>
<tt>WRITE name</tt><br>
<tt>WRITE @name</tt>
</dl>
The WRITE command is used to save a drawing or library. If 'name'
is entered, EAGLE will save the file under the new name.
<p>
The file name may also be entered with a pathname if it is to
be saved in another directory. If no pathname is given, the file is
saved in the
<a href=#14>project directory</a>.
<p>
If the new name is preceded with a <tt>@</tt>, the name of the loaded
drawing will also be changed accordingly. The corresponding board/schematic
will then also be saved automatically under this name and the UNDO buffer
will be cleared.
<p>
If WRITE is selected from the menu, a popup window will appear asking
for the name to use (current drawing name is default). This name may
be edited and accepted by clicking the OK button. Pressing the ESCAPE
key or clicking the CANCEL button cancels the WRITE command.
<p>
To assure consistency for
<a href=#354>Forward&amp;Back Annotation</a>
between board and schematic drawings, the WRITE
command has the following additional functionality:
<ul>
<li>when a board/schematic is saved under the same name, the
corresponding schematic/board is also saved if it has been modified
<li>when a board/schematic is saved under a different name, the user
will be asked whether he also wants to save the schematic/board
under that different name
<li>saving a drawing under a different name does not clear the "modified" flag
</ul>


<a name=108>
<h1>Generating Output</h1>
<ul>
<li><a href=#109>Printing</a>
<li><a href=#113>CAM Processor</a>
<li><a href=#130>Outlines data</a>
</ul>


<a name=109>
<h1>Printing</h1>
The parameters for printing to the system printer can be modified through
the following three dialogs:
<ul>
<li><a href=#110>Printing a Drawing</a>
<li><a href=#111>Printing a Text</a>
<li><a href=#112>Printer Page Setup</a>
</ul>
<p>
<b>See also</b> <a href=#79>PRINT</a>


<a name=110>
<h1>Printing a Drawing</h1>
If you enter the <a href=#79>PRINT</a> command without a
terminating <tt>';'</tt>, or select <b>Print</b> from the
<a href=#13>context menu</a> of a drawing's icon in the
<a href=#12>Control Panel</a>, you will be presented a dialog
with the following options:
<h2>Paper</h2>
Selects which paper format to print on.
<h2>Orientation</h2>
Selects the paper orientation.
<h2>Preview</h2>
Turns the print preview on or off.
<h2>Mirror</h2>
Mirrors the output.
<h2>Rotate</h2>
Rotates the output by 90&deg;.
<h2>Upside down</h2>
Rotates the drawing by 180&deg;. Together with <b>Rotate</b> the drawing is rotated by a total of 270&deg;.
<h2>Black</h2>
Ignores the color settings of the layers and prints everything in black.
<h2>Solid</h2>
Ignores the fill style settings of the layers and prints everything in solid.
<h2>Scale factor</h2>
Scales the drawing by the given value.
<h2>Page limit</h2>
Defines the maximum number of pages you want the output to use.
In case the drawing does not fit on the given number of pages, the actual scale factor
will be reduced until it fits.
The default value of <tt>0</tt> means no limit.
<h2>All</h2>
All sheets of the schematic will be printed
(this is the default when selecting <b>Print</b> from the
<a href=#13>context menu</a> of a schematic drawing's icon).
<h2>From...to</h2>
Only the given range of sheets will be printed.
<h2>This</h2>
Only the sheet that is currently being edited will be printed
(this is the default when using the <a href=#79>PRINT</a> command
from a schematic editor window).
<h2>Printer...</h2>
Invokes the system printer dialog, which enables you to choose which printer
to use and to set printer specific parameters.
<h2>PDF...</h2>
Creates a PDF (Portable Document Format) file with the given print settings.
<p>
The remaining options are used for the <a href=#112>page setup</a>.


<a name=111>
<h1>Printing a Text</h1>
If you select <b>Print</b> from the
<a href=#13>context menu</a> of a text file's icon in the
<a href=#12>Control Panel</a>, or from the <b>File</b>
menu of the <a href=#26>Text Editor</a>, you will be presented
a dialog with the following options:
<h2>Wrap long lines</h2>
Enables wrapping lines that are too long to fit on the page width.
<h2>Printer...</h2>
Invokes the system printer dialog, which enables you to choose which printer
to use and to set printer specific parameters.
<h2>PDF...</h2>
Creates a PDF (Portable Document Format) file with the given print settings.
<p>
The remaining options are used for the <a href=#112>page setup</a>.


<a name=112>
<h1>Printer Page Setup</h1>
The Print dialog provides several options that are used to define how a drawing or text
shall be placed on the paper.
<h2>Border</h2>
Defines the left, top, right and bottom borders. The values are either in
millimeters or inches, depending on which unit results in fewer decimals.
<p>
The default border values are taken from the printer driver, and define
the maximum drawing area your particular printer can handle. You can enter
smaller values here, but your printer hardware may or may not be able to
print arbitrarily close to the paper edges.
<p>
After changing the printer new hardware minimums may apply and your
border values may be automatically enlarged as necessary to comply with
the new printer. Note that the values will not be decreased automatically
if a new printer would allow smaller values. To get the smallest possible
border values you can enter <tt>0</tt> in each field, which will then be
limited to the hardware minimum.
<h2>Calibrate</h2>
If you want to use your printer to produce production layout drawings,
you may have to calibrate your printer to achieve an exact 1:1
reproduction of your layout.
<p>
The value in the <b>X</b> field is the calibration factor to use
in the print head direction, while the value in the <b>Y</b> field
is used to calibrate the paper feed direction.
<p>
<b>IMPORTANT NOTE: When producing production layout drawings with
your printer, always check the final print result for correct measurements!</b>
<p>
The default values of <tt>1</tt> assume that the printer produces exact
measurements in both directions.
<h2>Aligment</h2>
Defines the vertical and horizontal alignment of the drawing on the paper.
<h2>Caption</h2>
Activates the printing of a caption line, containing the time and date
of the print as well as the file name.
<p>
If the drawing is mirrored, the word "mirrored" will appear in the caption,
and if the scale factor is not <tt>1.0</tt> it will be added as <b>f=...</b>
(the scale factor is given with 4 decimal digits, so even if <b>f=1.0000</b>
appears in the caption the scale factor will not be <i>exactly</i> <tt>1.0</tt>).


<a name=113>
<h1>CAM Processor</h1>
The CAM Processor allows you to output any combination of layers
to a device or file.
<p>
The following help topics lead you through the necessary steps from
selecting a data file to configuring the output device:
<ul>
<li><a href=#114>Select the data file</a>
<li><a href=#116>Select the output device type</a>
<li><a href=#127>Select the output file</a>
<li><a href=#129>Select the plot layers</a>
<li><a href=#117>Adjust the device parameters</a>
<li><a href=#128>Adjust the flag options</a>
</ul>
The CAM Processor allows you to combine several sets of parameter settings
to form a <a href=#115>CAM Processor Job</a>, which can be used to
produce a complete set of output files with a single click of a button.
<p>
<b>See also</b> <a href=#109>printing to the system printer</a>


<a name=114>
<h1>Main CAM Menu</h1>
The <i>Main CAM Menu</i> is where you select which file to process,
edit drill rack and aperture wheel files, and load or save job files.
<h2>File</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Open           </td><td width=20><td>Board...  open a board file for processing</td></tr>
<tr><td>                          </td><td width=20><td>Drill rack...  open a drill rack file for editing</td></tr>
<tr><td>                          </td><td width=20><td>Wheel...  open an aperture wheel file for editing</td></tr>
<tr><td>                          </td><td width=20><td>Job...  switch to an other job (or create a new one)</td></tr>
<tr><td>Save job...    </td><td width=20><td>save the current job</td></tr>
<tr><td>Close          </td><td width=20><td>close the CAM Processor window</td></tr>
<tr><td>Exit           </td><td width=20><td>exit from the program</td></tr>
</table>
<h2>Layer</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Deselect all   </td><td width=20><td>deselect all layers</td></tr>
<tr><td>Show selected  </td><td width=20><td>show only the selected layers</td></tr>
<tr><td>Show all       </td><td width=20><td>show all layers</td></tr>
</table>
<h2>Window</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Control Panel         </td><td width=20><td>switch to the Control Panel</td></tr>
<tr><td>1 Schematic - ...     </td><td width=20><td>switch to window number 1</td></tr>
<tr><td>2 Board - ...         </td><td width=20><td>switch to window number 2</td></tr>
</table>
<h2>Help</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>General help   </td><td width=20><td>opens a general help page</td></tr>
<tr><td>Contents       </td><td width=20><td>opens the help table of contents</td></tr>
<tr><td>CAM Processor  </td><td width=20><td>displays help for the CAM Processor</td></tr>
<tr><td>Job help       </td><td width=20><td>displays help about the Job mechanism</td></tr>
<tr><td>Device help    </td><td width=20><td>displays help about output devices</td></tr>
</table>


<a name=115>
<h1>CAM Processor Job</h1>
A CAM Processor <i>Job</i> consists of several <i>Sections</i>,
each of which defines a complete set of CAM Processor parameters
and layer selections.
<p>
A typical CAM Processor job could for example have two sections, one
that produces photoplotter data for the Top layer, and another that
produces the data for the bottom layer.
<h2>Section</h2>
The <i>Section</i> selector shows the currently active job section.
By pressing the button you can select any of the sections you have defined
previously with the <i>Add</i> button.
<h2>Prompt</h2>
If you enter a text in this field, the CAM Processor will prompt you with
this message before processing that particular job section. For example you
might want to change the paper in your pen plotter for each plot, so the
message could be "Please change paper!". Each job section can have its own
prompt message, and if there is no message the section will be processed
immediately.
<h2>Add</h2>
Click on the <i>Add</i> button to add a new section to the job.
You will be asked for the name of that new job section. The new job section
will be created with all parameters set to the values currently shown
in the menu.<br>
Please note that if you want to create a new job section, you should
<b>first add</b> that new section and <b>then modify</b> the
parameters. Otherwise, if you first modify the parameters of the current
section and then add a new section, you will be prompted to confirm whether
the modifications to the current section shall be saved or not.
<h2>Del</h2>
Use the <i>Del</i> button to delete the current job section.
You will be prompted to confirm whether you really want to delete that
section.
<h2>Process Section</h2>
The <i>Process Section</i> button processes the current job section, as
indicated in the <i>Section</i> selector.
<h2>Process Job</h2>
The <i>Process Job</i> button processes the entire job by processing
each section in turn, starting with the first section. What happens is
the same as if you would select every single section with the
<i>Section</i> selector and press the <i>Process Section</i> button for
each section - just a lot more convenient!


<a name=116>
<h1>Output Device</h1>
The <i>Output Device</i> defines the kind of output the CAM Processor
is to produce. You can select from various device types, like photo plotters,
drill stations etc.
<h2>Device</h2>
Clicking on the button of the Device selector
opens a list of all available output devices.
<h2>Scale</h2>
On devices that can scale the output you can enter a scaling factor in
this field. Values larger than <tt>1</tt> will produce an enlarged output,
values smaller than <tt>1</tt> will shrink the output.
<p>
You can limit the size of the output to a given number of pages by entering
a negative number in the Scale field. In that case the default scale
factor will be 1.0 and will be decreased until the drawing just fits on the
given number of pages. For example, entering "-2" into this field will
produce a drawing that does not exceed two pages. Please note that for this
mechanism to work you will have to make sure that the page width and height
is set according to your output device. This setting can be adjusted in the
Width and Height fields or by editing the file eagle.def.
<h2>File</h2>
You can either enter the name of the
<a href=#127>output file</a>
directly into this field, or click on the
File button
to open a dialog for the definition of the output file.<br>
If you want to derive the output filename from the input data file, you
can enter a partial filename (at least an extension, e.g. <tt>.gbr</tt>),
in which case the rest of the filename will be taken from the input data
filename.
<h2>Wheel</h2>
You can either enter the name of the
<a href=#118>aperture wheel file</a>
directly into this field, or click on the Wheel button
to open a file dialog to select from.<br>
If you want to derive the output filename from the input data file, you
can enter a partial filename (at least an extension, e.g. <tt>.whl</tt>),
in which case the rest of the filename will be taken from the input data
filename.
<h2>Rack</h2>
You can either enter the name of the
<a href=#121>drill rack file</a>
directly into this field, or click on the Rack button
to open a file dialog to select from.<br>
If you want to derive the output filename from the input data file, you
can enter a partial filename (at least an extension, e.g. <tt>.drl</tt>),
in which case the rest of the filename will be taken from the input data
filename.
Some drill devices (like EXCELLON, for instance) can automatically generate the
necessary drill definitions, in which case this field is not present.


<a name=117>
<h1>Device Parameters</h1>
Depending on the type of <a href=#116>output device</a>
you have selected, there are several device specific parameters that
allow you to adjust the output to your needs:
<ul>
<li><a href=#118>Aperture Wheel File</a>
<li><a href=#119>Aperture Emulation</a>
<li><a href=#120>Aperture Tolerances</a>
<li><a href=#121>Drill Rack File</a>
<li><a href=#122>Drill Tolerances</a>
<li><a href=#123>Offset</a>
<li><a href=#124>Page Size</a>
<li><a href=#125>Pen Data</a>
</ul>


<a name=118>
<h1>Aperture Wheel File</h1>
A photoplotter usually needs to know which <i>apertures</i> are
assigned to the codes used in the output file. These assignments
are defined in an <i>Aperture Wheel File</i>.
<h2>Examples</h2>
<pre>
D010    annulus   0.004 x 0.000
D010    round     0.004
D040    square    0.004
D054    thermal   0.090 x 0.060
D100    rectangle 0.060 x 0.075
D104    oval      0.030 x 0.090
D110    draw      0.004
</pre>
Note that the file may contain several apertures that share the same D-code,
as long as all of these have a type from draw, round or annulus, and have
the same size (in case of annulus the second size parameter must be 0 in such
a case). This can be used to map apertures that effectively result in the
same drawing to a common D-code.


<a name=119>
<h1>Aperture Emulation</h1>
If the item "Apertures" is selected, apertures not available are
emulated with smaller apertures. If this item is not selected,
no aperture emulation will be done at all.
<p>
"Annulus" and/or "Thermal" is to be selected if these aperture types
are to be emulated (only effective if "Apertures" is selected, too).
<p>
Please note that aperture emulation can cause very long plot times (costs!).


<a name=120>
<h1>Aperture Tolerances</h1>
If you enter tolerances for draw and/or flash apertures the CAM
Processor uses apertures within the tolerances, provided the aperture
with the exact value is not available.
<p>
Tolerances are entered in percent.
<p>
<b>Please be aware that your design rules might not be kept when allowing
tolerances!</b>


<a name=121>
<h1>Drill Rack File</h1>
If a drill station driver can't automatically generate the necessary drill
definitions, it needs to know which <i>drill diameters</i>
are assigned to the codes used in the output file. These assignments
are defined in a <i>Drill Rack File</i>.
<p>
This file can be generated with the help of a User Language Program called
drillcfg.ulp, that is stored in your EAGLE's ULP directory.
Use the <a href=#90>RUN</a> command to start it.
<h2>Example</h2>
<pre>
T01   0.010
T02   0.016
T03   0.032
T04   0.040
T05   0.050
T06   0.070
</pre>


<a name=122>
<h1>Drill Tolerances</h1>
If you enter tolerances for drills the CAM Processor uses drill
diameters within the tolerances, provided the drill with the exact
value is not available.
<p>
Tolerances are entered in percent.


<a name=123>
<h1>Offset</h1>
Offset in x and y direction (inch, decimal number).
<p>
Can be used to position the origin of plotters at the lower left corner.


<a name=124>
<h1>Printable Area</h1>
<h2>Height</h2>
Printable area in <tt>Y</tt> direction (inch).
<h2>Width</h2>
Printable area in <tt>X</tt> direction (inch).
<p>
Please note that the CAM Processor divides a drawing into several
parts if the rectangle which includes all objects of the file
(even the ones not printed) doesn't fit into the printable area.


<a name=125>
<h1>Pen Data</h1>
<h2>Diameter</h2>
Pen diameter in mm. Is used for the calculation of lines
when areas have to be filled.
<h2>Velocity</h2>
Pen velocity in cm/s for pen plotters which can be adjusted
to different speeds.
<p>
The plotter default speed is selected with the value 0.


<a name=126>
<h1>Defining Your Own Device Driver</h1>
The drivers for output devices are defined in the text file eagle.def.
There you find details on how to define your own driver. It is
advisable to copy the whole section of an existing driver of the same
device category and to edit the parameters which are different.
<p>
Please use a <a href=#26>text editor</a> which doesn't
place control characters into the file.


<a name=127>
<h1>Output File</h1>
The <i>Output File</i> contains the data produced by the CAM Processor.
<p>
The following file names are commonly used:
<pre>
-------------------------------------------------------
File   Layers               Meaning
-------------------------------------------------------
*.cmp  Top, Via, Pad        Component side
*.ly2  Route2, Via, Pad     Inner signal layer
*.ly3  Route3, Via, Pad     Inner signal layer
*.ly4  $User1               Inner supply layer
...                         ...
*.sol  Bot, Via, Pad        Solder side
*.plc  tPl, Dim, tName,     Silkscreen comp. side
*.pls  bPl, Dim, bName,     Silkscreen solder side
*.stc  tStop                Solder stop mask comp. side
*.sts  bStop                Solder stop mask sold. side
*.drd  Drills, Holes        Drill data for NC drill st.
-------------------------------------------------------
</pre>
<h2>Placeholders</h2>
The output file name can either be entered directly, or can be dynamically
composed using <i>placeholders</i>. A placeholder consists of a percentage
character (<tt>'%'</tt>) followed by a letter. The following
placeholders are defined:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>%D{xxx}</tt></td><td width=20><td>a string that is inserted only into the data file name</td></tr>
<tr><td><tt>%E</tt>     </td><td width=20><td>the loaded file's extension (without the <tt>'.'</tt>)</td></tr>
<tr><td><tt>%H</tt>     </td><td width=20><td>the user's <a href=#14>home directory</a></td></tr>
<tr><td><tt>%I{xxx}</tt></td><td width=20><td>a string that is inserted only into the info file name</td></tr>
<tr><td><tt>%L</tt>     </td><td width=20><td>the layer range for blind&amp;buried vias (see below)</td></tr>
<tr><td><tt>%N</tt>     </td><td width=20><td>the loaded file's name (without path and extension)</td></tr>
<tr><td><tt>%P</tt>     </td><td width=20><td>the loaded file's directory path (without file name)</td></tr>
<tr><td><tt>%%</tt>     </td><td width=20><td>the character <tt>'%'</tt></td></tr>
</table>
<p>
For example, the output file definition
<p>
<tt>%N.cmp%I{.info}</tt>
<p>
would create <tt><i>boardname</i>.cmp</tt> for the data file and <tt><i>boardname</i>.cmp.info</tt>
for the info file (in case the selected output device generates an info file).
<h2>Drill data with blind&amp;buried vias</h2>
If the board contains blind or buried vias, the CAM
Processor generates a separate drill file for each via length that is
actually used in the board. The file names are built by adding the number
of the start and end layer to the base file name, as in
<pre>
<i>boardname</i>.drl.0104
</pre>
which would be the drill file for the layer stack 1-4. If you want to have
the layer numbers at a different position, you can use the placeholder <tt>%L</tt>,
as in
<pre>
%N.%L.drl
</pre>
which would result in
<pre>
<i>boardname</i>.0104.drl
</pre>
The drill info file name is always generated without layer numbers, and
any '.' before the <tt>%L</tt> will be dropped.
Any previously existing files that would match the given drill file name
pattern, but would not result from the current job, will be deleted before
generating any new files. There will be one drill info file per job, which
contains (amoung other information) a list of all generated drill data files.


<a name=128>
<h1>Flag Options</h1>
<h2>Mirror</h2>
Mirror output. This option normally causes negative
coordinates, therefore it should be used only if "pos. Coord." is
selected, too.
<h2>Rotate</h2>
Rotate drawing by 90 degrees. This option normally causes
negative coordinates, therefore it should be used only if "pos.
Coord." is selected, too.
<h2>Upside down</h2>
Rotate the drawing by 180 degrees. Together with Rotate, the
drawing is rotated by a total of 270 degrees. This option normally causes
negative coordinates, therefore it should be used only if "pos.
Coord." is selected, too.
<h2>pos. Coord</h2>
Offsets the output so that negative coordinates are
eliminated and the drawing is referenced to the origin of the output device.
This is advisable for devices which generate error messages if
negative coordinates are detected.
<h2>Quickplot</h2>
Draft output which shows only the outlines of objects (subject to availability
on the selected output device).
<h2>Optimize</h2>
Activates the optimization of the drawing sequence for plotters.
<h2>Fill pads</h2>
Pads will be filled. This function can be properly executed only with
generic devices, like PostScript.<br>
If this option is not selected, the drill holes of pads will be visible
on the output.


<a name=129>
<h1>Layers and Colors</h1>
Select the layer combination by clicking the check boxes in the
<i>Layer</i> list.
<p>
If you have selected an
<a href=#116>output device</a>
that supports colors, you can enter the color number
in the <i>Color</i> field of each layer.
<p>
The following layers and
<a href=#127>output file names</a>
are commonly used to create the output:
<pre>
-------------------------------------------------------
File   Layers               Meaning
-------------------------------------------------------
*.cmp  Top, Via, Pad        Component side
*.ly2  Route2, Via, Pad     Inner signal layer
*.ly3  Route3, Via, Pad     Inner signal layer
*.ly4  $User1               Inner supply layer
...                         ...
*.sol  Bot, Via, Pad        Solder side
*.plc  tPl, Dim, tName,     Silkscreen comp. side
*.pls  bPl, Dim, bName,     Silkscreen solder side
*.stc  tStop                Solder stop mask comp. side
*.sts  bStop                Solder stop mask sold. side
*.drd  Drills, Holes        Drill data for NC drill st.
-------------------------------------------------------
</pre>


<a name=130>
<h1>Outlines data</h1>
EAGLE can produce outlines data which can be used for milling prototype boards.
<p>
The User Language Program <i>outlines.ulp</i> implements the entire process
necessary to do this. The following is a detailed description of what exactly has to
be done to produce outlines data with EAGLE.
<h2>Preparing the board</h2>
Outlines data is produced by defining a <a href=#77>POLYGON</a>
in the layer for which the outlines shall be calculated.
This polygon must have the following properties:
<ul>
<li>its name must be _OUTLINES_
<li>it must be the <b>only</b> object in the signal named _OUTLINES_
<li>its <i>Rank</i> must be <tt>'6'</tt>
<li>its <i>Width</i> must be the same as the diameter of the milling tool
<li>it must be large enough to cover the entire board area
</ul>
If a polygon with these properties is present in your board, the
<a href=#81>RATSNEST</a> command will calculate it in such
a way that its <i>contours</i> correspond to the lines that have to be drawn by
the milling tool to isolate the various signals from each other.
The <i>fillings</i> of the calculated polygon define what has to be milled out
if you want to completely remove all superfluous copper areas.
<h2>Extracting the data</h2>
The outlines data can be extracted from the board through a
<a href=#138>User Language Program</a>. The <i>outlines.ulp</i>
program that comes with EAGLE implements this entire process. If you want to
write your own ULP you can use <i>outlines.ulp</i> as a starting point.
See the help page for <a href=#199>UL_POLYGON</a> for details
about how to retrieve the outlines data from a polygon object.
<h2>Milling tool diameter</h2>
The diameter of the milling tool (and thus the <i>Width</i> of the polygon) must
be small enough to fit between any two different signals in order to be able to
isolate them from each other.<br>
<b>Make sure you run a <a href=#46>Design Rule Check</a> (DRC) with
all <i>Clearance</i> values for different signals set to at least the diameter
of your milling tool!</b>
<p>
Non-zero values for the Isolate parameter can be used when working sequentially
with different milling tool diameters in order to avoid areas that have already
been milled.
<h2>Cleaning up</h2>
Make sure that you always delete the _OUTLINES_ polygon after generating the
outlines data. Leaving this polygon in your drawing will cause short circuits
since this special polygon does not adhere to the <a href=#133>Design Rules</a>!


<a name=131>
<h1>Autorouter</h1>
The integrated Autorouter can be started from a board window with the
<a href=#33>AUTO</a> command.
<p>
The Autorouter is also used as "Follow-me" router in the
<a href=#89>ROUTE</a> command.
<p>
Please check your <a href=#358>license</a>
to see whether you have access to the Autorouter module.


<a name=132>
<h1>Design Checks</h1>
There are two integrated commands that allow you to check your design:
<ul>
<li>Electrical Rule Check (<a href=#48>ERC</a>)
<li>Design Rule Check (<a href=#46>DRC</a>)
</ul>
The ERC is performed in a schematic window, and checks the design for
electrical consistency.
<p>
The DRC is performed in a board window, and checks the design for overlaps,
distance violations etc.


<a name=133>
<h1>Design Rules</h1>
<i>Design Rules</i> define all the parameters that the board layout has to follow.
<p>
The <a href=#46>Design Rule Check</a> checks the board against these rules
and reports any violations.
<p>
The Design Rules of a board can be modified through the Design Rules dialog, which
appears if the <a href=#46>DRC</a> command is selected without a terminating
<tt>';'</tt>.
<p>
Newly created boards take their design rules from the file 'default.dru',
which is searched for in the first directory listed in the "Options/Directories/Design rules" path.
If no such file is present, the program's builtin default values apply.
<p>
<b>Note</b> regarding the values for <b>Clearance</b> and <b>Distance</b>: since the internal
resolution of the coordinates is 1/10000mm, the DRC can only reliably report errors that
are larger than 1/10000mm.
<h2>File</h2>
The <i>File</i> tab shows a description of the current set of Design Rules and
allows you to <i>change</i> that description (this is strongly recommended if you define
your own Design Rules). There are also buttons to <i>load</i> a different set of Design
Rules from a disk file and to <i>save</i> the current Design Rules to disk.<br>
Note that the Design Rules are stored within the board file, so they will be in effect
if the board file is sent to a board house for production. The "Load..." and "Save as..."
buttons are merely for copying a board's Design Rules to and from disk.
<p>
If the Design Rules have been modified, the name in the dialog's title will have
trailing asterisk (<tt>'*'</tt>) to mark the Design Rules as modified. This mark
will be removed once the Design Rules are explicitly written to disk, or a new set
of Design Rules is loaded.
<h2>Layers</h2>
The <i>Layers</i> tab defines which signal layers the board actually uses, how thick
the copper and isolation layers are, and what kinds of vias can be placed
(note that this applies only to actual <i>vias</i>; so even if no via from layer 1 to
16 has been defined in the layer setup, <i>pads</i> will always be allowed).
<p>
The layer setup is defined by the string in the "Setup" field. This string consists of
a sequence of layer numbers, separated by one of the characters <tt>'*'</tt> or
<tt>'+'</tt>, where <tt>'*'</tt> stands for <i>core</i> material (also known as <i>FR4</i>
or something similar) and <tt>'+'</tt> stands for <i>prepreg</i> (or any other kind of
isolation material). The actual <i>core</i> and <i>prepreg</i> sequence has no meaning
to EAGLE other than varying the color in the layer display at the top left corner
of this tab (the actual multilayer setup always needs to be worked out with the
board manufacturer). The vias are defined by enclosing a sequence of layers with <tt>(...)</tt>.
So the setup string
<pre>
(1*16)
</pre>
would mean a two layer board, using layers 1 and 16 and vias going through the
entire board (this is also the default value).<br>
When building a multilayer board the setup could be something like
<pre>
((1*2)+(15*16))
</pre>
which is a four layer board with layer pairs 1/2 and 15/16 built on core material
and vias drilled through them, and finally the two layer pairs pressed together
with prepreg between them, and vias drilled all the way through the entire board.<br>
Besides vias that go trough an entire layer stack (which are commonly referred to
as <i>buried</i> vias in case they have no connection to the Top and Bottom layer)
there can also be vias that are not drilled all the way through a layer stack, but
rather end at a layer inside that stack. Such vias are known as <i>blind</i> vias
and are defined in the "Setup" string by enclosing a sequence of layers with
<tt>[t:...:b]</tt>, where <i>t</i> and <i>b</i> are the layers up to which that via
will go from the top or bottom side, respectively. A possible setup with <i>blind</i>
vias could be
<pre>
[2:1+((2*3)+(14*15))+16:15]
</pre>
which is basically the previous example, with two additional outer layers that are
connected to the next inner layers by <i>blind</i> vias. It is also
possible to have only one of the <i>t</i> or <i>b</i> parameters, so for instance
<pre>
[2:1+((2*3)+(15*16))]
</pre>
would also be a valid setup. Finally, <i>blind</i> vias are not limited to starting
at the Top or Bottom layer, but may also be used in inner layer stacks, as in
<pre>
[2:1+[3:2+(3*4)+5:4]+16:5]
</pre>
A <i>blind</i> via from layer <i>a</i> to layer <i>b</i> also implements all possible
<i>blind</i> vias from layer <i>a</i> to all layers between layers <i>a</i> and <i>b</i>, so
<pre>
[3:1+2+(3*16)]
</pre>
would allow <i>blind</i> vias from layer 1 to 2 as well as from 1 to 3.
<h2>Clearance</h2>
The <i>Clearance</i> tab defines the various minimum clearance values between objects
in signal layers. These are usually absolute minimum values that are defined by the
production process used and should be obtained from your board manufacturer.<br>
The actual minimum clearance between objects that belong to different signals will
also be influenced by the <a href=#38>net classes</a> the two signals belong to.
<p>
Note that a polygon in the special signal named _OUTLINES_ will be used to generate
<a href=#130>outlines data</a> and as such will <b>not</b> adhere to these
clearance values.
<h2>Distance</h2>
The <i>Distance</i> tab defines the minimum distance between objects in signal layers
and the board dimensions, as well as that between any two drill holes.
Note that only signals that are actually connected to at least one pad or
smd are checked against the board dimensions. This allows edge markers to be drawn
in the signal layer without generating DRC errors.
<p>
For compatibility with version 3.5x the following applies:
If the minimum distance between copper and dimension is set to <tt>0</tt>
objects in the Dimension layer will not be taken into account when calculating
polygons (except for Holes, which are always taken into account). This also disables
the distance check between copper and dimension objects.
<h2>Sizes</h2>
The <i>Sizes</i> tab defines the minimum width of any objects in signal layers and
the minimum drill diameter. These are usually absolute minimum values that are defined by the
production process used and should be obtained from your board manufacturer.<br>
The actual minimum width of signal wires and drill diameter of vias will
also be influenced by the Net Class the signal belongs to.
<h2>Restring</h2>
The <i>Restring</i> tab defines the width of the copper ring that has to remain after the
pad or via has been drilled. Values are defined in percent of the drill diameter and
there can be an absolute minimum and maximum limit. Restrings for pads can be different
for the top, bottom and inner layers, while for vias they can be different for the
outer and inner layers.<br>
If the actual diameter of a pad (as defined in the library) or a via would result in a
larger restring, that value will be used in the outer layers. Pads in library packages
can have their diameter set to 0, so that the restring will be derived entirely
from the drill diameter.
<h2>Shapes</h2>
The <i>Shapes</i> tab defines the actual shapes for smds and pads.<br>
Smds are normally defined as rectangles in the library (with a "roundness" of 0),
but if your design requires rounded smds you can specify the roundness factor here.<br>
Pads are normally defined as octagons in the library (long octagons where this makes
sense), and you can use the combo boxes to specify whether you want to have
pads with the same shapes as defined in the library, or always square, round or
octagonal. This can be set independently for the top and bottom layer.<br>
If the "first" pad of a package has been marked as such in the library
it will get the shape as defined in the third combo box (either round, square or
octagonal, or no special shape).<br>
The Elongation parameters define the appearance of pads with shape Long or Offset.
<h2>Supply</h2>
The <i>Supply</i> tab defines the dimensions of Thermal and Annulus symbols used in
supply layers.<br>
Please note that the actual shape of supply symbols may be different when generating
output for photoplotters that use specific thermal/annulus apertures!
See also the notes about "Supply Layers" in the <a href=#61>LAYER</a> command.
<h2>Masks</h2>
The <i>Masks</i> tab defines the dimensions of solder stop and cream masks. They are
given in percent of the smaller dimension of smds, pads and vias and can have an
absolute minimum and maximum value.<br>
Solder stop masks are generated for smds, pads and those vias that have a drill diameter
that exceeds the given Limit parameter.<br>
Cream masks are generated for smds only.
<h2>Misc</h2>
The <i>Misc</i> tab allows you to turn on a grid and angle check.
<p>


<a name=134>
<h1>Cross-references</h1>
There are various methods that can be used to create cross-references
in EAGLE schematic drawings. The following sections describe each of them.
<ul>
<li><a href=#135>Cross-reference labels</a>
<li><a href=#136>Part cross-references</a>
<li><a href=#137>Contact cross-references</a>
</ul>


<a name=135>
<h1>Cross-reference labels</h1>
A plain label can be used to make the name of a net visible in a schematic.
If a label has the <i>xref</i> property activated, its behavior is changed
so that it becomes a <i>cross-reference label</i>.
<p>
Cross-reference labels are typically placed at the right or left border of
a schematic sheet, and indicate the next (or previous) sheet a particular net
is used on. See the <a href=#60>LABEL</a> command for a detailed
description of how this works.


<a name=136>
<h1>Part cross-references</h1>
Electrical schematics often use electro-mechanical relays, consisting of a
coil and one or more contact symbols. If the coil and contacts are distributed
over various schematic sheets, it is useful to have each contact indicate
which sheet its coil is on. This can be achieved by giving the coil gate in
the device set an add level of <i>Must</i> (see the <a href=#29>ADD</a>
command) and placing the text variable <tt>'&gt;XREF'</tt> somewhere in the
contacts' symbols (see the <a href=#99>TEXT</a> command).
<p>
When actually displayed, the <tt>'&gt;XREF'</tt> text variable will be replaced
with the sheet number, frame column and row (according to the
<a href=#92>part cross-reference format</a>) of the <i>Must</i>
gate of this device.
<p>
See <a href=#137>Contact cross-references</a> on how
to display the contact locations on the coil's sheet.


<a name=137>
<h1>Contact cross-references</h1>
On a multi-sheet electrical schematic with electro-mechanical relays that
have their coils and contacts distributed over various sheets, it is useful
to be able to see which sheets the individual contacts of a relay are on.
EAGLE can automatically display this <i>contact cross-reference</i> for each
relay coil if the following conditions are met.
<p>
The contact symbols need to contain the <tt>'&gt;XREF'</tt> text variable
in order to generate <a href=#136>part cross-references</a>.
<p>
The gate symbols shall be drawn in a way that the pins extend up and down,
and that the origin is at the center of the symbol.
<p>
The first contact gate in the device set drawing shall be placed at an x-coordinate
of 0, and its y-coordinate shall be high enough to make sure its lower pin is in the
positive area, typically at 100mil. The rest of the contact gates shall be placed
to the right of the first one, with their origins at the same y-coordinate as the
first one. The coil gate can be placed at an arbitrary location.
<p>
In the schematic drawing the contact cross-reference will be shown at the same
x-coordinate as the coil instance, and right below the y-coordinate defined
by the text variable <tt>'&gt;CONTACT_XREF'</tt>. This text variable can be
defined either in a drawing frame symbol or directly on the sheet. If it is
present in both, the one in the sheet is taken. The actual text will not be visible
in the schematic sheet.
<p>
The graphical representation of the contact cross-reference consists of all the
gates that have an <tt>'&gt;XREF'</tt> text variable (except for the first <i>Must</i>
gate, which is the coil and typically doesn't have this variable). The gates are
rotated by 90 degrees and are shown from top to bottom at the same offsets
as they have been drawn from left to right in the device set. Their sheet numbers and
frame locations are displayed to the right of each gate that is actually used.
Any other texts that have been defined in the symbol drawings will not be
displayed when using these symbols for generating the contact cross-reference.
<p>
Note that the contact cross-reference can't be selected with the mouse. If you
want to move it, move the coil instance and the contact cross-reference will
automatically follow it.
The contact cross-reference may get out of sync in case contact gates are
invoked, moved, deleted or swapped, or if the <tt>'&gt;CONTACT_XREF'</tt> text
variable is modified. This will automatically be updated at the next window refresh.


<a name=138>
<h1>User Language</h1>
The EAGLE User Language can be used to access the EAGLE data structures
and to create a wide variety of output files.
<p>
To use this feature you have to
<a href=#139>write a User Language Program (ULP)</a>,
and then <a href=#140>execute</a> it.
<p>
The following sections describe the EAGLE User Language in detail:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#141>Syntax</a>             </td><td width=20><td>lists the rules a ULP file has to follow</td></tr>
<tr><td><a href=#164>Data Types</a>         </td><td width=20><td>defines the basic data types</td></tr>
<tr><td><a href=#171>Object Types</a>       </td><td width=20><td>defines the EAGLE objects</td></tr>
<tr><td><a href=#210>Definitions</a>        </td><td width=20><td>shows how to write a definition</td></tr>
<tr><td><a href=#214>Operators</a>          </td><td width=20><td>lists the valid operators</td></tr>
<tr><td><a href=#221>Expressions</a>        </td><td width=20><td>shows how to write expressions</td></tr>
<tr><td><a href=#228>Statements</a>         </td><td width=20><td>defines the valid statements</td></tr>
<tr><td><a href=#240>Builtins</a> </td><td width=20><td>lists the builtin constants, functions etc.</td></tr>
<tr><td><a href=#314>Dialogs</a> </td><td width=20><td>shows how to implement a graphical frontent to a ULP</td></tr>
</table>


<a name=139>
<h1>Writing a ULP</h1>
A User Language Program is a plain text file which is written in a C-like
<a href=#141>syntax</a>.
User Language Programs use the extension <tt>.ulp</tt>.
You can create a ULP file with any text editor (provided it does
not insert any additional control characters into the file) or you can
use the <a href=#26>builtin text editor</a>.
<p>
A User Language Program consists of two major items,
<a href=#210>definitions</a> and
<a href=#228>statements</a>.
<p>
<a href=#210>Definitions</a> are used to define constants,
variables and functions to be used by <a href=#228>statements</a>.
<p>
A simple ULP could look like this:
<pre>
#usage "Add the characters in the word 'Hello'\n"
       "Usage: RUN sample.ulp"
// Definitions:
string hello = "Hello";
int count(string s)
{
  int c = 0;
  for (int i = 0; s[i]; ++i)
      c += s[i];
  return c;
}
// Statements:
output("sample") {
  printf("Count is: %d\n", count(hello));
  }
</pre>
If the <tt><a href=#147>#usage</a></tt> directive is present,
its value will be used in the <a href=#12>Control Panel</a> to display a description
of the program.
<p>
If the result of the ULP shall be a specific command that shall be executed in the
editor window, the <tt><a href=#262>exit()</a></tt> function can be
used to send that command to the editor window.


<a name=140>
<h1>Executing a ULP</h1>
User Language Programs are executed by the
<a href=#90>RUN</a> command from an editor window's command line.
<p>
A ULP can return information on whether it has run successfully or not.
You can use the <tt><a href=#262>exit()</a></tt> function to terminate
the program and set the return value.
<p>
A return value of <tt>0</tt> means the ULP has ended "normally" (i.e.
successfully), while any other value is considered as an abnormal
program termination.
<p>
The default return value of any ULP is <tt>0</tt>.
<p>
When the <a href=#90>RUN</a> command is executed as part of a
<a href=#91>script file</a>, the script is terminated if
the ULP has exited with a return value other than <tt>0</tt>.
<p>
A special variant of the <tt><a href=#262>exit()</a></tt> function can be
used to send a command to the editor window as a result of the ULP.


<a name=141>
<h1>Syntax</h1>
The basic building blocks of a User Language Program are
<ul>
<li><a href=#142>Whitespace</a>
<li><a href=#143>Comments</a>
<li><a href=#144>Directives</a>
<li><a href=#148>Keywords</a>
<li><a href=#149>Identifiers</a>
<li><a href=#150>Constants</a>
<li><a href=#156>Punctuators</a>
</ul>
All of these have to follow certain syntactical rules, which are
described in their respective sections.


<a name=142>
<h1>Whitespace</h1>
Before a User Language Program can be executed, it has to be read in from
a file. During this read in process, the file contents is <i>parsed</i>
into tokens and <i>whitespace</i>.
<p>
Any spaces (blanks), tabs, newline characters and
<a href=#143>comments</a> are considered <i>whitespace</i>
and are discarded.
<p>
The only place where ASCII characters representing <i>whitespace</i>
are not discarded is within <a href=#150>literal strings</a>,
like in
<pre>
string s = "Hello World";
</pre>
where the blank character between <tt>'o'</tt> and <tt>'W'</tt> remains part
of the string.
<p>
If the final newline character of a line is preceded by a backslash
(<tt>\</tt>), the backslash and newline character are both discarded,
and the two lines are treated as one line:
<pre>
"Hello \
World"
</pre>
is parsed as <tt>"Hello World"</tt>


<a name=143>
<h1>Comments</h1>
When writing a User Language Program it is good practice to add some
descriptive text, giving the reader an idea about what this particular
ULP does. You might also want to add your name (and, if available, your
email address) to the ULP file, so that other people who use your program
could contact you in case they have a problem or would like to suggest
an improvement.
<p>
There are two ways to define a comment. The first one uses the syntax
<pre>
/* some comment text */
</pre>
which marks any characters between (and including) the opening
<tt>/*</tt> and the closing <tt>*/</tt> as comment. Such comments may expand over
more than one lines, as in
<pre>
/* This is a
   multi line comment
*/
</pre>
but they do not nest. The first <tt>*/</tt> that follows any <tt>/*</tt>
will end the comment.
<p>
The second way to define a comment uses the syntax
<pre>
int i; // some comment text
</pre>
which marks any characters after (and including) the <tt>//</tt> and up
to (but not including) the newline character at the end of the line as
comment.


<a name=144>
<h1>Directives</h1>
The following <i>directives</i> are available:
<pre>
<a href=#145>#include</a>
<a href=#146>#require</a>
<a href=#147>#usage</a>
</pre>


<a name=145>
<h1>#include</h1>
A User Language Program can reuse code in other ULP files through the <tt>#include</tt>
directive. The syntax is
<pre>
#include "<i>filename</i>"
</pre>
The file <tt>filename</tt> is first looked for in the same directory as
the current source file (that is the file that contains the <tt>#include</tt>
directive). If it is not found there, it is searched for in
the directories contained in the ULP directory path.
<p>
The maximum include depth is 10.
<p>
Each <tt>#include</tt> directive is processed only <b>once</b>. This makes sure
that there are no multiple definitions of the same variables or functions, which
would cause errors.
<h2>Portability note</h2>
<table><tr><td valign="top"><img src="platforms-win.png"></td><td valign="middle">
If <i>filename</i> contains a directory path, it is best to always use the
<b>forward slash</b> as directory separator (even under Windows!). Windows drive
letters should be avoided. This way a User Language Program will run on all
platforms.
</td></tr></table>


<a name=146>
<h1>#require</h1>
Over time it may happen that newer versions of EAGLE implement new or modified
User Language features, which can cause error messages when such a ULP is run
from an older version of EAGLE. In order to give the user a dedicated message
that this ULP requires at least a certain version of EAGLE, a ULP can contain
the <tt>#require</tt> directive. The syntax is
<pre>
#require <i>version</i>
</pre>
The <i>version</i> must be given as a <a href=#153>real constant</a>
of the form
<pre>
V.RRrr
</pre>
where <tt>V</tt> is the version number, <tt>RR</tt> is the release number
and <tt>rr</tt> is the (optional) revision number (both padded with leading
zeros if they are less than 10). For example, if a ULP
requires at least EAGLE version 4.11r06 (which is the beta version that first
implemented the <tt>#require</tt> directive), it could use
<pre>
#require 4.1106
</pre>
The proper directive for version 5.1.2 would be
<pre>
#require 5.0102
</pre>


<a name=147>
<h1>#usage</h1>
Every User Language Program should contain information about its function, how
to use it and maybe who wrote it.<br>
The directive
<pre>
#usage <i>text</i> [, <i>text</i>...]
</pre>
implements a standard way to make this information available.
<p>
If the <tt>#usage</tt> directive is present,
its <tt>text</tt> (which has to be a <a href=#154>string constant</a>)
will be used in the <a href=#12>Control Panel</a> to display a description
of the program.
<p>
In case the ULP needs to use this information in, for example, a
<a href=#318>dlgMessageBox()</a>, the <tt>text</tt> is available
to the program through the <a href=#241>builtin constant</a>
<tt>usage</tt>.
<p>
Only the <tt>#usage</tt> directive of the main program file (that is the one
started with the <a href=#90>RUN</a> command) will take effect.
Therefore pure <a href=#145>include</a> files can (and should!)
also have <tt>#usage</tt> directives of their own.
<p>
It is best to have the <tt>#usage</tt> directive at the beginning of the file,
so that the Control Panel doesn't have to parse all the rest of the text when
looking for the information to display.
<p>
If the usage information shall be made available in several langauges, the
texts of the individual languages have to be separated by commas.
Each of these texts has to start with the two letter code of the respective
language (as delivered by the <a href=#264>language()</a> function),
followed by a colon and any number of blanks. If no suitable text is found for
the language used on the actual system, the first given text will be used (this
one should generally be English in order to make the program accessible to the
largest number of users).
<h2>Example</h2>
<pre>
#usage "en: A sample ULP\n"
           "Implements an example that shows how to use the EAGLE User Language\n"
           "Usage: RUN sample.ulp\n"
           "Author: john@home.org",
       "de: Beispiel eines ULPs\n"
           "Implementiert ein Beispiel das zeigt, wie man die EAGLE User Language benutzt\n"
           "Aufruf: RUN sample.ulp\n"
           "Author: john@home.org"
</pre>


<a name=148>
<h1>Keywords</h1>
The following <i>keywords</i> are reserved for special purposes
and must not be used as normal identifier names:
<pre>
<a href=#232>break</a>
<a href=#238>case</a>
<a href=#165>char</a>
<a href=#233>continue</a>
<a href=#238>default</a>
<a href=#234>do</a>
<a href=#236>else</a>
<a href=#211>enum</a>
<a href=#235>for</a>
<a href=#236>if</a>
<a href=#166>int</a>
<a href=#212>numeric</a>
<a href=#167>real</a>
<a href=#237>return</a>
<a href=#168>string</a>
<a href=#238>switch</a>
<a href=#164>void</a>
<a href=#239>while</a>
</pre>
In addition, the names of
<a href=#240>builtins</a> and
<a href=#171>object types</a>
are also reserved and must not be used as identifier names.


<a name=149>
<h1>Identifiers</h1>
An <i>identifier</i> is a name that is used to introduce a user defined
<a href=#211>constant</a>,
<a href=#212>variable</a> or
<a href=#213>function</a>.
<p>
Identifiers consist of a sequence of letters (<tt>a b c</tt>..., <tt>A B C</tt>...),
digits (<tt>1 2 3</tt>...) and underscores (<tt>_</tt>). The first character
of an identifier <b>must</b> be a letter or an underscore.
<p>
Identifiers are case-sensitive, which means that
<pre>
int Number, number;
</pre>
would define two <b>different</b> integer variables.
<p>
The maximum length of an identifier is 100 characters, and all of these
are significant.


<a name=150>
<h1>Constants</h1>
Constants are literal data items written into a User Language Program.
According to the different <a href=#164>data types</a>,
there are also different types of constants.
<ul>
<li><a href=#151>Character constants</a>
<li><a href=#152>Integer constants</a>
<li><a href=#153>Real constants</a>
<li><a href=#154>String constants</a>
</ul>


<a name=151>
<h1>Character Constants</h1>
A <i>character constant</i> consists of a single character or
an <a href=#155>escape sequence</a> enclosed in
single quotes, like
<pre>
'a'
'='
'\n'
</pre>
The type of a character constant is
<tt><a href=#165>char</a></tt>.


<a name=152>
<h1>Integer Constants</h1>
Depending on the first (and possibly the second) character, an
<i>integer constant</i> is assumed to be expressed in different
base values:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>first</td>        <td width=20><td>second</td>       <td width=20><td>constant interpreted as</td></tr>
<tr><td><tt>0</tt></td>   <td width=20><td><tt>1-7</tt></td> <td width=20><td>octal (base 8)</td></tr>
<tr><td><tt>0</tt></td>   <td width=20><td><tt>x,X</tt></td> <td width=20><td>hexadecimal (base 16)</td></tr>
<tr><td><tt>1-9</tt></td> <td width=20><td>            </td> <td width=20><td>decimal (base 10)</td></tr>
</table>
<p>
The type of an integer constant is
<tt><a href=#166>int</a></tt>.
<h2>Examples</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>16</tt>      </td><td width=20><td>decimal</td></tr>
<tr><td><tt>020</tt>     </td><td width=20><td>octal</td></tr>
<tr><td><tt>0x10</tt>    </td><td width=20><td>hexadecimal</td></tr>
</table>


<a name=153>
<h1>Real Constants</h1>
A <i>real constant</i> follows the general pattern
<pre>
[-]<i>int</i>.<i>frac</i>[e|E[&plusmn;]<i>exp</i>]
</pre>
which stands for
<ul>
<li>optional sign
<li>decimal integer
<li>decimal point
<li>decimal fraction
<li><tt>e</tt> or <tt>E</tt> and a signed integer exponent
</ul>
You can omit either the decimal integer or the decimal fraction
(but not both). You can omit either the decimal point or the
letter <tt>e</tt> or <tt>E</tt> and the signed integer exponent
(but not both).
<p>
The type of an real constant is
<tt><a href=#167>real</a></tt>.
<h2>Examples</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Constant   </td><td width=20><td>Value</td></tr>
<tr><td><tt>23.45e6</tt>    </td><td width=20><td>23.45 x 10^6</td></tr>
<tr><td><tt>.0</tt>         </td><td width=20><td>0.0</td></tr>
<tr><td><tt>0.</tt>         </td><td width=20><td>0.0</td></tr>
<tr><td><tt>1.</tt>         </td><td width=20><td>1.0</td></tr>
<tr><td><tt>-1.23</tt>      </td><td width=20><td>-1.23</td></tr>
<tr><td><tt>2e-5</tt>       </td><td width=20><td>2.0 x 10^-5</td></tr>
<tr><td><tt>3E+10</tt>      </td><td width=20><td>3.0 x 10^10</td></tr>
<tr><td><tt>.09E34</tt>     </td><td width=20><td>0.09 x 10^34</td></tr>
</table>


<a name=154>
<h1>String Constants</h1>
A <i>string constant</i> consists of a sequence of characters or
<a href=#155>escape sequences</a> enclosed in
double quotes, like
<pre>
"Hello world\n"
</pre>
The type of a string constant is
<tt><a href=#168>string</a></tt>.
<p>
String constants can be of any length (provided there is enough free memory
available).
<p>
String constants can be concatenated by simply writing them next to each other
to form larger strings:
<pre>
string s = "Hello" " world\n";
</pre>
It is also possible to extend a string constant over more than one line
by escaping the newline character with a backslash (<tt>\</tt>):
<pre>
string s = "Hello \
world\n";
</pre>


<a name=155>
<h1>Escape Sequences</h1>
An <i>escape sequence</i> consists of a backslash (<tt>\</tt>), followed
by one or more special characters:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Sequence   </td><td width=20><td>Value</td></tr>
<tr><td><tt>\a</tt>  </td><td width=20><td>audible bell</td></tr>
<tr><td><tt>\b</tt>  </td><td width=20><td>backspace</td></tr>
<tr><td><tt>\f</tt>  </td><td width=20><td>form feed</td></tr>
<tr><td><tt>\n</tt>  </td><td width=20><td>new line</td></tr>
<tr><td><tt>\r</tt>  </td><td width=20><td>carriage return</td></tr>
<tr><td><tt>\t</tt>  </td><td width=20><td>horizontal tab</td></tr>
<tr><td><tt>\v</tt>  </td><td width=20><td>vertical tab</td></tr>
<tr><td><tt>\\</tt>  </td><td width=20><td>backslash</td></tr>
<tr><td><tt>\'</tt>  </td><td width=20><td>single quote</td></tr>
<tr><td><tt>\"</tt>  </td><td width=20><td>double quote</td></tr>
<tr><td><tt>\O</tt>  </td><td width=20><td><tt>O</tt> = up to 3 octal digits</td></tr>
<tr><td><tt>\xH</tt> </td><td width=20><td><tt>H</tt> = up to 2 hex digits</td></tr>
</table>
<p>
Any character following the initial backslash that is not mentioned in
this list will be treated as that character (without the backslash).
<p>
Escape sequences can be used in
<a href=#151>character constants</a> and
<a href=#154>string constants</a>.
<h2>Examples</h2>
<pre>
'\n'
"A tab\tinside a text\n"
"Ring the bell\a\n"
</pre>


<a name=156>
<h1>Punctuators</h1>
The <i>punctuators</i> used in a User Language Program are
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>[]</tt>  </td><td width=20><td><a href=#157>Brackets</a></td></tr>
<tr><td><tt>()</tt>  </td><td width=20><td><a href=#158>Parentheses</a></td></tr>
<tr><td><tt>{}</tt>  </td><td width=20><td><a href=#159>Braces</a></td></tr>
<tr><td><tt>,</tt>   </td><td width=20><td><a href=#160>Comma</a></td></tr>
<tr><td><tt>;</tt>   </td><td width=20><td><a href=#161>Semicolon</a></td></tr>
<tr><td><tt>:</tt>   </td><td width=20><td><a href=#162>Colon</a></td></tr>
<tr><td><tt>=</tt>   </td><td width=20><td><a href=#163>Equal sign</a></td></tr>
</table>
<p>
Other special characters are used as <a href=#214>operators</a>
in a ULP.


<a name=157>
<h1>Brackets</h1>
<i>Brackets</i> are used in array definitions
<pre>
int ai[];
</pre>
in array subscripts
<pre>
n = ai[2];
</pre>
and in string subscripts to access the individual characters of a string
<pre>
string s = "Hello world";
char c = s[2];
</pre>


<a name=158>
<h1>Parentheses</h1>
<i>Parentheses</i> group <a href=#221>expressions</a>
(possibly altering normal
<a href=#214>operator</a> precedence), isolate conditional
expressions, and indicate
<a href=#227>function calls</a> and function parameters:
<pre>
d = c * (a + b);
if (d == z) ++x;
func();
void func2(int n) { ... }
</pre>


<a name=159>
<h1>Braces</h1>
<i>Braces</i> indicate the start and end of a compound statement:
<pre>
if (d == z) {
   ++x;
   func();
   }
</pre>
and are also used to group the values of an array initializer:
<pre>
int ai[] = { 1, 2, 3 };
</pre>


<a name=160>
<h1>Comma</h1>
The <i>comma</i> separates the elements of a function argument list
or the parameters of a function call:
<pre>
int func(int n, real r, string s) { ... }
int i = func(1, 3.14, "abc");
</pre>
It also delimits the values of an array initializer:
<pre>
int ai[] = { 1, 2, 3 };
</pre>
and it separates the elements of a variable definition:
<pre>
int i, j, k;
</pre>


<a name=161>
<h1>Semicolon</h1>
The <i>semicolon</i> terminates a <a href=#228>statement</a>,
as in
<pre>
i = a + b;
</pre>
and it also delimits the init, test and increment expressions of a
<a href=#235>for</a> statement:
<pre>
for (int n = 0; n &lt; 3; ++n) {
    func(n);
    }
</pre>


<a name=162>
<h1>Colon</h1>
The <i>colon</i> indicates the end of a label in a
<a href=#238>switch</a> statement:
<pre>
switch (c) {
  case 'a': printf("It was an 'a'\n"); break;
  case 'b': printf("It was a  'b'\n"); break;
  default:  printf("none of them\n");
  }
</pre>


<a name=163>
<h1>Equal Sign</h1>
The <i>equal sign</i> separates variable definitions from initialization
lists:
<pre>
int i = 10;
char c[] = { 'a', 'b', 'c' };
</pre>
It is also used as an <a href=#219>assignment operator</a>.


<a name=164>
<h1>Data Types</h1>
A User Language Program can define variables of different types, representing
the different kinds of information available in the EAGLE data structures.
<p>
The four basic data types are
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt><a href=#165>char</a></tt>  </td><td width=20><td>for single characters</td></tr>
<tr><td><tt><a href=#166>int</a></tt>  </td><td width=20><td>for integral values</td></tr>
<tr><td><tt><a href=#167>real</a></tt>  </td><td width=20><td>for floating point values</td></tr>
<tr><td><tt><a href=#168>string</a></tt>  </td><td width=20><td>for textual information</td></tr>
</table>
<p>
Besides these basic data types there are also high level
<a href=#171>Object Types</a>, which
represent the data structures stored in the EAGLE data files.
<p>
The special data type <tt>void</tt> is used only as a return type of a
<a href=#213>function</a>, indicating that this
function does <b>not</b> return any value.


<a name=165>
<h1>char</h1>
The data type <tt>char</tt> is used to store single characters, like the
letters of the alphabet, or small unsigned numbers.
<p>
A variable of type <tt>char</tt> has a size of 8 bit (one byte), and can
store any value in the range <tt>0..255</tt>.
<p>
<b>See also</b> <a href=#214>Operators</a>,
<a href=#151>Character Constants</a>


<a name=166>
<h1>int</h1>
The data type <tt>int</tt> is used to store signed integral values, like the
coordinates of an object.
<p>
A variable of type <tt>int</tt> has a size of 32 bit (four byte), and can
store any value in the range <tt>-2147483648..2147483647</tt>.
<p>
<b>See also</b> <a href=#152>Integer Constants</a>


<a name=167>
<h1>real</h1>
The data type <tt>real</tt> is used to store signed floating point values, like
the grid distance.
<p>
A variable of type <tt>real</tt> has a size of 64 bit (eight byte), and can
store any value in the range <tt>&plusmn;2.2e-308..&plusmn;1.7e+308</tt> with a
precision of 15 digits.
<p>
<b>See also</b> <a href=#153>Real Constants</a>


<a name=168>
<h1>string</h1>
The data type <tt>string</tt> is used to store textual information,
like the name of a part or net.
<p>
A variable of type <tt>string</tt> is not limited in it's size (provided
there is enough memory available).
<p>
Variables of type <tt>string</tt> are defined without an explicit
<i>size</i>. They grow automatically as necessary during program
execution.
<p>
The elements of a <tt>string</tt> variable are of type
<tt><a href=#165>char</a></tt> and
can be accessed individually by using <tt>[index]</tt>.
The first character of a <tt>string</tt> has the index <tt>0</tt>:
<pre>
string s = "Layout";
printf("Third char is: %c\n", s[2]);
</pre>
This would print the character <tt>'y'</tt>. Note that <tt>s[2]</tt> returns
the <b>third</b> character of <tt>s</tt>!
<p>
<b>See also</b> <a href=#214>Operators</a>,
<a href=#243>Builtin Functions</a>,
<a href=#154>String Constants</a>
<h2>Implementation details</h2>
The data type <tt>string</tt> is actually implemented like native C-type
zero terminated strings (i.e. <tt>char[]</tt>). Looking at the following
variable definition
<pre>
string s = "abcde";
</pre>
<tt>s[4]</tt> is the character <tt>'e'</tt>, and <tt>s[5]</tt> is the character
<tt>'\0'</tt>, or the integer value <tt>0x00</tt>.
This fact may be used to determine the end of a string without using the
<tt><a href=#281>strlen()</a></tt> function, as in
<pre>
for (int i = 0; s[i]; ++i) {
    // do something with s[i]
    }
</pre>
It is also perfectly ok to "cut off" part of a string by "punching" a zero
character into it:
<pre>
string s = "abcde";
s[3] = 0;
</pre>
This will result in <tt>s</tt> having the value <tt>"abc"</tt>.
Note that everything following the zero character will actually be gone,
and it won't come back by restoring the original character. The same applies
to any other operation that sets a character to 0, for instance --s[3].


<a name=169>
<h1>Type Conversions</h1>
The result type of an arithmetic
<a href=#221>expression</a>, such as <tt>a + b</tt>,
where <tt>a</tt> and <tt>b</tt> are different arithmetic types,
is equal to the "larger" of the two operand types.
<p>
Arithmetic types are
<tt><a href=#165>char</a></tt>,
<tt><a href=#166>int</a></tt> and
<tt><a href=#167>real</a></tt>
(in that order). So if, e.g. <tt>a</tt> is of type
<tt><a href=#166>int</a></tt>
and <tt>b</tt> is of type
<tt><a href=#167>real</a></tt>,
the result of the expression <tt>a + b</tt> would be
<tt><a href=#167>real</a></tt>.
<p>
<b>See also</b> <a href=#170>Typecast</a>


<a name=170>
<h1>Typecast</h1>
The result type of an arithmetic <a href=#221>expression</a>
can be explicitly converted to a different arithmetic type by applying a
<i>typecast</i> to it.
<p>
The general syntax of a typecast is
<pre>
type(expression)
</pre>
where <tt>type</tt> is one of
<tt><a href=#165>char</a></tt>,
<tt><a href=#166>int</a></tt> or
<tt><a href=#167>real</a></tt>,
and <tt>expression</tt> is any arithmetic
<a href=#221>expression</a>.
<p>
When typecasting a <tt><a href=#167>real</a></tt> expression to
<tt><a href=#166>int</a></tt>, the fractional part of the value
is truncated!
<p>
<b>See also</b> <a href=#169>Type Conversions</a>


<a name=171>
<h1>Object Types</h1>
The EAGLE data structures are stored in three binary file types:
<ul>
<li>Library (*.lbr)
<li>Schematic (*.sch)
<li>Board (*.brd)
</ul>
These data files contain a hierarchy of objects.
In a User Language Program you can access these hierarchies through their
respective builtin access statements:
<pre>
<a href=#308>library</a>(L) { ... }
<a href=#311>schematic</a>(S) { ... }
<a href=#306>board</a>(B) { ... }
</pre>
These access statements set up a context within which you can access all of the
objects contained in the library, schematic or board.
<p>
The properties of these objects can be accessed through <i>members</i>.
<p>
There are two kinds of members:
<ul>
<li>Data members
<li>Loop members
</ul>
<b>Data members</b> immediately return the requested data from an object.
For example, in
<pre>
board(B) {
  printf("%s\n", B.name);
  }
</pre>
the data member <i>name</i> of the board object <i>B</i> returns
the board's name.<br>
Data members can also return other objects, as in
<pre>
board(B) {
  printf("%f\n", B.grid.size);
  }
</pre>
where the board's <i>grid</i> data member returns a grid object,
of which the <i>size</i> data member then returns the grid's size.
<p>
<b>Loop members</b> are used to access multiple objects of the same
kind, which are contained in a higher level object:
<pre>
board(B) {
  B.elements(E) {
    printf("%-8s %-8s\n", E.name, E.value);
    }
  }
</pre>
This example uses the board's <i>elements()</i> loop member function
to set up a loop through all of the board's elements. The block following
the <tt>B.elements(E)</tt> statement is executed in turn for each element,
and the current element can be referenced inside the block through the name
<tt>E</tt>.
<p>
Loop members process objects in alpha-numerical order, provided they
have a name.
<p>
A loop member function creates a variable of the type necessary to hold
the requested objects. You are free to use any valid name for such a
variable, so the above example might also be written as
<pre>
board(MyBoard) {
  MyBoard.elements(TheCurrentElement) {
    printf("%-8s %-8s\n", TheCurrentElement.name, TheCurrentElement.value);
    }
  }
</pre>
and would do the exact same thing. The scope of the variable created by a
loop member function is limited to the statement (or block) immediately
following the loop function call.
<p>
Object hierarchy of a Library:
<pre>
<a href=#192>LIBRARY</a>
  <a href=#186>GRID</a>
  <a href=#191>LAYER</a>
  <a href=#182>DEVICESET</a>
    <a href=#181>DEVICE</a>
    <a href=#185>GATE</a>
  <a href=#194>PACKAGE</a>
    <a href=#179>CONTACT</a>
      <a href=#195>PAD</a>
      <a href=#205>SMD</a>
    <a href=#177>CIRCLE</a>
    <a href=#187>HOLE</a>
    <a href=#200>RECTANGLE</a>
    <a href=#184>FRAME</a>
    <a href=#207>TEXT</a>
    <a href=#209>WIRE</a>
    <a href=#199>POLYGON</a>
      <a href=#209>WIRE</a>
  <a href=#206>SYMBOL</a>
    <a href=#197>PIN</a>
    <a href=#177>CIRCLE</a>
    <a href=#200>RECTANGLE</a>
    <a href=#184>FRAME</a>
    <a href=#207>TEXT</a>
    <a href=#209>WIRE</a>
    <a href=#199>POLYGON</a>
      <a href=#209>WIRE</a>
</pre>
Object hierarchy of a Schematic:
<pre>
<a href=#201>SCHEMATIC</a>
  <a href=#186>GRID</a>
  <a href=#191>LAYER</a>
  <a href=#192>LIBRARY</a>
  <a href=#203>SHEET</a>
    <a href=#177>CIRCLE</a>
    <a href=#200>RECTANGLE</a>
    <a href=#184>FRAME</a>
    <a href=#207>TEXT</a>
    <a href=#209>WIRE</a>
    <a href=#199>POLYGON</a>
      <a href=#209>WIRE</a>
    <a href=#196>PART</a>
      <a href=#188>INSTANCE</a>
        <a href=#174>ATTRIBUTE</a>
    <a href=#176>BUS</a>
      <a href=#202>SEGMENT</a>
        <a href=#190>LABEL</a>
          <a href=#207>TEXT</a>
          <a href=#209>WIRE</a>
        <a href=#209>WIRE</a>
    <a href=#193>NET</a>
      <a href=#202>SEGMENT</a>
        <a href=#189>JUNCTION</a>
        <a href=#198>PINREF</a>
        <a href=#207>TEXT</a>
        <a href=#209>WIRE</a>
</pre>
Object hierarchy of a Board:
<pre>
<a href=#175>BOARD</a>
  <a href=#186>GRID</a>
  <a href=#191>LAYER</a>
  <a href=#192>LIBRARY</a>
  <a href=#177>CIRCLE</a>
  <a href=#187>HOLE</a>
  <a href=#200>RECTANGLE</a>
  <a href=#184>FRAME</a>
  <a href=#207>TEXT</a>
  <a href=#209>WIRE</a>
  <a href=#199>POLYGON</a>
    <a href=#209>WIRE</a>
  <a href=#183>ELEMENT</a>
    <a href=#174>ATTRIBUTE</a>
  <a href=#204>SIGNAL</a>
    <a href=#180>CONTACTREF</a>
    <a href=#199>POLYGON</a>
      <a href=#209>WIRE</a>
    <a href=#208>VIA</a>
    <a href=#209>WIRE</a>
</pre>


<a name=172>
<h1>UL_ARC</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle1</tt>       </td><td width=20><td><a href=#167>real</a> (start angle, <tt>0.0</tt>...<tt>359.9</tt>)</td></tr>
<tr><td><tt>angle2</tt>       </td><td width=20><td><a href=#167>real</a> (end angle, <tt>0.0</tt>...<tt>719.9</tt>)</td></tr>
<tr><td><tt>cap</tt>          </td><td width=20><td><a href=#166>int</a> (<tt>CAP_...</tt>)</td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>radius</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>width</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x1, y1</tt>       </td><td width=20><td><a href=#166>int</a> (starting point)</td></tr>
<tr><td><tt>x2, y2</tt>       </td><td width=20><td><a href=#166>int</a> (end point)</td></tr>
<tr><td><tt>xc, yc</tt>       </td><td width=20><td><a href=#166>int</a> (center point)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#209>UL_WIRE</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>CAP_FLAT</tt>  </td><td width=20><td>flat arc ends</td></tr>
<tr><td><tt>CAP_ROUND</tt>   </td><td width=20><td>round arc ends</td></tr>
</table>
<h2>Note</h2>
Start and end angles are defined mathematically positive (i.e. counterclockwise),
with <tt>angle1</tt> &lt; <tt>angle2</tt>.
In order to assure this condition, the start and end point of an UL_ARC may be exchanged
with respect to the UL_WIRE the arc has been derived from.
<h2>Example</h2>
<pre>
board(B) {
  B.wires(W) {
    if (W.arc)
       printf("Arc: (%d %d), (%d %d), (%d %d)\n",
              W.arc.x1, W.arc.y1, W.arc.x2, W.arc.y2, W.arc.xc, W.arc.yc);
    }
  }
</pre>


<a name=173>
<h1>UL_AREA</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>x1, y1</tt>       </td><td width=20><td><a href=#166>int</a> (lower left corner)</td></tr>
<tr><td><tt>x2, y2</tt>       </td><td width=20><td><a href=#166>int</a> (upper right corner)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#181>UL_DEVICE</a>,
<a href=#194>UL_PACKAGE</a>,
<a href=#203>UL_SHEET</a>,
<a href=#206>UL_SYMBOL</a>
<p>
A UL_AREA is an abstract object which gives information about the area
covered by an object. For a UL_DEVICE, UL_PACKAGE and UL_SYMBOL the area
is defined as the surrounding rectangle of the object definition in the
library, so even if e.g. a UL_PACKAGE is derived from a UL_ELEMENT, the
package's area will not reflect the elements offset within the board.
<h2>Example</h2>
<pre>
board(B) {
  printf("Area: (%d %d), (%d %d)\n",
          B.area.x1, B.area.y1, B.area.x2, B.area.y2);
  }
</pre>


<a name=174>
<h1>UL_ATTRIBUTE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>constant</tt>    </td><td width=20><td><a href=#166>int</a> (0=variable, i.e. allows overwriting, 1=constant - see note)</td></tr>
<tr><td><tt>defaultvalue</tt> </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>display</tt>      </td><td width=20><td><a href=#166>int</a> (<tt>ATTRIBUTE_DISPLAY_FLAG_...</tt>)</td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>text</tt>         </td><td width=20><td><a href=#207>UL_TEXT</a> (see note)</td></tr>
<tr><td><tt>value</tt>        </td><td width=20><td><a href=#168>string</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#181>UL_DEVICE</a>,
<a href=#196>UL_PART</a>,
<a href=#188>UL_INSTANCE</a>,
<a href=#183>UL_ELEMENT</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>ATTRIBUTE_DISPLAY_FLAG_OFF</tt>   </td><td width=20><td>nothing is displayed</td></tr>
<tr><td><tt>ATTRIBUTE_DISPLAY_FLAG_VALUE</tt>   </td><td width=20><td>value is displayed</td></tr>
<tr><td><tt>ATTRIBUTE_DISPLAY_FLAG_NAME</tt>    </td><td width=20><td>name is displayed</td></tr>
</table>
<p>
A UL_ATTRIBUTE can be used to access the <i>attributes</i> that have been
defined in the library for a device, or assigned to a part in the schematic
or board.
<h2>Note</h2>
<tt>display</tt> contains a bitwise or'ed value consisting of <tt>ATTRIBUTE_DISPLAY_FLAG_...</tt>
and defines which parts of the attribute are actually drawn.
This value is only valid if <tt>display</tt> is used in a UL_INSTANCE or UL_ELEMENT
context.
<p>
In a UL_ELEMENT context <tt>constant</tt> only returns an actual value if
f/b annotation is active, otherwise it returns 0.
<p>
The <tt>defaultvalue</tt> member returns the value as defined in the library
(if different from the actual value, otherwise the same as <tt>value</tt>).
In a UL_ELEMENT context <tt>defaultvalue</tt> only returns an actual value if
f/b annotation is active, otherwise an empty string is returned.
<p>
The <tt>text</tt> member is only available in a UL_INSTANCE or UL_ELEMENT
context and returns a UL_TEXT object that contains all the text parameters.
The value of this text object is the string as it will be displayed according to
the UL_ATTRIBUTE's 'display' parameter. If called from a different context,
the data of the returned UL_TEXT object is undefined.
<p>
For global attributes only <tt>name</tt> and <tt>value</tt> are defined.
<h2>Example</h2>
<pre>
schematic(SCH) {
  SCH.parts(P) {
    P.attributes(A) {
      printf("%s = %s\n", A.name, A.value);
      }
    }
  }
schematic(SCH) {
  SCH.attributes(A) { // global attributes
    printf("%s = %s\n", A.name, A.value);
    }
  }
</pre>


<a name=175>
<h1>UL_BOARD</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>area</tt>         </td><td width=20><td><a href=#173>UL_AREA</a></td></tr>
<tr><td><tt>grid</tt>         </td><td width=20><td><a href=#186>UL_GRID</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>attributes()</tt>  </td><td width=20><td><a href=#174>UL_ATTRIBUTE</a> (see note)</td></tr>
<tr><td><tt>circles()</tt>    </td><td width=20><td><a href=#177>UL_CIRCLE</a></td></tr>
<tr><td><tt>classes()</tt>    </td><td width=20><td><a href=#178>UL_CLASS</a></td></tr>
<tr><td><tt>elements()</tt>   </td><td width=20><td><a href=#183>UL_ELEMENT</a></td></tr>
<tr><td><tt>frames()</tt>     </td><td width=20><td><a href=#184>UL_FRAME</a></td></tr>
<tr><td><tt>holes()</tt>      </td><td width=20><td><a href=#187>UL_HOLE</a></td></tr>
<tr><td><tt>layers()</tt>     </td><td width=20><td><a href=#191>UL_LAYER</a></td></tr>
<tr><td><tt>libraries()</tt>  </td><td width=20><td><a href=#192>UL_LIBRARY</a></td></tr>
<tr><td><tt>polygons()</tt>   </td><td width=20><td><a href=#199>UL_POLYGON</a></td></tr>
<tr><td><tt>rectangles()</tt> </td><td width=20><td><a href=#200>UL_RECTANGLE</a></td></tr>
<tr><td><tt>signals()</tt>    </td><td width=20><td><a href=#204>UL_SIGNAL</a></td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a></td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#192>UL_LIBRARY</a>,
<a href=#201>UL_SCHEMATIC</a>
<h2>Note</h2>
The <tt>name</tt> member returns the full file name, including the directory.
<p>
The <tt>attributes()</tt> loop member loops through the <i>global</i> attributes.
<h2>Example</h2>
<pre>
board(B) {
  B.elements(E) printf("Element: %s\n", E.name);
  B.signals(S)  printf("Signal: %s\n", S.name);
  }
</pre>


<a name=176>
<h1>UL_BUS</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>BUS_NAME_LENGTH</tt>)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>segments()</tt>   </td><td width=20><td><a href=#202>UL_SEGMENT</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#203>UL_SHEET</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>BUS_NAME_LENGTH</tt>   </td><td width=20><td>max. length of a bus name (obsolete - as from version 4 bus names can have any length)</td></tr>
</table>
<h2>Example</h2>
<pre>
schematic(SCH) {
  SCH.sheets(SH) {
    SH.busses(B) printf("Bus: %s\n", B.name);
    }
  }
</pre>


<a name=177>
<h1>UL_CIRCLE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>radius</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>width</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (center point)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#194>UL_PACKAGE</a>,
<a href=#203>UL_SHEET</a>,
<a href=#206>UL_SYMBOL</a>
<h2>Example</h2>
<pre>
board(B) {
  B.circles(C) {
    printf("Circle: (%d %d), r=%d, w=%d\n",
           C.x, C.y, C.radius, C.width);
    }
  }
</pre>


<a name=178>
<h1>UL_CLASS</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>clearance[number]</tt></td><td width=20><td><a href=#166>int</a> (see note)</td></tr>
<tr><td><tt>drill</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>name</tt>        </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>number</tt>      </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>width</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#133>Design Rules</a>,
<a href=#193>UL_NET</a>,
<a href=#204>UL_SIGNAL</a>,
<a href=#201>UL_SCHEMATIC</a>,
<a href=#175>UL_BOARD</a>
<h2>Note</h2>
The <tt>clearance</tt> member returns the clearance value between this net class
and the net class with the given number. If the number (and the square brackets) is
ommitted, the net class's own clearance value is returned. If a number is given,
it must be between 0 and the number of this net class.
<p>
If the <tt>name</tt> member returns an empty string, the net class is not defined
and therefore not in use by any signal or net.
<h2>Example</h2>
<pre>
board(B) {
  B.signals(S) {
    printf("%-10s %d %s\n", S.name, S.class.number, S.class.name);
    }
  }
</pre>


<a name=179>
<h1>UL_CONTACT</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>CONTACT_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>pad</tt>          </td><td width=20><td><a href=#195>UL_PAD</a></td></tr>
<tr><td><tt>signal</tt>       </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>smd</tt>          </td><td width=20><td><a href=#205>UL_SMD</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (center point, see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#194>UL_PACKAGE</a>,
<a href=#195>UL_PAD</a>,
<a href=#205>UL_SMD</a>,
<a href=#180>UL_CONTACTREF</a>,
<a href=#198>UL_PINREF</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>CONTACT_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a contact name (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
The <tt>signal</tt> data member returns the signal this contact is connected to
(only available in a board context).
<p>
The coordinates (<tt>x, y</tt>) of the contact depend on the context in which it is called:
<ul>
<li>if the contact is derived from a UL_LIBRARY context, the coordinates of the contact will be the same as
defined in the package drawing
<li>in all other cases, they will have the actual values from the board
</ul>
<h2>Example</h2>
<pre>
library(L) {
  L.packages(PAC) {
    PAC.contacts(C) {
      printf("Contact: '%s', (%d %d)\n",
             C.name, C.x, C.y);
      }
    }
  }
</pre>


<a name=180>
<h1>UL_CONTACTREF</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>contact</tt>      </td><td width=20><td><a href=#179>UL_CONTACT</a></td></tr>
<tr><td><tt>element</tt>      </td><td width=20><td><a href=#183>UL_ELEMENT</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#204>UL_SIGNAL</a>,
<a href=#198>UL_PINREF</a>
<h2>Example</h2>
<pre>
board(B) {
  B.signals(S) {
    printf("Signal '%s'\n", S.name);
    S.contactrefs(C) {
      printf("\t%s, %s\n", C.element.name, C.contact.name);
      }
    }
  }
</pre>


<a name=181>
<h1>UL_DEVICE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>area</tt>         </td><td width=20><td><a href=#173>UL_AREA</a></td></tr>
<tr><td><tt>description</tt>  </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>headline</tt>     </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>library</tt>      </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>DEVICE_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>package</tt>      </td><td width=20><td><a href=#194>UL_PACKAGE</a> (see note)</td></tr>
<tr><td><tt>prefix</tt>       </td><td width=20><td><a href=#168>string</a> (<tt>DEVICE_PREFIX_LENGTH</tt>)</td></tr>
<tr><td><tt>technologies</tt> </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>value</tt>        </td><td width=20><td><a href=#168>string</a> ("On" or "Off")</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>attributes()</tt>  </td><td width=20><td><a href=#174>UL_ATTRIBUTE</a> (see note)</td></tr>
<tr><td><tt>gates()</tt>      </td><td width=20><td><a href=#185>UL_GATE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#182>UL_DEVICESET</a>,
<a href=#192>UL_LIBRARY</a>,
<a href=#196>UL_PART</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>DEVICE_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a device name (used in formatted output only)</td></tr>
<tr><td><tt>DEVICE_PREFIX_LENGTH</tt> </td><td width=20><td>max. recommended length of a device prefix (used in formatted output only)</td></tr>
</table>
<p>
All members of UL_DEVICE, except for <tt>name</tt> and <tt>technologies</tt>, return the
same values as the respective members of the UL_DEVICESET in which the UL_DEVICE has been
defined.
The <tt>name</tt> member returns the name of the package variant this device
has been created for using the <a href=#72>PACKAGE</a> command.
When using the <tt>description</tt> text keep in mind that it may contain newline characters (<tt>'\n'</tt>).
<h2>Note</h2>
The <tt>package</tt> data member returns the <a href=#194>package</a>
that has been assigned to the device through a <a href=#72>PACKAGE</a>
command. It can be used as a boolean function to check whether a package has been
assigned to a device (see example below).
<p>
The value returned by the <tt>technologies</tt> member depends on the context in which it is called:
<ul>
<li>if the device is derived from a UL_DEVICESET, <tt>technologies</tt> will return a
string containing all of the device's technologies, separated by blanks
<li>if the device is derived from a UL_PART, only the actual technology used by the part
will be returned.
</ul>
<p>
The <tt>attributes()</tt> loop member takes an additional parameter that specifies
for which technology the attributes shall be delivered (see the second example below).
<h2>Examples</h2>
<pre>
library(L) {
  L.devicesets(S) {
    S.devices(D) {
      if (D.package)
         printf("Device: %s, Package: %s\n", D.name, D.package.name);
      D.gates(G) {
        printf("\t%s\n", G.name);
        }
      }
    }
  }
</pre>
<pre>
library(L) {
  L.devicesets(DS) {
    DS.devices(D) {
      string t[];
      int n = strsplit(t, D.technologies, ' ');
      for (int i = 0; i &lt; n; i++) {
          D.attributes(A, t[i]) {
            printf("%s = %s\n", A.name, A.value);
            }
          }
      }
    }
  }
</pre>


<a name=182>
<h1>UL_DEVICESET</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>area</tt>         </td><td width=20><td><a href=#173>UL_AREA</a></td></tr>
<tr><td><tt>description</tt>  </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>headline</tt>     </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>library</tt>      </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>DEVICE_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>prefix</tt>       </td><td width=20><td><a href=#168>string</a> (<tt>DEVICE_PREFIX_LENGTH</tt>)</td></tr>
<tr><td><tt>value</tt>        </td><td width=20><td><a href=#168>string</a> ("On" or "Off")</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>devices()</tt>    </td><td width=20><td><a href=#181>UL_DEVICE</a></td></tr>
<tr><td><tt>gates()</tt>      </td><td width=20><td><a href=#185>UL_GATE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#181>UL_DEVICE</a>,
<a href=#192>UL_LIBRARY</a>,
<a href=#196>UL_PART</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>DEVICE_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a device name (used in formatted output only)</td></tr>
<tr><td><tt>DEVICE_PREFIX_LENGTH</tt> </td><td width=20><td>max. recommended length of a device prefix (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
The <tt>description</tt> member returns the complete descriptive text as defined with
the <a href=#44>DESCRIPTION</a> command, while the <tt>headline</tt>
member returns only the first line of the description, without any <a href=#352>HTML</a> tags.
When using the <tt>description</tt> text keep in mind that it may contain newline characters (<tt>'\n'</tt>).
<h2>Example</h2>
<pre>
library(L) {
  L.devicesets(D) {
    printf("Device set: %s, Description: %s\n", D.name, D.description);
    D.gates(G) {
      printf("\t%s\n", G.name);
      }
    }
  }
</pre>


<a name=183>
<h1>UL_ELEMENT</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0.0</tt>...<tt>359.9</tt>)</td></tr>
<tr><td><tt>attribute[]</tt>  </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>column</tt>       </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>locked</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>mirror</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>ELEMENT_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>package</tt>      </td><td width=20><td><a href=#194>UL_PACKAGE</a></td></tr>
<tr><td><tt>row</tt>          </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>smashed</tt>      </td><td width=20><td><a href=#166>int</a> (see note)</td></tr>
<tr><td><tt>spin</tt>         </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>value</tt>        </td><td width=20><td><a href=#168>string</a>  (<tt>ELEMENT_VALUE_LENGTH</tt>)</td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (origin point)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>attributes()</tt>  </td><td width=20><td><a href=#174>UL_ATTRIBUTE</a></td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a> (see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#180>UL_CONTACTREF</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>ELEMENT_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of an element name (used in formatted output only)</td></tr>
<tr><td><tt>ELEMENT_VALUE_LENGTH</tt>  </td><td width=20><td>max. recommended length of an element value (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
The <tt>attribute[]</tt> member can be used to query a UL_ELEMENT for the value of a given
attribute (see the second example below). The returned string is empty if there is no
attribute by the given name, or if this attribute is explicitly empty.
<p>
The <tt>texts()</tt> member only loops through those texts of the element that have been
detached using <a href=#95><b>SMASH</b></a>,
and through the visible texts of any attributes assigned to this element.
To process all texts of an element (e.g. when drawing it), you have to loop through the element's
own <tt>texts()</tt> member as well as the <tt>texts()</tt> member of the
element's <a href=#194>package</a>.
<p>
<tt>angle</tt> defines how many degrees the element is rotated counterclockwise
around its origin.
<p>
The <tt>column()</tt> and <tt>row()</tt> members return the column and row location within
the <a href=#184>frame</a> in the board drawing.
If there is no frame in the drawing, or the element is placed outside the frame, a <tt>'?'</tt>
(question mark) is returned.
<p>
The <tt>smashed</tt> member tells whether the element is smashed. This function can also
be used to find out whether there is a detached text parameter by giving the name of
that parameter in square brackets, as in <tt>smashed["VALUE"]</tt>. This is useful
in case you want to select such a text with the <a href=#67>MOVE</a> command
by doing <tt>MOVE R5&gt;VALUE</tt>. Valid parameter names are "NAME" and "VALUE", as
well as the names of any user defined <a href=#174>attributes</a>.
They are treated case insensitive, and they may be preceded by a <tt>'&gt;'</tt>
character.
<h2>Examples</h2>
<pre>
board(B) {
  B.elements(E) {
    printf("Element: %s, (%d %d), Package=%s\n",
           E.name, E.x, E.y, E.package.name);
    }
  }
</pre>
<pre>
board(B) {
  B.elements(E) {
    if (E.attribute["REMARK"])
       printf("%s: %s\n", E.name, E.attribute("REMARK"));
    }
  }
</pre>


<a name=184>
<h1>UL_FRAME</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>columns</tt>      </td><td width=20><td><a href=#166>int</a> (<tt>-127</tt>...<tt>127</tt>)</td></tr>
<tr><td><tt>rows</tt>         </td><td width=20><td><a href=#166>int</a> (<tt>-26</tt>...<tt>26</tt>)</td></tr>
<tr><td><tt>border</tt>       </td><td width=20><td><a href=#166>int</a> (<tt>FRAME_BORDER_...</tt>)</td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x1, y1</tt>       </td><td width=20><td><a href=#166>int</a> (lower left corner)</td></tr>
<tr><td><tt>x2, y2</tt>       </td><td width=20><td><a href=#166>int</a> (upper right corner)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a></td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#194>UL_PACKAGE</a>,
<a href=#203>UL_SHEET</a>,
<a href=#206>UL_SYMBOL</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>FRAME_BORDER_BOTTOM</tt>    </td><td width=20><td>bottom border is drawn</td></tr>
<tr><td><tt>FRAME_BORDER_RIGHT</tt>     </td><td width=20><td>right border is drawn</td></tr>
<tr><td><tt>FRAME_BORDER_TOP</tt>       </td><td width=20><td>top border is drawn</td></tr>
<tr><td><tt>FRAME_BORDER_LEFT</tt>      </td><td width=20><td>left border is drawn</td></tr>
</table>
<h2>Note</h2>
<tt>border</tt> contains a bitwise or'ed value consisting of <tt>FRAME_BORDER_...</tt>
and defines which of the four borders are actually drawn.
<p>
The <tt>texts()</tt> and <tt>wires()</tt> loop members loop through all the
texts and wires the frame consists of.
<h2>Example</h2>
<pre>
board(B) {
  B.frames(F) {
    printf("Frame: (%d %d), (%d %d)\n",
           F.x1, F.y1, F.x2, F.y2);
    }
  }
</pre>


<a name=185>
<h1>UL_GATE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>addlevel</tt>     </td><td width=20><td><a href=#166>int</a> (<tt>GATE_ADDLEVEL_...</tt>)</td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>GATE_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>swaplevel</tt>    </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>symbol</tt>       </td><td width=20><td><a href=#206>UL_SYMBOL</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (origin point, see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#181>UL_DEVICE</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>GATE_ADDLEVEL_MUST</tt>    </td><td width=20><td>must</td></tr>
<tr><td><tt>GATE_ADDLEVEL_CAN</tt>     </td><td width=20><td>can</td></tr>
<tr><td><tt>GATE_ADDLEVEL_NEXT</tt>    </td><td width=20><td>next</td></tr>
<tr><td><tt>GATE_ADDLEVEL_REQUEST</tt> </td><td width=20><td>request</td></tr>
<tr><td><tt>GATE_ADDLEVEL_ALWAYS</tt>  </td><td width=20><td>always</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>GATE_NAME_LENGTH</tt>      </td><td width=20><td>max. recommended length of a gate name (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
The coordinates of the origin point (x, y) are always those of the gate's position within
the device, even if the UL_GATE has been derived from a <a href=#188>UL_INSTANCE</a>.
<h2>Example</h2>
<pre>
library(L) {
  L.devices(D) {
    printf("Device: %s, Package: %s\n", D.name, D.package.name);
    D.gates(G) {
      printf("\t%s, swaplevel=%d, symbol=%s\n",
             G.name, G.swaplevel, G.symbol.name);
      }
    }
  }
</pre>


<a name=186>
<h1>UL_GRID</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>distance</tt>     </td><td width=20><td><a href=#167>real</a></td></tr>
<tr><td><tt>dots</tt>         </td><td width=20><td><a href=#166>int</a> (0=lines, 1=dots)</td></tr>
<tr><td><tt>multiple</tt>     </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>on</tt>           </td><td width=20><td><a href=#166>int</a> (0=off, 1=on)</td></tr>
<tr><td><tt>unit</tt>         </td><td width=20><td><a href=#166>int</a> (<tt>GRID_UNIT_...</tt>)</td></tr>
<tr><td><tt>unitdist</tt>     </td><td width=20><td><a href=#166>int</a> (<tt>GRID_UNIT_...</tt>)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#192>UL_LIBRARY</a>,
<a href=#201>UL_SCHEMATIC</a>,
<a href=#270>Unit Conversions</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>GRID_UNIT_MIC</tt>   </td><td width=20><td>microns</td></tr>
<tr><td><tt>GRID_UNIT_MM</tt>    </td><td width=20><td>millimeter</td></tr>
<tr><td><tt>GRID_UNIT_MIL</tt>   </td><td width=20><td>mil</td></tr>
<tr><td><tt>GRID_UNIT_INCH</tt>  </td><td width=20><td>inch</td></tr>
</table>
<h2>Note</h2>
<tt>unitdist</tt> returns the grid unit that was set to define the actual grid size
(returned by <tt>distance</tt>), while <tt>unit</tt> returns the grid unit that is
used to display values or interpret user input.
<h2>Example</h2>
<pre>
board(B) {
  printf("Gridsize=%f\n", B.grid.distance);
  }
</pre>


<a name=187>
<h1>UL_HOLE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>diameter[layer]</tt> </td><td width=20><td><a href=#166>int</a> (see note)</td></tr>
<tr><td><tt>drill</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>drillsymbol</tt>  </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (center point)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#194>UL_PACKAGE</a>
<h2>Note</h2>
<tt>diameter[]</tt> is only defined vor layers <tt>LAYER_TSTOP</tt> and <tt>LAYER_BSTOP</tt>
and returns the diameter of the solder stop mask in the given layer.
<p>
<tt>drillsymbol</tt> returns the number of the drill symbol that has been assigned
to this drill diameter (see the manual for a list of defined drill symbols).
A value of <tt>0</tt> means that no symbol has been assigned to this drill diameter.
<h2>Example</h2>
<pre>
board(B) {
  B.holes(H) {
    printf("Hole: (%d %d), drill=%d\n",
           H.x, H.y, H.drill);
    }
  }
</pre>


<a name=188>
<h1>UL_INSTANCE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0</tt>, <tt>90</tt>, <tt>180</tt> and <tt>270</tt>)</td></tr>
<tr><td><tt>column</tt>       </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>gate</tt>         </td><td width=20><td><a href=#185>UL_GATE</a></td></tr>
<tr><td><tt>mirror</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>INSTANCE_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>row</tt>          </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>sheet</tt>        </td><td width=20><td><a href=#166>int</a> (0=unused, &gt;0=sheet number)</td></tr>
<tr><td><tt>smashed</tt>      </td><td width=20><td><a href=#166>int</a> (see note)</td></tr>
<tr><td><tt>value</tt>        </td><td width=20><td><a href=#168>string</a> (<tt>PART_VALUE_LENGTH</tt>)</td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (origin point)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>attributes()</tt>  </td><td width=20><td><a href=#174>UL_ATTRIBUTE</a> (see note)</td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a> (see note)</td></tr>
<tr><td><tt>xrefs()</tt>      </td><td width=20><td><a href=#185>UL_GATE</a> (see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#196>UL_PART</a>,
<a href=#198>UL_PINREF</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>INSTANCE_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of an instance name (used in formatted output only)</td></tr>
<tr><td><tt>PART_VALUE_LENGTH</tt>      </td><td width=20><td>max. recommended length of a part value (instances do not have a value of their own!)</td></tr>
</table>
<h2>Note</h2>
The <tt>attributes()</tt> member only loops through those attributes that have been
explicitly assigned to this instance (including <i>smashed</i> attributes).
<p>
The <tt>texts()</tt> member only loops through those texts of the instance that have been
detached using <a href=#95><b>SMASH</b></a>,
and through the visible texts of any attributes assigned to this instance.
To process all texts of an instance, you have to loop through the instance's
own <tt>texts()</tt> member as well as the <tt>texts()</tt> member of the
instance's gate's <a href=#206>symbol</a>.
If attributes have been assigned to an instance, <tt>texts()</tt> delivers their texts
in the form as they are currently visible.
<p>
The <tt>column()</tt> and <tt>row()</tt> members return the column and row location within
the <a href=#184>frame</a> on the sheet on which this instance is invoked.
If there is no frame on that sheet, or the instance is placed outside the frame, a <tt>'?'</tt>
(question mark) is returned.
These members can only be used in a sheet context.
<p>
The <tt>smashed</tt> member tells whether the instance is smashed. This function can also
be used to find out whether there is a detached text parameter by giving the name of
that parameter in square brackets, as in <tt>smashed["VALUE"]</tt>. This is useful
in case you want to select such a text with the <a href=#67>MOVE</a> command
by doing <tt>MOVE R5&gt;VALUE</tt>. Valid parameter names are "NAME", "VALUE",
"PART" and "GATE", as well as the names of any user defined <a href=#174>attributes</a>.
They are treated case insensitive, and they may be preceded by a <tt>'&gt;'</tt>
character.
<p>
The <tt>xrefs()</tt> member loops through the <a href=#137>contact cross-reference</a>
gates of this instance. These are only of importance if the ULP is going to create
a drawing of some sort (for instance a DXF file).
<h2>Example</h2>
<pre>
schematic(S) {
  S.parts(P) {
    printf("Part: %s\n", P.name);
    P.instances(I) {
      if (I.sheet != 0)
         printf("\t%s used on sheet %d\n", I.name, I.sheet);
      }
    }
  }
</pre>


<a name=189>
<h1>UL_JUNCTION</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>diameter</tt>     </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (center point)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#202>UL_SEGMENT</a>
<h2>Example</h2>
<pre>
schematic(SCH) {
  SCH.sheets(SH) {
    SH.nets(N) {
      N.segments(SEG) {
        SEG.junctions(J) {
          printf("Junction: (%d %d)\n", J.x, J.y);
          }
        }
      }
    }
  }
</pre>


<a name=190>
<h1>UL_LABEL</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0.0</tt>...<tt>359.9</tt>)</td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>mirror</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>spin</tt>         </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>text</tt>         </td><td width=20><td><a href=#207>UL_TEXT</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (origin point)</td></tr>
<tr><td><tt>xref</tt>         </td><td width=20><td><a href=#166>int</a> (0=plain, 1=cross-reference)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a> (see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#202>UL_SEGMENT</a>
<h2>Note</h2>
If <tt>xref</tt> returns a non-zero value, the <tt>wires()</tt> loop member loops through
the wires that form the flag of a cross-reference label. Otherwise it is an empty loop.
<p>
The <tt>angle</tt>, <tt>layer</tt>, <tt>mirror</tt> and <tt>spin</tt> members always
return the same values as those of the UL_TEXT object returned by the <tt>text</tt>
member. The <tt>x</tt> and <tt>y</tt> members of the text return slightly offset values for
cross-reference labels (non-zero <tt>xref</tt>), otherwise they also return the same values
as the UL_LABEL.
<p>
<tt>xref</tt> is only meaningful for net labels. For bus labels it always returns 0.
<h2>Example</h2>
<pre>
sheet(SH) {
  SH.nets(N) {
    N.segments(S) {
      S.labels(L) {
        printf("Label: %d %d '%s'\n", L.x, L.y, L.text.value);
        }
      }
    }
  }
</pre>


<a name=191>
<h1>UL_LAYER</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>color</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>fill</tt>         </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>LAYER_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>number</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>used</tt>         </td><td width=20><td><a href=#166>int</a> (0=unused, 1=used)</td></tr>
<tr><td><tt>visible</tt>      </td><td width=20><td><a href=#166>int</a> (0=off, 1=on)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#192>UL_LIBRARY</a>,
<a href=#201>UL_SCHEMATIC</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>LAYER_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a layer name (used in formatted output only)</td></tr>
<tr><td><tt>LAYER_TOP</tt>  </td><td width=20><td>layer numbers</td></tr>
<tr><td><tt>LAYER_BOTTOM</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_PADS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_VIAS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_UNROUTED</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_DIMENSION</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TPLACE</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BPLACE</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TORIGINS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BORIGINS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TNAMES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BNAMES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TVALUES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BVALUES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TSTOP</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BSTOP</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TCREAM</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BCREAM</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TFINISH</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BFINISH</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TGLUE</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BGLUE</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TTEST</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BTEST</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TKEEPOUT</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BKEEPOUT</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TRESTRICT</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BRESTRICT</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_VRESTRICT</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_DRILLS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_HOLES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_MILLING</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_MEASURES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_DOCUMENT</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_REFERENCE</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_TDOCU</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BDOCU</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_NETS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_BUSSES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_PINS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_SYMBOLS</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_NAMES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_VALUES</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_INFO</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_GUIDE</tt>  </td><td width=20><td></td></tr>
<tr><td><tt>LAYER_USER</tt>  </td><td width=20><td>lowest number for user defined layers (100)</td></tr>
</table>
<h2>Example</h2>
<pre>
board(B) {
  B.layers(L) printf("Layer %3d %s\n", L.number, L.name);
  }
</pre>


<a name=192>
<h1>UL_LIBRARY</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>description</tt>  </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>grid</tt>         </td><td width=20><td><a href=#186>UL_GRID</a></td></tr>
<tr><td><tt>headline</tt>     </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>LIBRARY_NAME_LENGTH</tt>, see note)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>devices()</tt>    </td><td width=20><td><a href=#181>UL_DEVICE</a></td></tr>
<tr><td><tt>devicesets()</tt> </td><td width=20><td><a href=#182>UL_DEVICESET</a></td></tr>
<tr><td><tt>layers()</tt>     </td><td width=20><td><a href=#191>UL_LAYER</a></td></tr>
<tr><td><tt>packages()</tt>   </td><td width=20><td><a href=#194>UL_PACKAGE</a></td></tr>
<tr><td><tt>symbols()</tt>    </td><td width=20><td><a href=#206>UL_SYMBOL</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#201>UL_SCHEMATIC</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>LIBRARY_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a library name (used in formatted output only)</td></tr>
</table>
<p>
The <tt>devices()</tt> member loops through all the package variants and technologies
of all UL_DEVICESETs in the library, thus resulting in all the actual device variations
available. The <tt>devicesets()</tt> member only loops through the UL_DEVICESETs,
which in turn can be queried for their UL_DEVICE members.
<h2>Note</h2>
The <tt>description</tt> member returns the complete descriptive text as defined with
the <a href=#44>DESCRIPTION</a> command, while the <tt>headline</tt>
member returns only the first line of the description, without any <a href=#352>HTML</a> tags.
When using the <tt>description</tt> text keep in mind that it may contain newline characters (<tt>'\n'</tt>).
The <tt>description</tt> and <tt>headline</tt> information is only available within a
library drawing, not if the library is derived form a UL_BOARD or UL_SCHEMATIC context.
<p>
If the library is derived form a UL_BOARD or UL_SCHEMATIC context, <tt>name</tt> returns
the pure library name (without path or extension). Otherwise it returns the full library file name.
<h2>Example</h2>
<pre>
library(L) {
  L.devices(D)     printf("Dev: %s\n", D.name);
  L.devicesets(D)  printf("Dev: %s\n", D.name);
  L.packages(P)    printf("Pac: %s\n", P.name);
  L.symbols(S)     printf("Sym: %s\n", S.name);
  }
schematic(S) {
  S.libraries(L) printf("Library: %s\n", L.name);
  }
</pre>


<a name=193>
<h1>UL_NET</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>class</tt>        </td><td width=20><td><a href=#178>UL_CLASS</a></td></tr>
<tr><td><tt>column</tt>       </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>NET_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>row</tt>          </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>pinrefs()</tt>    </td><td width=20><td><a href=#198>UL_PINREF</a> (see note)</td></tr>
<tr><td><tt>segments()</tt>   </td><td width=20><td><a href=#202>UL_SEGMENT</a> (see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#203>UL_SHEET</a>,
<a href=#201>UL_SCHEMATIC</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>NET_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a net name (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
The <tt>pinrefs()</tt> loop member can only be used if the net is in a
schematic context.<br>
The <tt>segments()</tt> loop member can only be used if the net is in a
sheet context.
<p>
The <tt>column()</tt> and <tt>row()</tt> members return the column and row locations within
the <a href=#184>frame</a> on the sheet on which this net is drawn. Since a net
can extend over a certain area, each of these functions returns two values, separated by
a blank. In case of <tt>column()</tt> these are the left- and rightmost columns touched
by the net, and in case of <tt>row()</tt> it's the top- and bottommost row.
If there is no frame on that sheet, <tt>"? ?"</tt> (two question marks) is returned.
If any part of the net is placed outside the frame, either of the values may be <tt>'?'</tt> (question mark).
These members can only be used in a sheet context.
<h2>Example</h2>
<pre>
schematic(S) {
  S.nets(N) {
    printf("Net: %s\n", N.name);
    // N.segments(SEG) will NOT work here!
    }
  }
schematic(S) {
  S.sheets(SH) {
    SH.nets(N) {
      printf("Net: %s\n", N.name);
      N.segments(SEG) {
        SEG.wires(W) {
          printf("\tWire: (%d %d) (%d %d)\n",
                 W.x1, W.y1, W.x2, W.y2);
          }
        }
      }
    }
  }
</pre>


<a name=194>
<h1>UL_PACKAGE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>area</tt>         </td><td width=20><td><a href=#173>UL_AREA</a></td></tr>
<tr><td><tt>description</tt>  </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>headline</tt>     </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>library</tt>      </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>PACKAGE_NAME_LENGTH</tt>)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>circles()</tt>    </td><td width=20><td><a href=#177>UL_CIRCLE</a></td></tr>
<tr><td><tt>contacts()</tt>   </td><td width=20><td><a href=#179>UL_CONTACT</a></td></tr>
<tr><td><tt>frames()</tt>     </td><td width=20><td><a href=#184>UL_FRAME</a></td></tr>
<tr><td><tt>holes()</tt>      </td><td width=20><td><a href=#187>UL_HOLE</a></td></tr>
<tr><td><tt>polygons()</tt>   </td><td width=20><td><a href=#199>UL_POLYGON</a></td></tr>
<tr><td><tt>rectangles()</tt> </td><td width=20><td><a href=#200>UL_RECTANGLE</a></td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a> (see note)</td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#181>UL_DEVICE</a>,
<a href=#183>UL_ELEMENT</a>,
<a href=#192>UL_LIBRARY</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PACKAGE_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a package name (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
The <tt>description</tt> member returns the complete descriptive text as defined with
the <a href=#44>DESCRIPTION</a> command, while the <tt>headline</tt>
member returns only the first line of the description, without any <a href=#352>HTML</a> tags.
When using the <tt>description</tt> text keep in mind that it may contain newline characters (<tt>'\n'</tt>).
<p>
If the UL_PACKAGE is derived from a UL_ELEMENT, the <tt>texts()</tt> member only loops through the
non-detached texts of that element.
<h2>Example</h2>
<pre>
library(L) {
  L.packages(PAC) {
    printf("Package: %s\n", PAC.name);
    PAC.contacts(C) {
      if (C.pad)
         printf("\tPad: %s, (%d %d)\n",
                 C.name, C.pad.x, C.pad.y);
      else if (C.smd)
         printf("\tSmd: %s, (%d %d)\n",
                 C.name, C.smd.x, C.smd.y);
      }
    }
  }
board(B) {
  B.elements(E) {
    printf("Element: %s, Package: %s\n", E.name, E.package.name);
    }
  }
</pre>


<a name=195>
<h1>UL_PAD</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0.0</tt>...<tt>359.9</tt>)</td></tr>
<tr><td><tt>diameter[layer]</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>drill</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>drillsymbol</tt>  </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>elongation</tt>   </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>flags</tt>        </td><td width=20><td><a href=#166>int</a> (<tt>PAD_FLAG_...</tt>)</td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>PAD_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>shape[layer]</tt> </td><td width=20><td><a href=#166>int</a> (<tt>PAD_SHAPE_...</tt>)</td></tr>
<tr><td><tt>signal</tt>       </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (center point, see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#194>UL_PACKAGE</a>,
<a href=#179>UL_CONTACT</a>,
<a href=#205>UL_SMD</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PAD_FLAG_STOP</tt>   </td><td width=20><td>generate stop mask</td></tr>
<tr><td><tt>PAD_FLAG_THERMALS</tt>         </td><td width=20><td>generate thermals</td></tr>
<tr><td><tt>PAD_FLAG_FIRST</tt>            </td><td width=20><td>use special "first pad" shape</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PAD_SHAPE_SQUARE</tt>   </td><td width=20><td>square</td></tr>
<tr><td><tt>PAD_SHAPE_ROUND</tt>    </td><td width=20><td>round</td></tr>
<tr><td><tt>PAD_SHAPE_OCTAGON</tt>  </td><td width=20><td>octagon</td></tr>
<tr><td><tt>PAD_SHAPE_LONG</tt>     </td><td width=20><td>long</td></tr>
<tr><td><tt>PAD_SHAPE_OFFSET</tt>   </td><td width=20><td>offset</td></tr>
<tr><td><tt>PAD_SHAPE_ANNULUS</tt> </td><td width=20><td>annulus (only if supply layers are used)</td></tr>
<tr><td><tt>PAD_SHAPE_THERMAL</tt> </td><td width=20><td>thermal (only if supply layers are used)</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PAD_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a pad name (same as <tt>CONTACT_NAME_LENGTH</tt>)</td></tr>
</table>
<h2>Note</h2>
The parameters of the pad depend on the context in which it is accessed:
<ul>
<li>if the pad is derived from a UL_LIBRARY context, the coordinates (<tt>x, y</tt>) and <tt>angle</tt> will be the same as
defined in the package drawing
<li>in all other cases, they will have the actual values from the board
</ul>
<p>
The diameter and shape of the pad depend on the layer for which they shall be retrieved,
because they may be different in each layer depending on the <a href=#133>Design Rules</a>.
If one of the <a href=#191>layers</a> LAYER_TOP...LAYER_BOTTOM, LAYER_TSTOP or LAYER_BSTOP
is given as the index to the diameter or shape data member, the resulting value will be calculated
according to the Design Rules. If LAYER_PADS is given, the raw value as defined in the library will
be returned.
<p>
<tt>drillsymbol</tt> returns the number of the drill symbol that has been assigned
to this drill diameter (see the manual for a list of defined drill symbols).
A value of <tt>0</tt> means that no symbol has been assigned to this drill diameter.
<p>
<tt>angle</tt> defines how many degrees the pad is rotated counterclockwise
around its center.
<p>
<tt>elongation</tt> is only valid for shapes PAD_SHAPE_LONG and PAD_SHAPE_OFFSET and
defines how many percent the long side of such a pad is longer than its small side.
This member returns 0 for any other pad shapes.
<p>
The value returned by <tt>flags</tt> must be masked with the <tt>PAD_FLAG_...</tt>
constants to determine the individual flag settings, as in
<pre>
if (pad.flags &amp; PAD_FLAG_STOP) {
   ...
   }
</pre>
Note that if your ULP just wants to draw the objects, you don't need to check these
flags explicitly. The <tt>diameter[]</tt> and <tt>shape[]</tt> members will return
the proper data; for instance, if <tt>PAD_FLAG_STOP</tt> is set, <tt>diameter[LAYER_TSTOP]</tt>
will return <tt>0</tt>, which should result in nothing being drawn in that layer.
The <tt>flags</tt> member is mainly for ULPs that want to create script files that
create library objects.
<h2>Example</h2>
<pre>
library(L) {
  L.packages(PAC) {
    PAC.contacts(C) {
      if (C.pad)
         printf("Pad: '%s', (%d %d), d=%d\n",
                 C.name, C.pad.x, C.pad.y, C.pad.diameter[LAYER_BOTTOM]);
      }
    }
  }
</pre>


<a name=196>
<h1>UL_PART</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>attribute[]</tt>       </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>device</tt>       </td><td width=20><td><a href=#181>UL_DEVICE</a></td></tr>
<tr><td><tt>deviceset</tt>    </td><td width=20><td><a href=#182>UL_DEVICESET</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>PART_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>value</tt>        </td><td width=20><td><a href=#168>string</a> (<tt>PART_VALUE_LENGTH</tt>)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>attributes()</tt>  </td><td width=20><td><a href=#174>UL_ATTRIBUTE</a> (see note)</td></tr>
<tr><td><tt>instances()</tt>  </td><td width=20><td><a href=#188>UL_INSTANCE</a> (see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#201>UL_SCHEMATIC</a>,
<a href=#203>UL_SHEET</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PART_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a part name (used in formatted output only)</td></tr>
<tr><td><tt>PART_VALUE_LENGTH</tt>  </td><td width=20><td>max. recommended length of a part value (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
The <tt>attribute[]</tt> member can be used to query a UL_PART for the value of a given
attribute (see the second example below). The returned string is empty if there is no
attribute by the given name, or if this attribute is explicitly empty.
<p>
When looping through the <tt>attributes()</tt> of a UL_PART, only the <tt>name</tt>,
<tt>value</tt>, <tt>defaultvalue</tt> and <tt>constant</tt> members of the resulting
UL_ATTRIBUTE objects are valid.
<p>
If the part is in a sheet context, the <tt>instances()</tt> loop member
loops only through those instances that are actually used on that sheet.
If the part is in a schematic context, all instances are looped through.
<h2>Example</h2>
<pre>
schematic(S) {
  S.parts(P) printf("Part: %s\n", P.name);
  }
</pre>
<pre>
schematic(SCH) {
  SCH.parts(P) {
    if (P.attribute["REMARK"])
       printf("%s: %s\n", P.name, P.attribute["REMARK"]);
    }
  }
</pre>


<a name=197>
<h1>UL_PIN</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0</tt>, <tt>90</tt>, <tt>180</tt> and <tt>270</tt>)</td></tr>
<tr><td><tt>contact</tt>      </td><td width=20><td><a href=#179>UL_CONTACT</a> (see note)</td></tr>
<tr><td><tt>direction</tt>    </td><td width=20><td><a href=#166>int</a> (<tt>PIN_DIRECTION_...</tt>)</td></tr>
<tr><td><tt>function</tt>     </td><td width=20><td><a href=#166>int</a> (<tt>PIN_FUNCTION_FLAG_...</tt>)</td></tr>
<tr><td><tt>length</tt>       </td><td width=20><td><a href=#166>int</a> (<tt>PIN_LENGTH_...</tt>)</td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>PIN_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>net</tt>          </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>swaplevel</tt>    </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>visible</tt>      </td><td width=20><td><a href=#166>int</a> (<tt>PIN_VISIBLE_FLAG_...</tt>)</td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (connection point)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>circles()</tt>    </td><td width=20><td><a href=#177>UL_CIRCLE</a></td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a></td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#206>UL_SYMBOL</a>,
<a href=#198>UL_PINREF</a>,
<a href=#180>UL_CONTACTREF</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PIN_DIRECTION_NC</tt>  </td><td width=20><td>not connected</td></tr>
<tr><td><tt>PIN_DIRECTION_IN</tt>  </td><td width=20><td>input</td></tr>
<tr><td><tt>PIN_DIRECTION_OUT</tt> </td><td width=20><td>output (totem-pole)</td></tr>
<tr><td><tt>PIN_DIRECTION_IO</tt>  </td><td width=20><td>in/output (bidirectional)</td></tr>
<tr><td><tt>PIN_DIRECTION_OC</tt>  </td><td width=20><td>open collector</td></tr>
<tr><td><tt>PIN_DIRECTION_PWR</tt> </td><td width=20><td>power input pin</td></tr>
<tr><td><tt>PIN_DIRECTION_PAS</tt> </td><td width=20><td>passive</td></tr>
<tr><td><tt>PIN_DIRECTION_HIZ</tt> </td><td width=20><td>high impedance output</td></tr>
<tr><td><tt>PIN_DIRECTION_SUP</tt> </td><td width=20><td>supply pin</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PIN_FUNCTION_FLAG_NONE</tt>  </td><td width=20><td>no symbol</td></tr>
<tr><td><tt>PIN_FUNCTION_FLAG_DOT</tt>   </td><td width=20><td>inverter symbol</td></tr>
<tr><td><tt>PIN_FUNCTION_FLAG_CLK</tt>   </td><td width=20><td>clock symbol</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PIN_LENGTH_POINT</tt>  </td><td width=20><td>no wire</td></tr>
<tr><td><tt>PIN_LENGTH_SHORT</tt>  </td><td width=20><td>0.1 inch wire</td></tr>
<tr><td><tt>PIN_LENGTH_MIDDLE</tt> </td><td width=20><td>0.2 inch wire</td></tr>
<tr><td><tt>PIN_LENGTH_LONG</tt>   </td><td width=20><td>0.3 inch wire</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PIN_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a pin name (used in formatted output only)</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PIN_VISIBLE_FLAG_OFF</tt>   </td><td width=20><td>no name drawn</td></tr>
<tr><td><tt>PIN_VISIBLE_FLAG_PAD</tt>   </td><td width=20><td>pad name drawn</td></tr>
<tr><td><tt>PIN_VISIBLE_FLAG_PIN</tt>   </td><td width=20><td>pin name drawn</td></tr>
</table>
<h2>Note</h2>
The <tt>contact</tt> data member returns the <a href=#179>contact</a>
that has been assigned to the pin through a <a href=#40>CONNECT</a>
command. It can be used as a boolean function to check whether a contact has been
assigned to a pin (see example below).
<p>
The coordinates (and layer, in case of an SMD) of the contact returned by
the <tt>contact</tt> data member depend on the context in which it is called:
<ul>
<li>if the pin is derived from a UL_PART that is used on a sheet, and if there
is a corresponding element on the board, the resulting contact will have
the coordinates as used on the board
<li>in all other cases, the coordinates of the contact will be the same as
defined in the package drawing
</ul>
The <tt>name</tt> data member always returns the name of the pin as it was defined
in the library, with any <tt>'@'</tt> character for pins with the same name left intact
(see the <a href=#75>PIN</a> command for details).<br>
The <tt>texts</tt> loop member, on the other hand, returns the pin name (if it is
visible) in the same way as it is displayed in the current drawing type.
<p>
The <tt>net</tt> data member returns the name of the net to which this pin is connected
(only available in a schematic context).
<h2>Example</h2>
<pre>
library(L) {
  L.symbols(S) {
    printf("Symbol: %s\n", S.name);
    S.pins(P) {
      printf("\tPin: %s, (%d %d)", P.name, P.x, P.y);
      if (P.direction == PIN_DIRECTION_IN)
         printf(" input");
      if ((P.function &amp; PIN_FUNCTION_FLAG_DOT) != 0)
         printf(" inverted");
      printf("\n");
      }
    }
  L.devices(D) {
    D.gates(G) {
      G.symbol.pins(P) {
        if (!P.contact)
           printf("Unconnected pin: %s/%s/%s\n", D.name, G.name, P.name);
        }
      }
    }
  }
</pre>


<a name=198>
<h1>UL_PINREF</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>instance</tt>     </td><td width=20><td><a href=#188>UL_INSTANCE</a></td></tr>
<tr><td><tt>part</tt>         </td><td width=20><td><a href=#196>UL_PART</a></td></tr>
<tr><td><tt>pin</tt>          </td><td width=20><td><a href=#197>UL_PIN</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#202>UL_SEGMENT</a>,
<a href=#180>UL_CONTACTREF</a>
<h2>Example</h2>
<pre>
schematic(SCH) {
  SCH.sheets(SH) {
    printf("Sheet: %d\n", SH.number);
    SH.nets(N) {
      printf("\tNet: %s\n", N.name);
      N.segments(SEG) {
        SEG.pinrefs(P) {
          printf("connected to: %s, %s, %s\n",
                 P.part.name, P.instance.name, P.pin.name);
          }
        }
      }
    }
  }
</pre>


<a name=199>
<h1>UL_POLYGON</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>isolate</tt>      </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>orphans</tt>      </td><td width=20><td><a href=#166>int</a> (0=off, 1=on)</td></tr>
<tr><td><tt>pour</tt>         </td><td width=20><td><a href=#166>int</a> (<tt>POLYGON_POUR_...</tt>)</td></tr>
<tr><td><tt>rank</tt>         </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>spacing</tt>      </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>thermals</tt>     </td><td width=20><td><a href=#166>int</a> (0=off, 1=on)</td></tr>
<tr><td><tt>width</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>contours()</tt>   </td><td width=20><td><a href=#209>UL_WIRE</a> (see note)</td></tr>
<tr><td><tt>fillings()</tt>   </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#194>UL_PACKAGE</a>,
<a href=#203>UL_SHEET</a>,
<a href=#204>UL_SIGNAL</a>,
<a href=#206>UL_SYMBOL</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>POLYGON_POUR_SOLID</tt>   </td><td width=20><td>solid</td></tr>
<tr><td><tt>POLYGON_POUR_HATCH</tt>   </td><td width=20><td>hatch</td></tr>
</table>
<h2>Note</h2>
The <tt>contours()</tt> and <tt>fillings()</tt> loop members loop through the
wires that are used to draw the calculated polygon if it is part of a signal and
the polygon has been calculated by the <a href=#81>RATSNEST</a>
command. The <tt>wires()</tt> loop member always loops through the polygon
wires as they were drawn by the user. For an uncalculated signal polygon
<tt>contours()</tt> does the same as <tt>wires()</tt>, and <tt>fillings()</tt>
does nothing.
<p>
If the <tt>contours()</tt> loop member is called without a second parameter,
it loops through all of the contour wires, regardless whether they
belong to a positive or a negative polygon. If you are interested in getting
the positive and negative contour wires separately, you can call <tt>contours()</tt>
with an additional integer parameter (see the second example below). The sign of
that parameter determines whether a positive or a negative polygon will be handled,
and the value indicates the index of that polygon. If there is no polygon with the
given index, the statement will not be executed. Another advantage of this method
is that you don't need to determine the beginning and end of a particular polygon
yourself (by comparing coordinates). For any given index, the statement will be
executed for all the wires of that polygon.
With the second parameter <tt>0</tt> the behavior is the same
as without a second parameter.
<h2>Polygon width</h2>
When using the <tt>fillings()</tt> loop member to get the fill wires of a solid
polygon, make sure the <i>width</i> of the polygon is not zero (actually it should
be quite a bit larger than zero, for example at least the hardware resolution of
the output device you are going to draw on). <b>Filling a polygon with zero width
may result in enormous amounts of data, since it will be calculated with the
smallest editor resolution of 1/10000mm!</b>
<h2>Partial polygons</h2>
A calculated signal polygon may consist of several distinct parts (called
<i>positive</i> polygons), each of which can contain extrusions (<i>negative</i>
polygons) resulting from other objects being subtracted from the polygon.
Negative polygons can again contain other positive polygons and so on.
<p>
The wires looped through by <tt>contours()</tt> always start with a positive
polygon. To find out where one partial polygon ends and the next one begins, simply
store the (x1,y1) coordinates of the first wire and check them against
(x2,y2) of every following wire. As soon as these are equal, the last wire
of a partial polygon has been found. It is also guaranteed that the second
point (x2,y2) of one wire is identical to the first point (x1,y1) of the
next wire in that partial polygon.
<p>
To find out where the "inside" and the "outside" of the polygon lays,
take any contour wire and imagine looking from its point (x1,y1) to (x2,y2).
The "inside" of the polygon is always on the right side of the wire.
Note that if you simply want to draw the polygon you won't need all these
details.
<h2>Example</h2>
<pre>
board(B) {
  B.signals(S) {
    S.polygons(P) {
      int x0, y0, first = 1;
      P.contours(W) {
        if (first) {
           // a new partial polygon is starting
           x0 = W.x1;
           y0 = W.y1;
           }
        // ...
        // do something with the wire
        // ...
        if (first)
           first = 0;
        else if (W.x2 == x0 &amp;&amp; W.y2 == y0) {
           // this was the last wire of the partial polygon,
           // so the next wire (if any) will be the first wire
           // of the next partial polygon
           first = 1;
           }
        }
      }
    }
  }
</pre>
<p>
<pre>
board(B) {
  B.signals(S) {
    S.polygons(P) {
      // handle only the "positive" polygons:
      int i = 1;
      int active;
      do {
         active = 0;
         P.contours(W, i) {
           active = 1;
           // do something with the wire
           }
         i++;
         } while (active);
      }
    }
  }
</pre>


<a name=200>
<h1>UL_RECTANGLE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0.0</tt>...<tt>359.9</tt>)</td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x1, y1</tt>       </td><td width=20><td><a href=#166>int</a> (lower left corner)</td></tr>
<tr><td><tt>x2, y2</tt>       </td><td width=20><td><a href=#166>int</a> (upper right corner)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#194>UL_PACKAGE</a>,
<a href=#203>UL_SHEET</a>,
<a href=#206>UL_SYMBOL</a>
<p>
<tt>angle</tt> defines how many degrees the rectangle is rotated counterclockwise
around its center. The center coordinates are given by <tt>(x1+x2)/2</tt> and <tt>(y1+y2)/2</tt>.
<h2>Example</h2>
<pre>
board(B) {
  B.rectangles(R) {
    printf("Rectangle: (%d %d), (%d %d)\n",
           R.x1, R.y1, R.x2, R.y2);
    }
  }
</pre>


<a name=201>
<h1>UL_SCHEMATIC</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>grid</tt>         </td><td width=20><td><a href=#186>UL_GRID</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (see note)</td></tr>
<tr><td><tt>xreflabel</tt>    </td><td width=20><td><a href=#168>string</a></td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>attributes()</tt>  </td><td width=20><td><a href=#174>UL_ATTRIBUTE</a> (see note)</td></tr>
<tr><td><tt>classes()</tt>    </td><td width=20><td><a href=#178>UL_CLASS</a></td></tr>
<tr><td><tt>layers()</tt>     </td><td width=20><td><a href=#191>UL_LAYER</a></td></tr>
<tr><td><tt>libraries()</tt>  </td><td width=20><td><a href=#192>UL_LIBRARY</a></td></tr>
<tr><td><tt>nets()</tt>       </td><td width=20><td><a href=#193>UL_NET</a></td></tr>
<tr><td><tt>parts()</tt>      </td><td width=20><td><a href=#196>UL_PART</a></td></tr>
<tr><td><tt>sheets()</tt>     </td><td width=20><td><a href=#203>UL_SHEET</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#192>UL_LIBRARY</a>
<h2>Note</h2>
The <tt>name</tt> member returns the full file name, including the directory.
<p>
The <tt>xreflabel</tt> member returns the format string used to display
<a href=#60>cross-reference labels</a>.
<p>
The <tt>attributes()</tt> loop member loops through the <i>global</i> attributes.
<h2>Example</h2>
<pre>
schematic(S) {
  S.parts(P) printf("Part: %s\n", P.name);
  }
</pre>


<a name=202>
<h1>UL_SEGMENT</h1>
<dl>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>junctions()</tt>  </td><td width=20><td><a href=#189>UL_JUNCTION</a> (see note)</td></tr>
<tr><td><tt>labels()</tt>     </td><td width=20><td><a href=#190>UL_LABEL</a></td></tr>
<tr><td><tt>pinrefs()</tt>    </td><td width=20><td><a href=#198>UL_PINREF</a> (see note)</td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a> (deprecated, see note)</td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#176>UL_BUS</a>,
<a href=#193>UL_NET</a>
<h2>Note</h2>
The <tt>junctions()</tt> and <tt>pinrefs()</tt> loop members are only available
for net segments.
<p>
The <tt>texts()</tt> loop member was used in older EAGLE versions to loop through
the labels of a segment, and is only present for compatibility. It will not
deliver the text of cross-reference labels at the correct position. Use the
<tt>labels()</tt> loop member to access a segment's labels.
<h2>Example</h2>
<pre>
schematic(SCH) {
  SCH.sheets(SH) {
    printf("Sheet: %d\n", SH.number);
    SH.nets(N) {
      printf("\tNet: %s\n", N.name);
      N.segments(SEG) {
        SEG.pinrefs(P) {
          printf("connected to: %s, %s, %s\n",
                 P.part.name, P.instance.name, P.pin.name);
          }
        }
      }
    }
  }
</pre>


<a name=203>
<h1>UL_SHEET</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>area</tt>         </td><td width=20><td><a href=#173>UL_AREA</a></td></tr>
<tr><td><tt>number</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>busses()</tt>     </td><td width=20><td><a href=#176>UL_BUS</a></td></tr>
<tr><td><tt>circles()</tt>    </td><td width=20><td><a href=#177>UL_CIRCLE</a></td></tr>
<tr><td><tt>frames()</tt>     </td><td width=20><td><a href=#184>UL_FRAME</a></td></tr>
<tr><td><tt>nets()</tt>       </td><td width=20><td><a href=#193>UL_NET</a></td></tr>
<tr><td><tt>parts()</tt>      </td><td width=20><td><a href=#196>UL_PART</a></td></tr>
<tr><td><tt>polygons()</tt>   </td><td width=20><td><a href=#199>UL_POLYGON</a></td></tr>
<tr><td><tt>rectangles()</tt> </td><td width=20><td><a href=#200>UL_RECTANGLE</a></td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a></td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#201>UL_SCHEMATIC</a>
<h2>Example</h2>
<pre>
schematic(SCH) {
  SCH.sheets(S) {
    printf("Sheet: %d\n", S.number);
    }
  }
</pre>


<a name=204>
<h1>UL_SIGNAL</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>airwireshidden</tt></td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>class</tt>         </td><td width=20><td><a href=#178>UL_CLASS</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>SIGNAL_NAME_LENGTH</tt>)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>contactrefs()</tt> </td><td width=20><td><a href=#180>UL_CONTACTREF</a></td></tr>
<tr><td><tt>polygons()</tt>   </td><td width=20><td><a href=#199>UL_POLYGON</a></td></tr>
<tr><td><tt>vias()</tt>       </td><td width=20><td><a href=#208>UL_VIA</a></td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>SIGNAL_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a signal name (used in formatted output only)</td></tr>
</table>
<h2>Example</h2>
<pre>
board(B) {
  B.signals(S) printf("Signal: %s\n", S.name);
  }
</pre>


<a name=205>
<h1>UL_SMD</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0.0</tt>...<tt>359.9</tt>)</td></tr>
<tr><td><tt>dx[layer], dy[layer]</tt>   </td><td width=20><td><a href=#166>int</a> (size)</td></tr>
<tr><td><tt>flags</tt>        </td><td width=20><td><a href=#166>int</a> (<tt>SMD_FLAG_...</tt>)</td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a> (see note)</td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>SMD_NAME_LENGTH</tt>)</td></tr>
<tr><td><tt>roundness</tt>    </td><td width=20><td><a href=#166>int</a> (see note)</td></tr>
<tr><td><tt>signal</tt>       </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (center point, see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#194>UL_PACKAGE</a>,
<a href=#179>UL_CONTACT</a>,
<a href=#195>UL_PAD</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>SMD_FLAG_STOP</tt>   </td><td width=20><td>generate stop mask</td></tr>
<tr><td><tt>SMD_FLAG_THERMALS</tt>         </td><td width=20><td>generate thermals</td></tr>
<tr><td><tt>SMD_FLAG_CREAM</tt>            </td><td width=20><td>generate cream mask</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>SMD_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of an smd name (same as <tt>CONTACT_NAME_LENGTH</tt>)</td></tr>
</table>
<h2>Note</h2>
The parameters of the smd depend on the context in which it is accessed:
<ul>
<li>if the smd is derived from a UL_LIBRARY context, the coordinates (<tt>x, y</tt>), <tt>angle</tt>, <tt>layer</tt> and <tt>roundness</tt> of the smd will be the same as
defined in the package drawing
<li>in all other cases, they will have the actual values from the board
</ul>
If the <tt>dx</tt> and <tt>dy</tt> data members are called with an optional layer index,
the data for that layer is returned according to the <a href=#133>Design Rules</a>.
Valid <a href=#191>layers</a> are LAYER_TOP, LAYER_TSTOP and LAYER_TCREAM for a via in the Top layer, and
LAYER_BOTTOM, LAYER_BSTOP and LAYER_BCREAM for a via in the Bottom layer, respectively.
<p>
<tt>angle</tt> defines how many degrees the smd is rotated counterclockwise
around its center.
<p>
The value returned by <tt>flags</tt> must be masked with the <tt>SMD_FLAG_...</tt>
constants to determine the individual flag settings, as in
<pre>
if (smd.flags &amp; SMD_FLAG_STOP) {
   ...
   }
</pre>
Note that if your ULP just wants to draw the objects, you don't need to check these
flags explicitly. The <tt>dx[]</tt> and <tt>dy[]</tt> members will return
the proper data; for instance, if <tt>SMD_FLAG_STOP</tt> is set, <tt>dx[LAYER_TSTOP]</tt>
will return <tt>0</tt>, which should result in nothing being drawn in that layer.
The <tt>flags</tt> member is mainly for ULPs that want to create script files that
create library objects.
<h2>Example</h2>
<pre>
library(L) {
  L.packages(PAC) {
    PAC.contacts(C) {
      if (C.smd)
         printf("Smd: '%s', (%d %d), dx=%d, dy=%d\n",
                 C.name, C.smd.x, C.smd.y, C.smd.dx, C.smd.dy);
      }
    }
  }
</pre>


<a name=206>
<h1>UL_SYMBOL</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>area</tt>         </td><td width=20><td><a href=#173>UL_AREA</a></td></tr>
<tr><td><tt>library</tt>      </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>name</tt>         </td><td width=20><td><a href=#168>string</a> (<tt>SYMBOL_NAME_LENGTH</tt>)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>circles()</tt>    </td><td width=20><td><a href=#177>UL_CIRCLE</a></td></tr>
<tr><td><tt>frames()</tt>     </td><td width=20><td><a href=#184>UL_FRAME</a></td></tr>
<tr><td><tt>rectangles()</tt> </td><td width=20><td><a href=#200>UL_RECTANGLE</a></td></tr>
<tr><td><tt>pins()</tt>       </td><td width=20><td><a href=#197>UL_PIN</a></td></tr>
<tr><td><tt>polygons()</tt>   </td><td width=20><td><a href=#199>UL_POLYGON</a></td></tr>
<tr><td><tt>texts()</tt>      </td><td width=20><td><a href=#207>UL_TEXT</a> (see note)</td></tr>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a></td></tr>
</table>
</dl>
<b>See also</b> <a href=#185>UL_GATE</a>,
<a href=#192>UL_LIBRARY</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>SYMBOL_NAME_LENGTH</tt>   </td><td width=20><td>max. recommended length of a symbol name (used in formatted output only)</td></tr>
</table>
<h2>Note</h2>
If the UL_SYMBOL is derived from a UL_INSTANCE, the <tt>texts()</tt> member only loops through the
non-detached texts of that instance.
<h2>Example</h2>
<pre>
library(L) {
  L.symbols(S) printf("Sym: %s\n", S.name);
  }
</pre>


<a name=207>
<h1>UL_TEXT</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>angle</tt>        </td><td width=20><td><a href=#167>real</a> (<tt>0.0</tt>...<tt>359.9</tt>)</td></tr>
<tr><td><tt>font</tt>         </td><td width=20><td><a href=#166>int</a> (<tt>FONT_...</tt>)</td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>mirror</tt>       </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>ratio</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>size</tt>         </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>spin</tt>         </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>value</tt>        </td><td width=20><td><a href=#168>string</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (origin point)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>wires()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a> (see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#194>UL_PACKAGE</a>,
<a href=#203>UL_SHEET</a>,
<a href=#206>UL_SYMBOL</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>FONT_VECTOR</tt>   </td><td width=20><td>vector font</td></tr>
<tr><td><tt>FONT_PROPORTIONAL</tt>       </td><td width=20><td>proportional font</td></tr>
<tr><td><tt>FONT_FIXED</tt>              </td><td width=20><td>fixed font</td></tr>
</table>
<h2>Note</h2>
The <tt>wires()</tt> loop member always accesses the individual wires the text
is composed of when using the vector font, even if the actual font is not
<tt>FONT_VECTOR</tt>.
<p>
If the UL_TEXT is derived from a UL_ELEMENT or UL_INSTANCE context, the member
values will be those of the actual text as located in the board or sheet drawing.
<h2>Example</h2>
<pre>
board(B) {
  B.texts(T) {
    printf("Text: %s\n", T.value);
    }
  }
</pre>


<a name=208>
<h1>UL_VIA</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>diameter[layer]</tt>     </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>drill</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>drillsymbol</tt>  </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>end</tt>          </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>flags</tt>        </td><td width=20><td><a href=#166>int</a> (<tt>VIA_FLAG_...</tt>)</td></tr>
<tr><td><tt>shape[layer]</tt> </td><td width=20><td><a href=#166>int</a> (<tt>VIA_SHAPE_...</tt>)</td></tr>
<tr><td><tt>start</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x, y</tt>         </td><td width=20><td><a href=#166>int</a> (center point)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#204>UL_SIGNAL</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>VIA_FLAG_STOP</tt>   </td><td width=20><td>always generate stop mask</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>VIA_SHAPE_SQUARE</tt>   </td><td width=20><td>square</td></tr>
<tr><td><tt>VIA_SHAPE_ROUND</tt>    </td><td width=20><td>round</td></tr>
<tr><td><tt>VIA_SHAPE_OCTAGON</tt>  </td><td width=20><td>octagon</td></tr>
<tr><td><tt>VIA_SHAPE_ANNULUS</tt> </td><td width=20><td>annulus</td></tr>
<tr><td><tt>VIA_SHAPE_THERMAL</tt> </td><td width=20><td>thermal</td></tr>
</table>
<h2>Note</h2>
The diameter and shape of the via depend on the layer for which they shall be retrieved,
because they may be different in each layer depending on the <a href=#133>Design Rules</a>.
If one of the <a href=#191>layers</a> LAYER_TOP...LAYER_BOTTOM, LAYER_TSTOP or LAYER_BSTOP
is given as the index to the diameter or shape data member, the resulting value will be calculated
according to the Design Rules. If LAYER_VIAS is given, the raw value as defined in the via  will
be returned.
<p>
Note that <tt>diameter</tt> and <tt>shape</tt> will always return the diameter or
shape that a via would have in the given layer, even if that particular via doesn't
cover that layer (or if that layer isn't used in the layer setup at all).
<p>
<tt>start</tt> and <tt>end</tt> return the layer numbers in which that via starts and
ends. The value of <tt>start</tt> will always be less than that of <tt>end</tt>.
<p>
<tt>drillsymbol</tt> returns the number of the drill symbol that has been assigned
to this drill diameter (see the manual for a list of defined drill symbols).
A value of <tt>0</tt> means that no symbol has been assigned to this drill diameter.
<h2>Example</h2>
<pre>
board(B) {
  B.signals(S) {
    S.vias(V) {
      printf("Via: (%d %d)\n", V.x, V.y);
      }
    }
  }
</pre>


<a name=209>
<h1>UL_WIRE</h1>
<dl>
<dt>
<b>Data members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>arc</tt>  </td><td width=20><td><a href=#172>UL_ARC</a></td></tr>
<tr><td><tt>cap</tt>          </td><td width=20><td><a href=#166>int</a> (<tt>CAP_...</tt>)</td></tr>
<tr><td><tt>curve</tt>        </td><td width=20><td><a href=#167>real</a></td></tr>
<tr><td><tt>layer</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>style</tt>        </td><td width=20><td><a href=#166>int</a> (<tt>WIRE_STYLE_...</tt>)</td></tr>
<tr><td><tt>width</tt>        </td><td width=20><td><a href=#166>int</a></td></tr>
<tr><td><tt>x1, y1</tt>       </td><td width=20><td><a href=#166>int</a> (starting point)</td></tr>
<tr><td><tt>x2, y2</tt>       </td><td width=20><td><a href=#166>int</a> (end point)</td></tr>
</table>
<dt>
<b>Loop members</b>
<dd>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>pieces()</tt>      </td><td width=20><td><a href=#209>UL_WIRE</a> (see note)</td></tr>
</table>
</dl>
<b>See also</b> <a href=#175>UL_BOARD</a>,
<a href=#194>UL_PACKAGE</a>,
<a href=#202>UL_SEGMENT</a>,
<a href=#203>UL_SHEET</a>,
<a href=#204>UL_SIGNAL</a>,
<a href=#206>UL_SYMBOL</a>,
<a href=#172>UL_ARC</a>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>CAP_FLAT</tt>  </td><td width=20><td>flat arc ends</td></tr>
<tr><td><tt>CAP_ROUND</tt>   </td><td width=20><td>round arc ends</td></tr>
<tr><td><tt>WIRE_STYLE_CONTINUOUS</tt>   </td><td width=20><td>continuous</td></tr>
<tr><td><tt>WIRE_STYLE_LONGDASH</tt>    </td><td width=20><td>long dash</td></tr>
<tr><td><tt>WIRE_STYLE_SHORTDASH</tt>   </td><td width=20><td>short dash</td></tr>
<tr><td><tt>WIRE_STYLE_DASHDOT</tt>     </td><td width=20><td>dash dot</td></tr>
</table>
<h2>Wire Style</h2>
A UL_WIRE that has a <i>style</i> other than <tt>WIRE_STYLE_CONTINUOUS</tt> can use the
<tt>pieces()</tt> loop member to access the individual segments that constitute
for example a dashed wire. If <tt>pieces()</tt> is called for a UL_WIRE with
<tt>WIRE_STYLE_CONTINUOUS</tt>, a single segment will be accessible which is just
the same as the original UL_WIRE. The <tt>pieces()</tt> loop member can't be called
from a UL_WIRE that itself has been returned by a call to <tt>pieces()</tt> (this would
cause an infinite recursion).
<h2>Arcs at Wire level</h2>
Arcs are basically wires, with a few additional properties. At the first level
arcs are treated exactly the same as wires, meaning they have a start and an end point,
a width, layer and wire style. In addition to these an arc, at the wire level, has
a <i>cap</i> and a <i>curve</i> parameter. <i>cap</i> defines whether the arc endings
are round or flat, and <i>curve</i> defines the "curvature" of the arc. The valid
range for <i>curve</i> is <tt>-360</tt>..<tt>+360</tt>, and its value means what part of
a full circle the arc consists of. A value of <tt>90</tt>, for instance, would
result in a <tt>90&deg;</tt> arc, while <tt>180</tt> would give you a semicircle.
The maximum value of <tt>360</tt> can only be reached theoretically, since this would
mean that the arc consists of a full circle, which, because the start and end points
have to lie on the circle, would have to have an infinitely large diameter.
Positive values for <i>curve</i> mean that the arc is drawn in a mathematically positive
sense (i.e. counterclockwise). If <i>curve</i> is <tt>0</tt>, the arc is a straight
line ("no curvature"), which is actually a wire.
<p>
The <i>cap</i> parameter only has a meaning for actual arcs, and will always return
<tt>CAP_ROUND</tt> for a straight wire.
<p>
Whether or not an UL_WIRE is an arc can be determined by checking the boolean return
value of the <tt>arc</tt> data member. If it returns <tt>0</tt>, we have a straight
wire, otherwise an arc. If <tt>arc</tt> returns a non-zero value it may be further
dereferenced to access the <a href=#172>UL_ARC</a> specific parameters start
and end angle, radius and center point. Note that you may only need these additional
parameters if you are going to draw the arc or process it in other ways where the
actual shape is important.
<h2>Example</h2>
<pre>
board(B) {
  B.wires(W) {
    printf("Wire: (%d %d) (%d %d)\n",
           W.x1, W.y1, W.x2, W.y2);
    }
  }
</pre>


<a name=210>
<h1>Definitions</h1>
The data items to be used in a User Language Program must be defined
before they can be used.
<p>
There are three kinds of definitions:
<ul>
<li><a href=#211>Constant Definitions</a>
<li><a href=#212>Variable Definitions</a>
<li><a href=#213>Function Definitions</a>
</ul>
The scope of a <i>constant</i> or <i>variable</i> definition
goes from the line in which it has been defined to the end of the current
<a href=#229>block</a>, or to the end of the User
Language Program, if the definition appeared outside any block.
<p>
The scope of a <i>function</i> definition goes from the closing
brace (<tt>}</tt>) of the function body to the end of the User Language
Program.


<a name=211>
<h1>Constant Definitions</h1>
<i>Constants</i> are defined using the keyword <tt>enum</tt>, as in
<pre>
enum { a, b, c };
</pre>
which would define the three constants <tt>a</tt>, <tt>b</tt> and <tt>c</tt>,
giving them the values <tt>0</tt>, <tt>1</tt> and <tt>2</tt>, respectively.
<p>
Constants may also be initialized to specific values, like
<pre>
enum { a, b = 5, c };
</pre>
where <tt>a</tt> would be <tt>0</tt>, <tt>b</tt> would be <tt>5</tt> and
<tt>c</tt> would be <tt>6</tt>.


<a name=212>
<h1>Variable Definitions</h1>
The general syntax of a <i>variable definition</i> is
<pre>
[numeric] type identifier [= initializer][, ...];
</pre>
where <tt>type</tt> is one of the
<a href=#164>data</a> or
<a href=#171>object types</a>,
<tt>identifier</tt> is the name of the variable, and <tt>initializer</tt>
is a optional initial value.
<p>
Multiple variable definitions of the same <tt>type</tt> are separated
by commas (<tt>,</tt>).
<p>
If <tt>identifier</tt> is followed by a pair of
<a href=#157>brackets</a> (<tt>[]</tt>), this defines an array
of variables of the given <tt>type</tt>. The size of an array is
automatically adjusted at runtime.
<p>
The optional keyword <tt>numeric</tt> can be used with
<a href=#168>string</a> arrays to have them sorted
alphanumerically by the <a href=#267>sort()</a> function.
<p>
By default (if no <tt>initializer</tt> is present),
<a href=#164>data variables</a> are set to <tt>0</tt>
(or <tt>""</tt>, in case of a string), and
<a href=#171>object variables</a> are "invalid".
<h2>Examples</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>int i;</tt>   </td><td width=20><td>defines an <a href=#166>int</a> variable named <tt>i</tt></td></tr>
<tr><td><tt>string s = "Hello";</tt> </td><td width=20><td>defines a <a href=#168>string</a> variable named <tt>s</tt> and initializes it to <tt>"Hello"</tt></td></tr>
<tr><td><tt>real a, b = 1.0, c;</tt> </td><td width=20><td>defines three <a href=#167>real</a> variables named <tt>a</tt>, <tt>b</tt> and <tt>c</tt>, initializing <tt>b</tt> to the value <tt>1.0</tt></td></tr>
<tr><td><tt>int n[] = { 1, 2, 3 };</tt> </td><td width=20><td>defines an array of <a href=#166>int</a>, initializing the first three elements to <tt>1</tt>, <tt>2</tt> and <tt>3</tt></td></tr>
<tr><td><tt>numeric string names[];</tt> </td><td width=20><td>defines a <a href=#168>string</a> array that can be sorted alphanumerically</td></tr>
<tr><td><tt>UL_WIRE w;</tt> </td><td width=20><td>defines a <a href=#209>UL_WIRE</a> object named <tt>w</tt></td></tr>
</table>
The members of array elements of <a href=#171>object types</a> can't be accessed directly:
<pre>
UL_SIGNAL signals[];
...
UL_SIGNAL s = signals[0];
printf("%s", s.name);
</pre>


<a name=213>
<h1>Function Definitions</h1>
You can write your own User Language functions and call them just like the
<a href=#243>Builtin Functions</a>.
<p>
The general syntax of a <i>function definition</i> is
<pre>
type identifier(parameters)
{
  statements
}
</pre>
where <tt>type</tt> is one of the
<a href=#164>data</a> or
<a href=#171>object types</a>,
<tt>identifier</tt> is the name of the function,
<tt>parameters</tt> is a list of comma separated parameter definitions,
and <tt>statements</tt> is a sequence of <a href=#228>statements</a>.
<p>
Functions that do not return a value have the type <tt>void</tt>.
<p>
A function must be defined <b>before</b> it can be called, and function
calls can not be recursive (a function cannot call itself).
<p>
The statements in the function body may modify the values of the parameters,
but this will not have any effect on the arguments of the
<a href=#227>function call</a>.
<p>
Execution of a function can be terminated by the
<tt><a href=#237>return</a></tt> statement. Without any
<tt>return</tt> statement the function body is executed until it's closing
brace (<tt>}</tt>).
<p>
A call to the <tt><a href=#262>exit()</a></tt> function will
terminate the entire User Language Program.
<h2>The special function <tt>main()</tt></h2>
If your User Language Program contains a function called
<tt>main()</tt>, that function will be explicitly called as the
main function, and it's return value will be the
<a href=#140>return value</a> of the program.
<p>
Command line arguments are available to the program through the global
<a href=#242>Builtin Variables</a> <tt>argc</tt> and <tt>argv</tt>.
<h2>Example</h2>
<pre>
int CountDots(string s)
{
  int dots = 0;
  for (int i = 0; s[i]; ++i)
      if (s[i] == '.')
         ++dots;
  return dots;
}
string dotted = "This.has.dots...";
output("test") {
  printf("Number of dots: %d\n",
                 CountDots(dotted));
  }
</pre>


<a name=214>
<h1>Operators</h1>
The following table lists all of the User Language operators, in order
of their precedence (<i>Unary</i> having the highest precedence,
<i>Comma</i> the lowest):
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Unary           </td><td width=20><td><tt><a href=#216>!</a> <a href=#215>~</a> <a href=#219>+ - ++ --</a></tt></td></tr>
<tr><td>Multiplicative  </td><td width=20><td><tt><a href=#219>* / %</a></tt></td></tr>
<tr><td>Additive        </td><td width=20><td><tt><a href=#219>+ -</a></tt></td></tr>
<tr><td>Shift           </td><td width=20><td><tt><a href=#215>&lt;&lt; &gt;&gt;</a></tt></td></tr>
<tr><td>Relational      </td><td width=20><td><tt><a href=#217>&lt; &lt;= &gt; &gt;=</a></tt></td></tr>
<tr><td>Equality        </td><td width=20><td><tt><a href=#217>== !=</a></tt></td></tr>
<tr><td>Bitwise AND     </td><td width=20><td><tt><a href=#215>&amp;</a></tt></td></tr>
<tr><td>Bitwise XOR     </td><td width=20><td><tt><a href=#215>^</a></tt></td></tr>
<tr><td>Bitwise OR      </td><td width=20><td><tt><a href=#215>|</a></tt></td></tr>
<tr><td>Logical AND     </td><td width=20><td><tt><a href=#216>&amp;&amp;</a></tt></td></tr>
<tr><td>Logical OR      </td><td width=20><td><tt><a href=#216>||</a></tt></td></tr>
<tr><td>Conditional     </td><td width=20><td><tt><a href=#218>?:</a></tt></td></tr>
<tr><td>Assignment      </td><td width=20><td><tt><a href=#219>= *= /= %= += -=</a> <a href=#215>&amp;= ^= |= &lt;&lt;= &gt;&gt;=</a></tt></td></tr>
<tr><td>Comma           </td><td width=20><td><tt><a href=#218>,</a></tt></td></tr>
</table>
<p>
Associativity is <b>left to right</b> for all operators, except for
<i>Unary</i>, <i>Conditional</i> and <i>Assignment</i>,
which are <b>right to left</b> associative.
<p>
The normal operator precedence can be altered by the use of
<a href=#158>parentheses</a>.


<a name=215>
<h1>Bitwise Operators</h1>
Bitwise operators work only with data types
<tt><a href=#165>char</a></tt> and
<tt><a href=#166>int</a></tt>.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b>Unary</b>   </td><td width=20><td></td></tr>
<tr><td><tt>~</tt>          </td><td width=20><td>Bitwise (1's) complement</td></tr>
<tr><td><b>Binary</b>  </td><td width=20><td></td></tr>
<tr><td><tt>&lt;&lt;</tt>         </td><td width=20><td>Shift left</td></tr>
<tr><td><tt>&gt;&gt;</tt>         </td><td width=20><td>Shift right</td></tr>
<tr><td><tt>&amp;</tt>          </td><td width=20><td>Bitwise AND</td></tr>
<tr><td><tt>^</tt>          </td><td width=20><td>Bitwise XOR</td></tr>
<tr><td><tt>|</tt>          </td><td width=20><td>Bitwise OR</td></tr>
<tr><td><b>Assignment</b>  </td><td width=20><td></td></tr>
<tr><td><tt>&amp;=</tt>         </td><td width=20><td>Assign bitwise AND</td></tr>
<tr><td><tt>^=</tt>         </td><td width=20><td>Assign bitwise XOR</td></tr>
<tr><td><tt>|=</tt>         </td><td width=20><td>Assign bitwise OR</td></tr>
<tr><td><tt>&lt;&lt;=</tt>        </td><td width=20><td>Assign left shift</td></tr>
<tr><td><tt>&gt;&gt;=</tt>        </td><td width=20><td>Assign right shift</td></tr>
</table>


<a name=216>
<h1>Logical Operators</h1>
Logical operators work with <a href=#221>expressions</a>
of any data type.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b>Unary</b>   </td><td width=20><td></td></tr>
<tr><td><tt>!</tt>          </td><td width=20><td>Logical NOT</td></tr>
<tr><td><b>Binary</b>  </td><td width=20><td></td></tr>
<tr><td><tt>&amp;&amp;</tt>         </td><td width=20><td>Logical AND</td></tr>
<tr><td><tt>||</tt>         </td><td width=20><td>Logical OR</td></tr>
</table>
<p>
Using a <tt><a href=#168>string</a></tt> expression with a
logical operator checks whether the string is empty.
<p>
Using an <a href=#171>Object Type</a> with a logical
operator checks whether that object contains valid data.


<a name=217>
<h1>Comparison Operators</h1>
Comparison operators work with <a href=#221>expressions</a>
of any data type,
except <a href=#171>Object Types</a>.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>&lt;</tt>          </td><td width=20><td>Less than</td></tr>
<tr><td><tt>&lt;=</tt>         </td><td width=20><td>Less than or equal to</td></tr>
<tr><td><tt>&gt;</tt>          </td><td width=20><td>Greater than</td></tr>
<tr><td><tt>&gt;=</tt>         </td><td width=20><td>Greater than or equal to</td></tr>
<tr><td><tt>==</tt>         </td><td width=20><td>Equal to</td></tr>
<tr><td><tt>!=</tt>         </td><td width=20><td>Not equal to</td></tr>
</table>


<a name=218>
<h1>Evaluation Operators</h1>
Evaluation operators are used to evaluate <a href=#221>expressions</a>
based on a condition, or to group a sequence of expressions and have them
evaluated as one expression.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>?:</tt>         </td><td width=20><td>Conditional</td></tr>
<tr><td><tt>,</tt>          </td><td width=20><td>Comma</td></tr>
</table>
<p>
The <i>Conditional</i> operator is used to make a decision within
an expression, as in
<pre>
int a;
// ...code that calculates 'a'
string s = a ? "True" : "False";
</pre>
which is basically the same as
<pre>
int a;
string s;
// ...code that calculates 'a'
if (a)
   s = "True";
else
   s = "False";
</pre>
but the advantage of the conditional operator is that it can be used in
an expression.
<p>
The <i>Comma</i> operator is used to evaluate a sequence of expressions
from left to right, using the type and value of the right operand as
the result.
<p>
Note that arguments in a function call as well as multiple variable declarations
also use commas as delimiters, but in that case this is <b>not</b> a
comma operator!


<a name=219>
<h1>Arithmetic Operators</h1>
Arithmetic operators work with data types
<tt><a href=#165>char</a></tt>,
<tt><a href=#166>int</a></tt> and
<tt><a href=#167>real</a></tt>
(except for <tt>++</tt>, <tt>--</tt>, <tt>%</tt> and <tt>%=</tt>).
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b>Unary</b>   </td><td width=20><td></td></tr>
<tr><td><tt>+</tt>          </td><td width=20><td>Unary plus</td></tr>
<tr><td><tt>-</tt>          </td><td width=20><td>Unary minus</td></tr>
<tr><td><tt>++</tt>         </td><td width=20><td>Pre- or postincrement</td></tr>
<tr><td><tt>--</tt>         </td><td width=20><td>Pre- or postdecrement</td></tr>
<tr><td><b>Binary</b>  </td><td width=20><td></td></tr>
<tr><td><tt>*</tt>          </td><td width=20><td>Multiply</td></tr>
<tr><td><tt>/</tt>          </td><td width=20><td>Divide</td></tr>
<tr><td><tt>%</tt>          </td><td width=20><td>Remainder (modulus)</td></tr>
<tr><td><tt>+</tt>          </td><td width=20><td>Binary plus</td></tr>
<tr><td><tt>-</tt>          </td><td width=20><td>Binary minus</td></tr>
<tr><td><b>Assignment</b> </td><td width=20><td></td></tr>
<tr><td><tt>=</tt>          </td><td width=20><td>Simple assignment</td></tr>
<tr><td><tt>*=</tt>         </td><td width=20><td>Assign product</td></tr>
<tr><td><tt>/=</tt>         </td><td width=20><td>Assign quotient</td></tr>
<tr><td><tt>%=</tt>         </td><td width=20><td>Assign remainder (modulus)</td></tr>
<tr><td><tt>+=</tt>         </td><td width=20><td>Assign sum</td></tr>
<tr><td><tt>-=</tt>         </td><td width=20><td>Assign difference</td></tr>
</table>
<p>
<b>See also</b> <a href=#220>String Operators</a>


<a name=220>
<h1>String Operators</h1>
String operators work with data types
<tt><a href=#165>char</a></tt>,
<tt><a href=#166>int</a></tt> and
<tt><a href=#168>string</a></tt>.
The left operand must always be of type
<tt><a href=#168>string</a></tt>.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b>Binary</b>  </td><td width=20><td></td></tr>
<tr><td><tt>+</tt>          </td><td width=20><td>Concatenation</td></tr>
<tr><td><b>Assignment</b> </td><td width=20><td></td></tr>
<tr><td><tt>=</tt>          </td><td width=20><td>Simple assignment</td></tr>
<tr><td><tt>+=</tt>         </td><td width=20><td>Append to string</td></tr>
</table>
<p>
The <tt>+</tt> operator concatenates two strings, or adds a character
to the end of a string and returns the resulting string.
<p>
The <tt>+=</tt> operator appends a string or a character to the end of
a given string.
<p>
<b>See also</b> <a href=#219>Arithmetic Operators</a>


<a name=221>
<h1>Expressions</h1>
An <i>expression</i> can be one of the following:
<ul>
<li><a href=#222>Arithmetic Expression</a>
<li><a href=#223>Assignment Expression</a>
<li><a href=#224>String Expression</a>
<li><a href=#225>Comma Expression</a>
<li><a href=#226>Conditional Expression</a>
<li><a href=#227>Function Call</a>
</ul>
Expressions can be grouped using <a href=#158>parentheses</a>,
and may be recursive, meaning that an expression can consist of
subexpressions.


<a name=222>
<h1>Arithmetic Expression</h1>
An <i>arithmetic expression</i> is any combination of numeric
operands and an <a href=#219>arithmetic operator</a> or a
<a href=#215>bitwise operator</a>.
<h2>Examples</h2>
<pre>
a + b
c++
m &lt;&lt; 1
</pre>


<a name=223>
<h1>Assignment Expression</h1>
An <i>assignment expression</i> consists of a variable on the left
side of an <a href=#219>assignment operator</a>, and an
expression on the right side.
<h2>Examples</h2>
<pre>
a = x + 42
b += c
s = "Hello"
</pre>


<a name=224>
<h1>String Expression</h1>
A <i>string expression</i> is any combination of
<a href=#168>string</a> and <a href=#165>char</a>
operands and a <a href=#220>string operator</a>.
<h2>Examples</h2>
<pre>
s + ".brd"
t + 'x'
</pre>


<a name=225>
<h1>Comma Expression</h1>
A <i>comma expression</i> is a sequence of expressions, delimited by
the <a href=#218>comma operator</a>
<p>
Comma expressions are evaluated left to right, and the result of a comma
expression is the type and value of the rightmost expression.
<h2>Example</h2>
<pre>
i++, j++, k++
</pre>


<a name=226>
<h1>Conditional Expression</h1>
A <i>conditional expression</i> uses the
<a href=#218>conditional operator</a> to make a decision
within an expression.
<h2>Example</h2>
<pre>
int a;
// ...code that calculates 'a'
string s = a ? "True" : "False";
</pre>


<a name=227>
<h1>Function Call</h1>
A <i>function call</i> transfers the program flow to a
<a href=#213>user defined function</a> or a
<a href=#243>builtin function</a>.
The formal parameters defined in the
<a href=#213>function definition</a> are replaced
with the values of the expressions used as the actual arguments of the
function call.
<h2>Example</h2>
<pre>
int p = strchr(s, 'b');
</pre>


<a name=228>
<h1>Statements</h1>
A <i>statement</i> can be one of the following:
<ul>
<li><a href=#229>Compound Statement</a>
<li><a href=#231>Control Statement</a>
<li><a href=#230>Expression Statement</a>
<li><a href=#305>Builtin Statement</a>
<li><a href=#211>Constant Definition</a>
<li><a href=#212>Variable Definition</a>
</ul>
Statements specify the flow of control as a User Language Program
executes. In absence of specific control statements, statements are
executed sequentially in the order of appearance in the ULP file.


<a name=229>
<h1>Compound Statement</h1>
A <i>compound statement</i> (also known as <i>block</i>) is a list
(possibly empty) of statements enclosed in matching braces (<tt>{}</tt>).
Syntactically, a block can be considered to be a single statement, but it
also controls the scoping of identifiers. An
<a href=#149>identifier</a> declared within a block has a
scope starting at the point of declaration and ending at the closing
brace.
<p>
Compound statements can be nested to any depth.


<a name=230>
<h1>Expression Statement</h1>
An <i>expression statement</i> is any
<a href=#221>expression</a> followed by a
<a href=#161>semicolon</a>.
<p>
An expression statement is executed by evaluating the expression.
All side effects of this evaluation are completed before the next
<a href=#228>statement</a> is executed.
Most expression statements are
<a href=#223>assignments</a> or
<a href=#227>function calls</a>.
<p>
A special case is the <i>empty statement</i>, consisting of only a
<a href=#161>semicolon</a>.
An empty statement does nothing, but it may be useful in situations
where the ULP syntax expects a statement but your program does not
need one.


<a name=231>
<h1>Control Statements</h1>
<i>Control statements</i> are used to control the program flow.
<p>
Iteration statements are
<pre>
<a href=#234>do...while</a>
<a href=#235>for</a>
<a href=#239>while</a>
</pre>
Selection statements are
<pre>
<a href=#236>if...else</a>
<a href=#238>switch</a>
</pre>
Jump statements are
<pre>
<a href=#232>break</a>
<a href=#233>continue</a>
<a href=#237>return</a>
</pre>


<a name=232>
<h1>break</h1>
The <i>break</i> statement has the general syntax
<pre>
break;
</pre>
and immediately terminates the <b>nearest</b> enclosing
<a href=#234>do...while</a>,
<a href=#235>for</a>,
<a href=#238>switch</a> or
<a href=#239>while</a>
statement.
This also applies to <i>loop members</i> of <a href=#171>object types</a>.
<p>
Since all of these statements can be intermixed and nested to any
depth, take care to ensure that your <tt>break</tt> exits from the
correct statement.


<a name=233>
<h1>continue</h1>
The <i>continue</i> statement has the general syntax
<pre>
continue;
</pre>
and immediately transfers control to the test condition of the
<b>nearest</b> enclosing
<a href=#234>do...while</a>,
<a href=#239>while</a>, or
<a href=#235>for</a> statement, or to the increment expression
of the <b>nearest</b> enclosing
<a href=#239>for</a>
statement.
<p>
Since all of these statements can be intermixed and nested to any
depth, take care to ensure that your <tt>continue</tt> affects the
correct statement.


<a name=234>
<h1>do...while</h1>
The <i>do...while</i> statement has the general syntax
<pre>
do statement while (condition);
</pre>
and executes the <tt>statement</tt> until the <tt>condition</tt>
expression becomes zero.
<p>
The <tt>condition</tt> is tested <b>after</b> the first
execution of <tt>statement</tt>, which means that the statement is
always executed at least one time.
<p>
If there is no
<tt><a href=#232>break</a></tt> or
<tt><a href=#237>return</a></tt>
inside the <tt>statement</tt>, the <tt>statement</tt> must affect
the value of the <tt>condition</tt>, or <tt>condition</tt> itself must
change during evaluation in order to avoid an endless loop.
<h2>Example</h2>
<pre>
string s = "Trust no one!";
int i = -1;
do {
   ++i;
   } while (s[i]);
</pre>


<a name=235>
<h1>for</h1>
The <i>for</i> statement has the general syntax
<pre>
for ([init]; [test]; [inc]) statement
</pre>
and performs the following steps:
<ol>
<li>If an initializing expression <tt>init</tt> is present, it is executed.
<li>If a <tt>test</tt> expression is present, it is executed. If the result
is nonzero (or if there is no <tt>test</tt> expression at all), the
<tt>statement</tt> is executed.
<li>If an <tt>inc</tt> expression is present, it is executed.
<li>Finally control returns to step 2.
</ol>
If there is no
<tt><a href=#232>break</a></tt> or
<tt><a href=#237>return</a></tt>
inside the <tt>statement</tt>, the <tt>inc</tt> expression (or the
<tt>statement</tt>) must affect
the value of the <tt>test</tt> expression, or <tt>test</tt> itself must
change during evaluation in order to avoid an endless loop.
<p>
The initializing expression <tt>init</tt> normally initializes one or more
loop counters. It may also define a new variable as a loop counter.
The scope of such a variable is valid until the end of the active block.
<h2>Example</h2>
<pre>
string s = "Trust no one!";
int sum = 0;
for (int i = 0; s[i]; ++i)
    sum += s[i]; // sums up the characters in s
</pre>


<a name=236>
<h1>if...else</h1>
The <i>if...else</i> statement has the general syntax
<pre>
if (expression)
   t_statement
[else
   f_statement]
</pre>
The conditional <tt>expression</tt> is evaluated, and if its value is nonzero
the <tt>t_statement</tt> is executed. Otherwise the <tt>f_statement</tt> is
executed in case there is an <tt>else</tt> clause.
<p>
An <tt>else</tt> clause is always matched to the last encountered <tt>if</tt>
without an <tt>else</tt>. If this is not what you want, you need to use
<a href=#159>braces</a> to group the statements, as in
<pre>
if (a == 1) {
   if (b == 1)
      printf("a == 1 and b == 1\n");
   }
else
   printf("a != 1\n");
</pre>


<a name=237>
<h1>return</h1>
A <a href=#213>function</a> with a return type
other than <tt>void</tt> must contain at least one <i>return</i>
statement with the syntax
<pre>
return expression;
</pre>
where <tt>expression</tt> must evaluate to a type that is compatible with
the function's return type. The value of <tt>expression</tt> is the value
returned by the function.
<p>
If the function is of type <tt>void</tt>, a <tt>return</tt> statement
without an <tt>expression</tt> can be used to return from the function
call.


<a name=238>
<h1>switch</h1>
The <i>switch</i> statement has the general syntax
<pre>
switch (sw_exp) {
  case case_exp: case_statement
  ...
  [default: def_statement]
  }
</pre>
and allows for the transfer of control to one of several
<tt>case</tt>-labeled statements, depending on the value of
<tt>sw_exp</tt> (which must be of integral type).
<p>
Any <tt>case_statement</tt> can be labeled by one or more <tt>case</tt>
labels. The <tt>case_exp</tt> of each <tt>case</tt> label must evaluate
to a constant integer which is unique within it's enclosing <tt>switch</tt>
statement.
<p>
There can also be at most one <tt>default</tt> label.
<p>
After evaluating <tt>sw_exp</tt>, the <tt>case_exp</tt> are checked for
a match. If a match is found, control passes to the <tt>case_statement</tt>
with the matching <tt>case</tt> label.
<p>
If no match is found and there is a <tt>default</tt> label, control
passes to <tt>def_statement</tt>. Otherwise none of the statements in the
<tt>switch</tt> is executed.
<p>
Program execution is not affected when <tt>case</tt> and <tt>default</tt>
labels are encountered. Control simply passes through the labels to the
following statement.
<p>
To stop execution at the end of a group of statements for a particular
<tt>case</tt>, use the <a href=#232>break</a> statement.
<h2>Example</h2>
<pre>
string s = "Hello World";
int vowels = 0, others = 0;
for (int i = 0; s[i]; ++i)
    switch (toupper(s[i])) {
      case 'A':
      case 'E':
      case 'I':
      case 'O':
      case 'U': ++vowels;
                break;
      default: ++others;
      }
printf("There are %d vowels in '%s'\n", vowels, s);
</pre>


<a name=239>
<h1>while</h1>
The <i>while</i> statement has the general syntax
<pre>
while (condition) statement
</pre>
and executes the <tt>statement</tt> as long as the <tt>condition</tt>
expression is not zero.
<p>
The <tt>condition</tt> is tested <b>before</b> the first possible
execution of <tt>statement</tt>, which means that the statement may never
be executed if <tt>condition</tt> is initially zero.
<p>
If there is no
<tt><a href=#232>break</a></tt> or
<tt><a href=#237>return</a></tt>
inside the <tt>statement</tt>, the <tt>statement</tt> must affect
the value of the <tt>condition</tt>, or <tt>condition</tt> itself must
change during evaluation in order to avoid an endless loop.
<h2>Example</h2>
<pre>
string s = "Trust no one!";
int i = 0;
while (s[i])
      ++i;
</pre>


<a name=240>
<h1>Builtins</h1>
Builtins are <i>Constants</i>, <i>Variables</i>, <i>Functions</i> and <i>Statements</i>
that provide additional information and allow for data manipulations.
<ul>
<li><a href=#241>Builtin Constants</a>
<li><a href=#242>Builtin Variables</a>
<li><a href=#243>Builtin Functions</a>
<li><a href=#305>Builtin Statements</a>
</ul>


<a name=241>
<h1>Builtin Constants</h1>
<i>Builtin constants</i> are used to provide information about
object parameters, such as maximum recommended name length, flags etc.
<p>
Many of the <a href=#171>object types</a> have their
own <b>Constants</b> section which lists the builtin constants for that
particular object (see e.g. <a href=#197>UL_PIN</a>).
<p>
The following builtin constants are defined in addition to the ones
listed for the various object types:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>EAGLE_VERSION</tt> </td><td width=20><td>EAGLE program version number (<a href=#166>int</a>)</td></tr>
<tr><td><tt>EAGLE_RELEASE</tt> </td><td width=20><td>EAGLE program release number (<a href=#166>int</a>)</td></tr>
<tr><td><tt>EAGLE_SIGNATURE</tt> </td><td width=20><td>a <a href=#168>string</a> containing EAGLE program name, version and copyright information</td></tr>
<tr><td><tt>REAL_EPSILON</tt> </td><td width=20><td>the minimum positive <a href=#167>real</a> number such that <tt>1.0 + REAL_EPSILON != 1.0</tt></td></tr>
<tr><td><tt>REAL_MAX</tt> </td><td width=20><td>the largest possible <a href=#167>real</a> value</td></tr>
<tr><td><tt>REAL_MIN</tt> </td><td width=20><td>the smallest possible (positive!) <a href=#167>real</a> value<br>the smallest representable number is <tt>-REAL_MAX</tt></td></tr>
<tr><td><tt>INT_MAX</tt> </td><td width=20><td>the largest possible <a href=#166>int</a> value</td></tr>
<tr><td><tt>INT_MIN</tt> </td><td width=20><td>the smallest possible <a href=#166>int</a> value</td></tr>
<tr><td><tt>PI</tt> </td><td width=20><td>the value of "pi" (3.14..., <a href=#167>real</a>)</td></tr>
<tr><td><tt>usage</tt> </td><td width=20><td>a <a href=#168>string</a> containing the text from the <tt><a href=#147>#usage</a></tt> directive</td></tr>
</table>
<p>
These builtin constants contain the directory paths defined in the
<a href=#14>directories dialog</a>, with any of the special
variables (<tt>$HOME</tt> and <tt>$EAGLEDIR</tt>) replaced by their actual values.
Since each path can consist of several directories, these constants are <a href=#168>string</a>
arrays with an individual directory in each member. The first empty member marks the end of the path:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>path_lbr[]</tt> </td><td width=20><td>Libraries</td></tr>
<tr><td><tt>path_dru[]</tt> </td><td width=20><td>Design Rules</td></tr>
<tr><td><tt>path_ulp[]</tt> </td><td width=20><td>User Language Programs</td></tr>
<tr><td><tt>path_scr[]</tt> </td><td width=20><td>Scripts</td></tr>
<tr><td><tt>path_cam[]</tt> </td><td width=20><td>CAM Jobs</td></tr>
<tr><td><tt>path_epf[]</tt> </td><td width=20><td>Projects</td></tr>
</table>
<p>
When using these constants to build a full file name, you need to use a directory separator,
as in
<pre>
string s = path_lbr[0] + '/' + "mylib.lbr";
</pre>
<p>
The libraries that are currently in use through the <a href=#102>USE</a> command:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>used_libraries[]</tt> </td><td width=20><td></td></tr>
</table>


<a name=242>
<h1>Builtin Variables</h1>
<i>Builtin variables</i> are used to provide information at runtime.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>int argc</tt> </td><td width=20><td>number of arguments given to the <a href=#90>RUN</a> command</td></tr>
<tr><td><tt>string argv[]</tt>      </td><td width=20><td>arguments given to the RUN command (<tt>argv[0]</tt> is the full ULP file name)</td></tr>
</table>


<a name=243>
<h1>Builtin Functions</h1>
<i>Builtin functions</i> are used to perform specific tasks, like
printing formatted strings, sorting data arrays or the like.
<p>
You may also write your own <a href=#213>functions</a>
and use them to structure your User Language Program.
<p>
The builtin functions are grouped into the following categories:
<ul>
<li><a href=#244>Character Functions</a>
<li><a href=#247>File Handling Functions</a>
<li><a href=#254>Mathematical Functions</a>
<li><a href=#259>Miscellaneous Functions</a>
<li><a href=#271>Network Functions</a>
<li><a href=#275>Printing Functions</a>
<li><a href=#278>String Functions</a>
<li><a href=#292>Time Functions</a>
<li><a href=#296>Object Functions</a>
<li><a href=#300>XML Functions</a>
</ul>
Alphabetical reference of all builtin functions:
<ul>
<li><a href=#255>abs()</a>
<li><a href=#257>acos()</a>
<li><a href=#257>asin()</a>
<li><a href=#257>atan()</a>
<li><a href=#256>ceil()</a>
<li><a href=#260>cfgget()</a>
<li><a href=#260>cfgset()</a>
<li><a href=#297>clrgroup()</a>
<li><a href=#261>country()</a>
<li><a href=#257>cos()</a>
<li><a href=#262>exit()</a>
<li><a href=#258>exp()</a>
<li><a href=#263>fdlsignature()</a>
<li><a href=#250>filedir()</a>
<li><a href=#248>fileerror()</a>
<li><a href=#250>fileext()</a>
<li><a href=#249>fileglob()</a>
<li><a href=#250>filename()</a>
<li><a href=#253>fileread()</a>
<li><a href=#250>filesetext()</a>
<li><a href=#251>filesize()</a>
<li><a href=#251>filetime()</a>
<li><a href=#256>floor()</a>
<li><a href=#256>frac()</a>
<li><a href=#298>ingroup()</a>
<li><a href=#245>isalnum()</a>
<li><a href=#245>isalpha()</a>
<li><a href=#245>iscntrl()</a>
<li><a href=#245>isdigit()</a>
<li><a href=#245>isgraph()</a>
<li><a href=#245>islower()</a>
<li><a href=#245>isprint()</a>
<li><a href=#245>ispunct()</a>
<li><a href=#245>isspace()</a>
<li><a href=#245>isupper()</a>
<li><a href=#245>isxdigit()</a>
<li><a href=#264>language()</a>
<li><a href=#258>log()</a>
<li><a href=#258>log10()</a>
<li><a href=#265>lookup()</a>
<li><a href=#255>max()</a>
<li><a href=#255>min()</a>
<li><a href=#272>neterror()</a>
<li><a href=#273>netget()</a>
<li><a href=#274>netpost()</a>
<li><a href=#266>palette()</a>
<li><a href=#258>pow()</a>
<li><a href=#276>printf()</a>
<li><a href=#256>round()</a>
<li><a href=#299>setgroup()</a>
<li><a href=#257>sin()</a>
<li><a href=#267>sort()</a>
<li><a href=#277>sprintf()</a>
<li><a href=#258>sqrt()</a>
<li><a href=#268>status()</a>
<li><a href=#279>strchr()</a>
<li><a href=#280>strjoin()</a>
<li><a href=#281>strlen()</a>
<li><a href=#282>strlwr()</a>
<li><a href=#283>strrchr()</a>
<li><a href=#284>strrstr()</a>
<li><a href=#285>strsplit()</a>
<li><a href=#286>strstr()</a>
<li><a href=#287>strsub()</a>
<li><a href=#288>strtod()</a>
<li><a href=#289>strtol()</a>
<li><a href=#290>strupr()</a>
<li><a href=#291>strxstr()</a>
<li><a href=#269>system()</a>
<li><a href=#295>t2day()</a>
<li><a href=#295>t2dayofweek()</a>
<li><a href=#295>t2hour()</a>
<li><a href=#295>t2minute()</a>
<li><a href=#295>t2month()</a>
<li><a href=#295>t2second()</a>
<li><a href=#295>t2string()</a>
<li><a href=#295>t2year()</a>
<li><a href=#257>tan()</a>
<li><a href=#293>time()</a>
<li><a href=#246>tolower()</a>
<li><a href=#246>toupper()</a>
<li><a href=#256>trunc()</a>
<li><a href=#270>u2inch()</a>
<li><a href=#270>u2mic()</a>
<li><a href=#270>u2mil()</a>
<li><a href=#270>u2mm()</a>
<li><a href=#301>xmlattribute()</a>
<li><a href=#301>xmlattributes()</a>
<li><a href=#302>xmlelement()</a>
<li><a href=#302>xmlelements()</a>
<li><a href=#303>xmltags()</a>
<li><a href=#304>xmltext()</a>
</ul>


<a name=244>
<h1>Character Functions</h1>
<i>Character functions</i> are used to manipulate single characters.
<p>
The following character functions are available:
<ul>
<li><a href=#245>isalnum()</a>
<li><a href=#245>isalpha()</a>
<li><a href=#245>iscntrl()</a>
<li><a href=#245>isdigit()</a>
<li><a href=#245>isgraph()</a>
<li><a href=#245>islower()</a>
<li><a href=#245>isprint()</a>
<li><a href=#245>ispunct()</a>
<li><a href=#245>isspace()</a>
<li><a href=#245>isupper()</a>
<li><a href=#245>isxdigit()</a>
<li><a href=#246>tolower()</a>
<li><a href=#246>toupper()</a>
</ul>


<a name=245>
<h1>is...()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Check whether a character falls into a given category.
<dt>
<b>Syntax</b>
<dd>
<tt>int isalnum(char c);</tt><br>
<tt>int isalpha(char c);</tt><br>
<tt>int iscntrl(char c);</tt><br>
<tt>int isdigit(char c);</tt><br>
<tt>int isgraph(char c);</tt><br>
<tt>int islower(char c);</tt><br>
<tt>int isprint(char c);</tt><br>
<tt>int ispunct(char c);</tt><br>
<tt>int isspace(char c);</tt><br>
<tt>int isupper(char c);</tt><br>
<tt>int isxdigit(char c);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>is...</tt> functions return nonzero if the given character falls
into the category, zero otherwise.
</dl>
<h2>Character categories</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>isalnum</tt> </td><td width=20><td>letters (<tt>A</tt> to <tt>Z</tt> or <tt>a</tt> to <tt>z</tt>) or digits (<tt>0</tt> to <tt>9</tt>)</td></tr>
<tr><td><tt>isalpha </tt> </td><td width=20><td>letters (<tt>A</tt> to <tt>Z</tt> or <tt>a</tt> to <tt>z</tt>)</td></tr>
<tr><td><tt>iscntrl </tt> </td><td width=20><td>delete characters or ordinary control characters (<tt>0x7F</tt> or <tt>0x00</tt> to <tt>0x1F</tt>)</td></tr>
<tr><td><tt>isdigit </tt> </td><td width=20><td>digits (<tt>0</tt> to <tt>9</tt>)</td></tr>
<tr><td><tt>isgraph </tt> </td><td width=20><td>printing characters (except space)</td></tr>
<tr><td><tt>islower </tt> </td><td width=20><td>lowercase letters (<tt>a</tt> to <tt>z</tt>)</td></tr>
<tr><td><tt>isprint </tt> </td><td width=20><td>printing characters (<tt>0x20</tt> to <tt>0x7E</tt>)</td></tr>
<tr><td><tt>ispunct </tt> </td><td width=20><td>punctuation characters (<tt>iscntrl</tt> or <tt>isspace</tt>)</td></tr>
<tr><td><tt>isspace </tt> </td><td width=20><td>space, tab, carriage return, new line, vertical tab, or formfeed (<tt>0x09</tt> to <tt>0x0D</tt>, <tt>0x20</tt>)</td></tr>
<tr><td><tt>isupper </tt> </td><td width=20><td>uppercase letters (<tt>A</tt> to <tt>Z</tt>)</td></tr>
<tr><td><tt>isxdigit</tt> </td><td width=20><td>hex digits (<tt>0</tt> to <tt>9</tt>, <tt>A</tt> to <tt>F</tt>, <tt>a</tt> to <tt>f</tt>)</td></tr>
</table>
<h2>Example</h2>
<pre>
char c = 'A';
if (isxdigit(c))
   printf("%c is hex\n", c);
else
   printf("%c is not hex\n", c);
</pre>


<a name=246>
<h1>to...()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Convert a character to upper- or lowercase.
<dt>
<b>Syntax</b>
<dd>
<tt>char tolower(char c);</tt><br>
<tt>char toupper(char c);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>tolower</tt> function returns the converted character if <tt>c</tt>
is uppercase. All other characters are returned unchanged.<br>
The <tt>toupper</tt> function returns the converted character if <tt>c</tt>
is lowercase. All other characters are returned unchanged.
</dl>
<b>See also</b> <a href=#290>strupr</a>,
<a href=#282>strlwr</a>


<a name=247>
<h1>File Handling Functions</h1>
<i>Filename handling functions</i> are used to work with file names,
sizes and timestamps.
<p>
The following file handling functions are available:
<ul>
<li><a href=#248>fileerror()</a>
<li><a href=#249>fileglob()</a>
<li><a href=#250>filedir()</a>
<li><a href=#250>fileext()</a>
<li><a href=#250>filename()</a>
<li><a href=#253>fileread()</a>
<li><a href=#250>filesetext()</a>
<li><a href=#251>filesize()</a>
<li><a href=#251>filetime()</a>
</ul>
See <a href=#309>output()</a> for information about how to write into a file.


<a name=248>
<h1>fileerror()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Returns the status of I/O operations.
<dt>
<b>Syntax</b>
<dd>
<tt>int fileerror();</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>fileerror</tt> function returns <tt>0</tt> if everything is ok.
</dl>
<b>See also</b> <a href=#309>output</a>,
<a href=#276>printf</a>,
<a href=#253>fileread</a>
<p>
<tt>fileerror</tt> checks the status of any I/O operations that have been performed
since the last call to this function and returns <tt>0</tt> if everything was ok.
If any of the I/O operations has caused an error, a value other than <tt>0</tt>
will be returned.
<p>
You should call <tt>fileerror</tt> before any I/O operations to reset any previous
error state, and call it again after the I/O operations to see if they were successful.
<p>
When <tt>fileerror</tt> returns a value other than <tt>0</tt> (thus indicating an error)
a proper error message has already been given to the user.
<h2>Example</h2>
<pre>
fileerror();
output("file.txt", "wt") {
  printf("Test\n");
  }
if (fileerror())
   exit(1);
</pre>


<a name=249>
<h1>fileglob()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Perform a directory search.
<dt>
<b>Syntax</b>
<dd>
<tt>int fileglob(string &amp;array[], string pattern);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>fileglob</tt> function returns the number of entries copied into <tt>array</tt>.
</dl>
<b>See also</b> <a href=#317>dlgFileOpen()</a>,
<a href=#317>dlgFileSave()</a>
<p>
<tt>fileglob</tt> performs a directory search using <tt>pattern</tt>.
<p>
<tt>pattern</tt> may contain <tt>'*'</tt> and <tt>'?'</tt> as wildcard characters.
If <tt>pattern</tt> ends with a <tt>'/'</tt>, the contents of the given directory will be returned.
<p>
Names in the resulting <tt>array</tt> that end with a <tt>'/'</tt> are directory names.
<p>
The <tt>array</tt> is sorted alphabetically, with the directories coming first.
<p>
The special entries <tt>'.'</tt> and <tt>'..'</tt> (for the current and parent directories)
are never returned in the <tt>array</tt>.
<p>
If <tt>pattern</tt> doesn't match, or if you don't have permission to search the given
directory, the resulting <tt>array</tt> will be empty.
<h2>Note for Windows users</h2>
<table><tr><td valign="top"><img src="platforms-win.png"></td><td valign="middle">
The directory delimiter in the <tt>array</tt> is always a <b>forward slash</b>.
This makes sure User Language Programs will work platform independently.
In the <tt>pattern</tt> the <b>backslash</b> (<tt>'\'</tt>) is also treated
as a directory delimiter.
<p>
Sorting filenames under Windows is done case insensitively.
</td></tr></table>
<h2>Example</h2>
<pre>
string a[];
int n = fileglob(a, "*.brd");
</pre>


<a name=250>
<h1>Filename Functions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Split a filename into its separate parts.
<dt>
<b>Syntax</b>
<dd>
<tt>string filedir(string file);</tt><br>
<tt>string fileext(string file);</tt><br>
<tt>string filename(string file);</tt><br>
<tt>string filesetext(string file, string newext);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>filedir   </tt> returns the directory of <tt>file</tt> (including the drive letter under Windows).<br>
<tt>fileext   </tt> returns the extension of <tt>file</tt>.<br>
<tt>filename  </tt> returns the file name of <tt>file</tt> (including the extension).<br>
<tt>filesetext</tt> returns <tt>file</tt> with the extension set to <tt>newext</tt>.
</dl>
<b>See also</b> <a href=#251>Filedata Functions</a>
<h2>Example</h2>
<pre>
if (board) board(B) {
  output(filesetext(B.name, ".out")) {
    ...
    }
  }
</pre>


<a name=251>
<h1>Filedata Functions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Gets the timestamp and size of a file.
<dt>
<b>Syntax</b>
<dd>
<tt>int filesize(string filename);</tt><br>
<tt>int filetime(string filename);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>filesize</tt> returns the size (in byte) of the given file.<br>
<tt>filetime</tt> returns the timestamp of the given file in a format to be used with the <a href=#292>time functions</a>.
</dl>
<b>See also</b> <a href=#293>time</a>,
<a href=#250>Filename Functions</a>
<h2>Example</h2>
<pre>
board(B)
  printf("Board: %s\nSize: %d\nTime: %s\n",
         B.name, filesize(B.name),
         t2string(filetime(B.name)));
</pre>


<a name=252>
<h1>File Input Functions</h1>
<i>File input functions</i> are used to read data from files.
<p>
The following file input is available:
<ul>
<li><a href=#253>fileread()</a>
</ul>
See <a href=#309>output()</a> for information about how to write into a file.


<a name=253>
<h1>fileread()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Reads data from a file.
<dt>
<b>Syntax</b>
<dd>
<tt>int fileread(<i>dest</i>, string file);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>fileread</tt> returns the number of objects read from the file.<br>
The actual meaning of the return value depends on the type of <tt>dest</tt>.
</dl>
<b>See also</b> <a href=#265>lookup</a>,
<a href=#285>strsplit</a>,
<a href=#248>fileerror</a>
<p>
If <tt>dest</tt> is a character array, the file will be read as raw binary data
and the return value reflects the number of bytes read into the character array
(which is equal to the file size).
<p>
If <tt>dest</tt> is a string array, the file will be read as a text file (one line
per array member) and the return value will be the number of lines read into the
string array. Newline characters will be stripped.
<p>
If <tt>dest</tt> is a string, the entire file will be read into that string
and the return value will be the length of that string (which is not necessarily
equal to the file size, if the operating system stores text files with "cr/lf"
instead of a "newline" character).
<h2>Example</h2>
<pre>
char b[];
int nBytes = fileread(b, "data.bin");
string lines[];
int nLines = fileread(lines, "data.txt");
string text;
int nChars = fileread(text, "data.txt");
</pre>


<a name=254>
<h1>Mathematical Functions</h1>
<i>Mathematical functions</i> are used to perform mathematical
operations.
<p>
The following mathematical functions are available:
<ul>
<li><a href=#255>abs()</a>
<li><a href=#257>acos()</a>
<li><a href=#257>asin()</a>
<li><a href=#257>atan()</a>
<li><a href=#256>ceil()</a>
<li><a href=#257>cos()</a>
<li><a href=#258>exp()</a>
<li><a href=#256>floor()</a>
<li><a href=#256>frac()</a>
<li><a href=#258>log()</a>
<li><a href=#258>log10()</a>
<li><a href=#255>max()</a>
<li><a href=#255>min()</a>
<li><a href=#258>pow()</a>
<li><a href=#256>round()</a>
<li><a href=#257>sin()</a>
<li><a href=#258>sqrt()</a>
<li><a href=#256>trunc()</a>
<li><a href=#257>tan()</a>
</ul>
<h2>Error Messages</h2>
If the arguments of a mathematical function call lead to an error, the
error message will show the actual values of the arguments. Thus the
statements
<pre>
real x = -1.0;
real r = sqrt(2 * x);
</pre>
will lead to the error message
<pre>
Invalid argument in call to 'sqrt(-2)'
</pre>


<a name=255>
<h1>Absolute, Maximum and Minimum Functions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Absolute, maximum and minimum functions.
<dt>
<b>Syntax</b>
<dd>
<tt>type abs(type x);</tt><br>
<tt>type max(type x, type y);</tt><br>
<tt>type min(type x, type y);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>abs</tt> returns the absolute value of <tt>x</tt>.<br>
<tt>max</tt> returns the maximum of <tt>x</tt> and <tt>y</tt>.<br>
<tt>min</tt> returns the minimum of <tt>x</tt> and <tt>y</tt>.
<p>
The return type of these functions is the same as the (larger) type
of the arguments. <tt>type</tt> must be one of
<tt><a href=#165>char</a></tt>,
<tt><a href=#166>int</a></tt> or
<tt><a href=#167>real</a></tt>.
</dl>
<h2>Example</h2>
<pre>
real x = 2.567, y = 3.14;
printf("The maximum is %f\n", max(x, y));
</pre>


<a name=256>
<h1>Rounding Functions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Rounding functions.
<dt>
<b>Syntax</b>
<dd>
<tt>real ceil(real x);</tt><br>
<tt>real floor(real x);</tt><br>
<tt>real frac(real x);</tt><br>
<tt>real round(real x);</tt><br>
<tt>real trunc(real x);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>ceil </tt> returns the smallest integer not less than <tt>x</tt>.<br>
<tt>floor</tt> returns the largest integer not greater than <tt>x</tt>.<br>
<tt>frac </tt> returns the fractional part of <tt>x</tt>.<br>
<tt>round</tt> returns <tt>x</tt> rounded to the nearest integer.<br>
<tt>trunc</tt> returns the integer part of <tt>x</tt>.
</dl>
<h2>Example</h2>
<pre>
real x = 2.567;
printf("The rounded value of %f is %f\n", x, round(x));
</pre>


<a name=257>
<h1>Trigonometric Functions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Trigonometric functions.
<dt>
<b>Syntax</b>
<dd>
<tt>real acos(real x);</tt><br>
<tt>real asin(real x);</tt><br>
<tt>real atan(real x);</tt><br>
<tt>real cos(real x);</tt><br>
<tt>real sin(real x);</tt><br>
<tt>real tan(real x);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>acos</tt> returns the arc cosine of <tt>x</tt>.<br>
<tt>asin</tt> returns the arc sine of <tt>x</tt>.<br>
<tt>atan</tt> returns the arc tangent of <tt>x</tt>.<br>
<tt>cos </tt> returns the cosine of <tt>x</tt>.<br>
<tt>sin </tt> returns the sine of <tt>x</tt>.<br>
<tt>tan </tt> returns the tangent of <tt>x</tt>.
</dl>
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PI</tt> </td><td width=20><td>the value of "pi" (3.14...)</td></tr>
</table>
<h2>Note</h2>
Angles are given in radian.
<h2>Example</h2>
<pre>
real x = PI / 2;
printf("The sine of %f is %f\n", x, sin(x));
</pre>


<a name=258>
<h1>Exponential Functions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Exponential Functions.
<dt>
<b>Syntax</b>
<dd>
<tt>real exp(real x);</tt><br>
<tt>real log(real x);</tt><br>
<tt>real log10(real x);</tt><br>
<tt>real pow(real x, real y);</tt><br>
<tt>real sqrt(real x);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>exp  </tt> returns the exponential <i>e</i> to the power of <tt>x</tt>.<br>
<tt>log  </tt> returns the natural logarithm of <tt>x</tt>.<br>
<tt>log10</tt> returns the base 10 logarithm of <tt>x</tt>.<br>
<tt>pow  </tt> returns the value of <tt>x</tt> to the power of <tt>y</tt>.<br>
<tt>sqrt </tt> returns the square root of <tt>x</tt>.
</dl>
<h2>Note</h2>
The "n-th" root can be calculated using the <tt>pow</tt> function with a
negative exponent.
<h2>Example</h2>
<pre>
real x = 2.1;
printf("The square root of %f is %f\n", x, sqrt(x));
</pre>


<a name=259>
<h1>Miscellaneous Functions</h1>
<i>Miscellaneous functions</i> are used to perform various tasks.
<p>
The following miscellaneous functions are available:
<ul>
<li><a href=#261>country()</a>
<li><a href=#262>exit()</a>
<li><a href=#263>fdlsignature()</a>
<li><a href=#264>language()</a>
<li><a href=#265>lookup()</a>
<li><a href=#266>palette()</a>
<li><a href=#267>sort()</a>
<li><a href=#268>status()</a>
<li><a href=#269>system()</a>
<li><a href=#260>Configuration Parameters</a>
<li><a href=#270>Unit Conversions</a>
</ul>


<a name=260>
<h1>Configuration Parameters</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Store and retrieve configuration parameters.
<dt>
<b>Syntax</b>
<dd>
<tt>string cfgget(string name[, string default]);</tt><br>
<tt>void cfgset(string name, string value);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>cfgget</tt> returns the value of the parameter stored under the given <tt>name</tt>.
If no such parameter has been stored, yet, the value of the optional <tt>default</tt>
is returned (or an empty string, if no <tt>default</tt> is given).
</dl>
The <tt>cfgget</tt> function retrieves values that have previously been stored with
a call to <tt>cfgset()</tt>.
<p>
The <tt>cfgset</tt> function sets the parameter with the given <tt>name</tt> to
the given <tt>value</tt>.
<p>
The valid characters for <tt>name</tt> are
<tt>'A'</tt>-<tt>'Z'</tt>,
<tt>'a'</tt>-<tt>'z'</tt>,
<tt>'0'</tt>-<tt>'9'</tt>,
<tt>'.'</tt> and
<tt>'_'</tt>.<br>
Parameter names are case sensitive.
<p>
The parameters are stored in the user's eaglerc file.
To ensure that different User Language Programs don't overwrite each other's
parameters in case they use the same parameter names, it is recommended to put
the name of the ULP at the beginning of the parameter name. For example, a ULP
named <tt>mytool.ulp</tt> that uses a parameter named <tt>MyParam</tt> could store
that parameter under the name
<pre>
mytool.MyParam
</pre>
Because the configuration parameters are stored in the eaglerc file, which also
contains all of EAGLE's other user specific parameters, it is also possible to
access the EAGLE parameters with <tt>cfgget()</tt> and <tt>cfgset()</tt>.
In order to make sure no ULP parameters collide with any EAGLE parameters, the
EAGLE parameters must be prefixed with <tt>"EAGLE:"</tt>, as in
<pre>
EAGLE:Option.XrefLabelFormat
</pre>
Note that there is no documentation of all of EAGLE's internal parameters and how
they are stored in the eaglerc file. Also, be very careful when changing any of these
parameters! As with the eaglerc file itself, you should only manipulate these
parameters if you know what you are doing! Some EAGLE parameters may require a
restart of EAGLE for changes to take effect.
<p>
In the eaglerc file the User Language parameters are stored with the prefix
<tt>"ULP:"</tt>. Therefore this prefix may be optionally put in front of User Language
parameter names, as in
<pre>
ULP:mytool.MyParam
</pre>
<h2>Example</h2>
<pre>
string MyParam = cfgget("mytool.MyParam", "SomeDefault");
MyParam = "OtherValue";
cfgset("mytool.MyParam", MyParam);
</pre>


<a name=261>
<h1>country()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Returns the country code of the system in use.
<dt>
<b>Syntax</b>
<dd>
<tt>string country();</tt>
<dt>
<b>Returns</b>
<dd>
<tt>country</tt> returns a string consisting of two uppercase characters
that identifies the country used on the current system.
If no such country setting can be determined, the default "US" will
be returned.
</dl>
<b>See also</b> <a href=#264>language</a>
<h2>Example</h2>
<pre>
dlgMessageBox("Your country code is: " + country());
</pre>


<a name=262>
<h1>exit()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Exits from a User Language Program.
<dt>
<b>Syntax</b>
<dd>
<tt>void exit(int result);</tt><br>
<tt>void exit(string command);</tt>
</dl>
<b>See also</b> <a href=#90>RUN</a>
<p>
The <tt>exit</tt> function terminates execution of a User Language Program.<br>
If an integer <tt>result</tt> is given it will be used as the
<a href=#140>return value</a> of the program.<br>
If a string <tt>command</tt> is given, that command will be executed as if it
were entered into the command line immediately after the RUN command. In that
case the return value of the ULP is set to <tt>EXIT_SUCCESS</tt>.
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>EXIT_SUCCESS</tt>   </td><td width=20><td>return value for successful program execution (value <tt>0</tt>)</td></tr>
<tr><td><tt>EXIT_FAILURE</tt>   </td><td width=20><td>return value for failed program execution (value <tt>-1</tt>)</td></tr>
</table>
<p>


<a name=263>
<h1>fdlsignature()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Calculates a digital signature for Premier Farnell's <i>Design Link</i>.
<dt>
<b>Syntax</b>
<dd>
<tt>string fdlsignature(string s, string key);</tt>
</dl>
The <tt>fdlsignature</tt> function is used to calculate a digital signature
when accessing Premier Farnell's <i>Design Link</i> interface.


<a name=264>
<h1>language()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Returns the language code of the system in use.
<dt>
<b>Syntax</b>
<dd>
<tt>string language();</tt>
<dt>
<b>Returns</b>
<dd>
<tt>language</tt> returns a string consisting of two lowercase characters
that identifies the language used on the current system.
If no such language setting can be determined, the default "en" will
be returned.
</dl>
<b>See also</b> <a href=#261>country</a>
<p>
The <tt>language</tt> function can be used to make a ULP use different
message string, depending on which language the current system is using.
<p>
In the example below all the strings used in the ULP are listed in the
string array <tt>I18N[]</tt>, preceeded by a string containing the
various language codes supported by this ULP. Note the <tt>vtab</tt>
characters used to separate the individual parts of each string (they
are important for the <tt>lookup</tt> function) and the use of the commas
to separate the strings. The actual work is done in the function <tt>tr()</tt>,
which returns the translated version of the given string.
If the original string can't be found in the <tt>I18N</tt> array, or there
is no translation for the current language, the original string will be used
untranslated.
<p>
The first language defined in the <tt>I18N</tt> array must be the one in which
the strings used throughout the ULP are written, and should generally be
English in order to make the program accessible to the largest number of users.
<h2>Example</h2>
<pre>
string I18N[] = {
  "en\v"
  "de\v"
  "it\v"
  ,
  "I18N Demo\v"
  "Beispiel f&uuml;r Internationalisierung\v"
  "Esempio per internazionalizzazione\v"
  ,
  "Hello world!\v"
  "Hallo Welt!\v"
  "Ciao mondo!\v"
  ,
  "+Ok\v"
  "+Ok\v"
  "+Approvazione\v"
  ,
  "-Cancel\v"
  "-Abbrechen\v"
  "-Annullamento\v"
  };
int Language = strstr(I18N[0], language()) / 3;
string tr(string s)
{
  string t = lookup(I18N, s, Language, '\v');
  return t ? t : s;
}
dlgDialog(tr("I18N Demo")) {
  dlgHBoxLayout dlgSpacing(350);
  dlgLabel(tr("Hello world!"));
  dlgHBoxLayout {
    dlgPushButton(tr("+Ok")) dlgAccept();
    dlgPushButton(tr("-Cancel")) dlgReject();
    }
  };
</pre>


<a name=265>
<h1>lookup()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Looks up data in a string array.
<dt>
<b>Syntax</b>
<dd>
<tt>string lookup(string array[], string key, int field_index[, char separator]);</tt><br>
<tt>string lookup(string array[], string key, string field_name[, char separator]);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>lookup</tt> returns the value of the field identified by <tt>field_index</tt>
or <tt>field_name</tt>.<br>
If the field doesn't exist, or no string matching <tt>key</tt> is found,
an empty string is returned.
</dl>
<b>See also</b> <a href=#253>fileread</a>,
<a href=#285>strsplit</a>
<p>
An <tt>array</tt> that can be used with <tt>lookup()</tt> consists of strings of text,
each string representing one data record.
<p>
Each data record contains an arbitrary number of fields, which are separated by
the character <tt>separator</tt> (default is <tt>'\t'</tt>, the tabulator).
The first field in a record is used as the <tt>key</tt> and is numbered <tt>0</tt>.
<p>
All records must have unique <tt>key</tt> fields and none of the <tt>key</tt> fields
may be empty - otherwise it is undefined which record will be found.
<p>
If the first string in the <tt>array</tt> contains a "Header" record (i.e. a record where
each field describes its contents), using <tt>lookup</tt> with a <tt>field_name</tt>
string automatically determines the index of that field. This allows using the
<tt>lookup</tt> function without exactly knowing which field index contains
the desired data.<br>
It is up to the user to make sure that the first record actually
contains header information.
<p>
If the <tt>key</tt> parameter in the call to <tt>lookup()</tt> is an empty
string, the first string of the <tt>array</tt> will be used. This allows a program to
determine whether there is a header record with the required field names.
<p>
If a field contains the <tt>separator</tt> character, that field must be enclosed
in double quotes (as in <tt>"abc;def"</tt>, assuming the semicolon (<tt>';'</tt>)
is used as separator). The same applies if the field contains double quotes
(<tt>"</tt>), in which case the double quotes inside the field have to be doubled
(as in <tt>"abc;""def"";ghi"</tt>, which would be <tt>abc;"def";ghi</tt>).<br>
<b>It is best to use the default "tab" separator, which doesn't have these problems
(no field can contain a tabulator).</b>
<p>
Here's an example data file (<tt>';'</tt> has been used as separator for better readability):
<pre>
Name;Manufacturer;Code;Price
7400;Intel;I-01-234-97;$0.10
68HC12;Motorola;M68HC1201234;$3.50
</pre>
<h2>Example</h2>
<pre>
string OrderCodes[];
if (fileread(OrderCodes, "ordercodes") &gt; 0) {
   if (lookup(OrderCodes, "", "Code", ';')) {
      schematic(SCH) {
        SCH.parts(P) {
          string OrderCode;
          // both following statements do exactly the same:
          OrderCode = lookup(OrderCodes, P.device.name, "Code", ';');
          OrderCode = lookup(OrderCodes, P.device.name, 2, ';');
          }
        }
      }
   else
      dlgMessageBox("Missing 'Code' field in file 'ordercodes');
   }
</pre>


<a name=266>
<h1>palette()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Returns color palette information.
<dt>
<b>Syntax</b>
<dd>
<tt>int palette(int index[, int type]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>palette</tt> function returns an integer ARGB value in the form 0xaarrggbb,
or the type of the currently used palette (depending on the value of <tt>index</tt>).
</dl>
The <tt>palette</tt> function returns the ARGB value of the color with the given
<tt>index</tt> (which may be in the range 0..PALETTE_ENTRIES-1). If <tt>type</tt> is not
given (or is <tt>-1</tt>) the palette assigned to the current editor window will
be used. Otherwise <tt>type</tt> specifies which color palette to use (PALETTE_BLACK,
PALETTE_WHITE or PALETTE_COLORED).
<p>
The special value <tt>-1</tt> for <tt>index</tt> makes the function return the type
of the palette that is currently in use by the editor window.
<p>
If either <tt>index</tt> or <tt>type</tt> is out of range, an error message will be
given and the ULP will be terminated.
<h2>Constants</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>PALETTE_TYPES</tt>   </td><td width=20><td>the number of palette types (3)</td></tr>
<tr><td><tt>PALETTE_BLACK</tt>  </td><td width=20><td>the black background palette (0)</td></tr>
<tr><td><tt>PALETTE_WHITE</tt>  </td><td width=20><td>the white background palette (1)</td></tr>
<tr><td><tt>PALETTE_COLORED</tt>  </td><td width=20><td>the colored background palette (2)</td></tr>
<tr><td><tt>PALETTE_ENTRIES</tt>  </td><td width=20><td>the number of colors per palette (64)</td></tr>
</table>


<a name=267>
<h1>sort()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Sorts an array or a set of arrays.
<dt>
<b>Syntax</b>
<dd>
<tt>void sort(int number, array1[, array2,...]);</tt>
</dl>
The <tt>sort</tt> function either directly sorts a given <tt>array1</tt>,
or it sorts a set of arrays (starting with <tt>array2</tt>), in which case
<tt>array1</tt> is supposed to be an array of <b>int</b>, which will
be used as a pointer array.
<p>
In any case, the <tt>number</tt> argument defines the number of items in the
array(s).
<h2>Sorting a single array</h2>
If the <tt>sort</tt> function is called with one single array, that array
will be sorted directly, as in the following example:
<pre>
string A[];
int n = 0;
A[n++] = "World";
A[n++] = "Hello";
A[n++] = "The truth is out there...";
sort(n, A);
for (int i = 0; i &lt; n; ++i)
    printf(A[i]);
</pre>
<h2>Sorting a set of arrays</h2>
If the <tt>sort</tt> function is called with more than one array, the first
array must be an array of <b>int</b>, while all of the other arrays may be
of any array type and hold the data to be sorted. The following example
illustrates how the first array will be used as a pointer:
<pre>
numeric string Nets[], Parts[], Instances[], Pins[];
int n = 0;
int index[];
schematic(S) {
  S.nets(N) N.pinrefs(P) {
    Nets[n] = N.name;
    Parts[n] = P.part.name;
    Instances[n] = P.instance.name;
    Pins[n] = P.pin.name;
    ++n;
    }
  sort(n, index, Nets, Parts, Instances, Pins);
  for (int i = 0; i &lt; n; ++i)
      printf("%-8s %-8s %-8s %-8s\n",
             Nets[index[i]], Parts[index[i]],
             Instances[index[i]], Pins[index[i]]);
  }
</pre>
The idea behind this is that one net can have several pins connected to it,
and in a netlist you might want to have the net names sorted, and within
one net you also want the part names sorted and so on.
<p>
Note the use of the keyword <tt>numeric</tt> in the string arrays. This causes
the strings to be sorted in a way that takes into account a numeric part
at the end of the strings, which leads to IC1, IC2,... IC9, IC10 instead of
the alphabetical order IC1, IC10, IC2,...IC9.
<p>
When sorting a set of arrays, the first (index) array must be of type
<tt><a href=#166>int</a></tt> and need not be initialized. Any
contents the index array might have before calling the <tt>sort</tt>
function will be overwritten by the resulting index values.


<a name=268>
<h1>status()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Displays a status message in the status bar.
<dt>
<b>Syntax</b>
<dd>
<tt>void status(string message);</tt><br>
</dl>
<b>See also</b> <a href=#318>dlgMessageBox()</a>
<p>
The <tt>status</tt> function displays the given <tt>message</tt> in the status bar of the
editor window in which the ULP is running.
</dl>


<a name=269>
<h1>system()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Executes an external program.
<dt>
<b>Syntax</b>
<dd>
<tt>int system(string command);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>system</tt> function returns the exit status of the command. This is
typically <tt>0</tt> if everything was ok, and non-zero in case of an error.
</dl>
The <tt>system</tt> function executes the external program given by the <tt>command</tt>
string, and waits until the program ends.
<p>
As a security precaution, you will be prompted with the <tt>command</tt>
string before the command is executed, in order to make sure there is no "evil"
ULP that executes unwanted external commands.
If this dialog is canceled, the <tt>system()</tt> call will return <tt>-1</tt>.
If the dialog is confirmed, any future <tt>system()</tt> calls in the current
EAGLE session with exactly the same command string will be executed without
any further confirmation dialog.
<h2>Input/Output redirection</h2>
If the external program shall read its standard input from (or write its standard
output to) a particular file, input/output needs to be redirected.
<p>
<table><tr><td valign="top"><img src="platforms-lin.png"><br><img src="platforms-mac.png"></td><td valign="middle">
On <b>Linux</b> and <b>Mac OS X</b> this is done by simply adding a <tt>'&lt;'</tt> or
<tt>'&gt;'</tt> to the command line, followed by the desired file name, as in
<pre>
system("program &lt; infile &gt; outfile");
</pre>
which runs <tt>program</tt> and makes it read from <tt>infile</tt> and write
to <tt>outfile</tt>.
</td></tr></table>
<p>
<table><tr><td valign="top"><img src="platforms-win.png"></td><td valign="middle">
On <b>Windows</b> you have to explicitly run a command processor to do this, as in
<pre>
system("cmd.exe /c program &lt; infile &gt; outfile");
</pre>
(on DOS based Windows systems use <tt>command.com</tt> instead of <tt>cmd.exe</tt>).
</td></tr></table>
<h2>Background execution</h2>
The <tt>system</tt> function waits until the given program has ended.
This is useful for programs that only run for a few seconds, or completely
take over the user's attention.
<p>
<table><tr><td valign="top"><img src="platforms-lin.png"><br><img src="platforms-mac.png"></td><td valign="middle">
If an external program runs for a longer time, and you want the system
call to return immediately, without waiting for the program to end, you
can simply add an <tt>'&amp;'</tt> to the command string under <b>Linux</b> and
<b>Mac OS X</b>, as in
<pre>
system("program &amp;");
</pre>
</td></tr></table>
<p>
<table><tr><td valign="top"><img src="platforms-win.png"></td><td valign="middle">
Under Windows you need to explicitly run a command processor to do this, as in
<pre>
system("cmd.exe /c start program");
</pre>
(on DOS based Windows systems use <tt>command.com</tt> instead of <tt>cmd.exe</tt>).
</td></tr></table>
<h2>Example</h2>
<pre>
int result = system("simulate -f filename");
</pre>
This would call a simulation program, giving it a file which the ULP has
just created.
Note that <tt>simulate</tt> here is just an example, it is not part of the EAGLE package!


<a name=270>
<h1>Unit Conversions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Converts internal units.
<dt>
<b>Syntax</b>
<dd>
<tt>real u2inch(int n);</tt><br>
<tt>real u2mic(int n);</tt><br>
<tt>real u2mil(int n);</tt><br>
<tt>real u2mm(int n);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>u2inch</tt> returns the value of <tt>n</tt> in <i>inch</i>.<br>
<tt>u2mic </tt> returns the value of <tt>n</tt> in <i>microns</i> (1/1000mm).<br>
<tt>u2mil </tt> returns the value of <tt>n</tt> in <i>mil</i> (1/1000inch).<br>
<tt>u2mm  </tt> returns the value of <tt>n</tt> in <i>millimeters</i>.
</dl>
<b>See also</b> <a href=#186>UL_GRID</a>
<p>
EAGLE stores all coordinate and size values as <tt><a href=#166>int</a></tt>
values with a resolution of 1/10000mm (0.1&micro;). The above unit conversion
functions can be used to convert these internal units to the desired
measurement units.
<h2>Example</h2>
<pre>
board(B) {
  B.elements(E) {
    printf("%s at (%f, %f)\n", E.name,
           u2mm(E.x), u2mm(E.y));
    }
  }
</pre>


<a name=271>
<h1>Network Functions</h1>
<i>Network functions</i> are used to access remote sites on the Internet.
<p>
The following network functions are available:
<ul>
<li><a href=#272>neterror()</a>
<li><a href=#273>netget()</a>
<li><a href=#274>netpost()</a>
</ul>


<a name=272>
<h1>neterror()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Returns the error message of the most recent network function call.
<dt>
<b>Syntax</b>
<dd>
<tt>string neterror(void);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>neterror</tt> returns a textual message describing the error that occurred
in the most recent call to a network function.<br>
If no error has occurred, the return value is an empty string.
</dl>
<b>See also</b> <a href=#273>netget</a>,
<a href=#274>netpost</a>
<p>
The <tt>neterror</tt> function should be called after any of the other
network functions has returned a negative value, indicating that an
error has occurred. The return value of <tt>neterror</tt> is a textual
string that can be presented to the user.
<h2>Example</h2>
<pre>
string Result;
if (netget(Result, "http://www.cadsoft.de/cgi-bin/http-test?see=me&amp;hear=them") &gt;= 0) {
   // process Result
   }
else
   dlgMessageBox(neterror());
</pre>


<a name=273>
<h1>netget()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Performs a GET request on the network.
<dt>
<b>Syntax</b>
<dd>
<tt>int netget(<i>dest</i>, string url[, int timeout]);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>netget</tt> returns the number of objects read from the network.<br>
The actual meaning of the return value depends on the type of <tt>dest</tt>.<br>
In case of an error, a negative value is returned and
<a href=#272>neterror()</a>
may be called to display an error message to the user.
</dl>
<b>See also</b> <a href=#274>netpost</a>,
<a href=#272>neterror</a>,
<a href=#253>fileread</a>
<p>
The <tt>netget</tt> function sends the given <tt>url</tt> to the network and
stores the result in the <tt>dest</tt> variable.<br>
If no network activity has occurred for <tt>timeout</tt> seconds,
the connection will be terminated.  The default timeout is 20 seconds.<br>
The <tt>url</tt> must contain the protocol to use (HTTP, HTTPS or FTP) and can
contain name=value pairs of parameters, as in
<pre>
http://www.cadsoft.de/cgi-bin/http-test?see=me&amp;hear=them
ftp://ftp.cadsoft.de/eagle/userfiles/README
</pre>
If a user id and password is required to access a remote site, these can be
given as
<pre>
https://userid:password@www.secret-site.com/...
</pre>
If <tt>dest</tt> is a character array, the result will be treated as raw binary data
and the return value reflects the number of bytes stored in the character array.
<p>
If <tt>dest</tt> is a string array, the result will be treated as text data (one line
per array member) and the return value will be the number of lines stored in the
string array. Newline characters will be stripped.
<p>
If <tt>dest</tt> is a string, the result will be stored in that string
and the return value will be the length of the string. Note that in case
of binary data the result is truncated at the first occurrence of a byte with
the value 0x00.
<h2>Example</h2>
<pre>
string Result;
if (netget(Result, "http://www.cadsoft.de/cgi-bin/http-test?see=me&amp;hear=them") &gt;= 0) {
   // process Result
   }
else
   dlgMessageBox(neterror());
</pre>


<a name=274>
<h1>netpost()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Performs a POST request on the network.
<dt>
<b>Syntax</b>
<dd>
<tt>int netpost(<i>dest</i>, string url, string data[, int timeout]);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>netpost</tt> returns the number of objects read from the network.<br>
The actual meaning of the return value depends on the type of <tt>dest</tt>.<br>
In case of an error, a negative value is returned and
<a href=#272>neterror()</a>
may be called to display an error message to the user.
</dl>
<b>See also</b> <a href=#273>netget</a>,
<a href=#272>neterror</a>,
<a href=#253>fileread</a>
<p>
The <tt>netpost</tt> function sends the given <tt>data</tt> to the given <tt>url</tt>
on the network and stores the result in the <tt>dest</tt> variable.<br>
If no network activity has occurred for <tt>timeout</tt> seconds,
the connection will be terminated.  The default timeout is 20 seconds.<br>
The <tt>url</tt> must contain the protocol to use (HTTP or HTTPS).
<p>
If a user id and password is required to access a remote site, these can be
given as
<pre>
https://userid:password@www.secret-site.com/...
</pre>
If <tt>dest</tt> is a character array, the result will be treated as raw binary data
and the return value reflects the number of bytes stored in the character array.
<p>
If <tt>dest</tt> is a string array, the result will be treated as text data (one line
per array member) and the return value will be the number of lines stored in the
string array. Newline characters will be stripped.
<p>
If <tt>dest</tt> is a string, the result will be stored in that string
and the return value will be the length of the string. Note that in case
of binary data the result is truncated at the first occurrence of a byte with
the value 0x00.
<h2>Example</h2>
<pre>
string Data = "see=me\nhear=them";
string Result;
if (netpost(Result, "http://www.cadsoft.de/cgi-bin/http-test", Data) &gt;= 0) {
   // process Result
   }
else
   dlgMessageBox(neterror());
</pre>


<a name=275>
<h1>Printing Functions</h1>
<i>Printing functions</i> are used to print formatted strings.
<p>
The following printing functions are available:
<ul>
<li><a href=#276>printf()</a>
<li><a href=#277>sprintf()</a>
</ul>


<a name=276>
<h1>printf()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Writes formatted output to a file.
<dt>
<b>Syntax</b>
<dd>
<tt>int printf(string format[, argument, ...]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>printf</tt> function returns the number of characters written
to the file that has been opened by the most recent <a href=#309>output</a>
statement.
<p>
In case of an error, <tt>printf</tt> returns <tt>-1</tt>.
</dl>
<b>See also</b> <a href=#277>sprintf</a>,
<a href=#309>output</a>,
<a href=#248>fileerror</a>
<h2>Format string</h2>
The format string controls how the arguments will be converted,
formatted and printed. There must be exactly as many arguments
as necessary for the format. The number and type of arguments
will be checked against the format, and any mismatch will lead
to an error message.
<p>
The format string contains two types of objects - <i>plain characters</i>
and <i>format specifiers</i>:
<ul>
<li>Plain characters are simply copied verbatim to the output
<li>Format specifiers fetch arguments from the argument list
and apply formatting to them
</ul>
<h2>Format specifiers</h2>
A format specifier has the following form:
<p>
<tt>% [flags] [width] [.prec] type</tt>
<p>
Each format specification begins with the percent character (<tt>%</tt>).
After the <tt>%</tt> comes the following, in this order:
<ul>
<li>an optional sequence of flag characters, <tt>[flags]</tt>
<li>an optional width specifier, <tt>[width]</tt>
<li>an optional precision specifier, <tt>[.prec]</tt>
<li>the conversion type character, <tt>type</tt>
</ul>
<h2>Conversion type characters</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>d</tt>   </td><td width=20><td><b>signed</b> decimal <b>int</b></td></tr>
<tr><td><tt>o</tt>   </td><td width=20><td><b>unsigned</b> octal <b>int</b></td></tr>
<tr><td><tt>u</tt>   </td><td width=20><td><b>unsigned</b> decimal <b>int</b></td></tr>
<tr><td><tt>x</tt>   </td><td width=20><td><b>unsigned</b> hexadecimal <b>int</b> (with <b>a</b>, <b>b</b>,...)</td></tr>
<tr><td><tt>X</tt>   </td><td width=20><td><b>unsigned</b> hexadecimal <b>int</b> (with <b>A</b>, <b>B</b>,...)</td></tr>
<tr><td><tt>f</tt>   </td><td width=20><td><b>signed real</b> value of the form <tt>[-]dddd.dddd</tt></td></tr>
<tr><td><tt>e</tt>   </td><td width=20><td><b>signed real</b> value of the form <tt>[-]d.dddd</tt>e<tt>[&plusmn;]ddd</tt></td></tr>
<tr><td><tt>E</tt>   </td><td width=20><td>same as <tt>e</tt>, but with <b>E</b> for exponent</td></tr>
<tr><td><tt>g</tt>   </td><td width=20><td><b>signed real</b> value in either <tt>e</tt> or <tt>f</tt> form, based on given value and precision</td></tr>
<tr><td><tt>G</tt>   </td><td width=20><td>same as <tt>g</tt>, but with <b>E</b> for exponent if <tt>e</tt> format used</td></tr>
<tr><td><tt>c</tt>   </td><td width=20><td>single character</td></tr>
<tr><td><tt>s</tt>   </td><td width=20><td>character string</td></tr>
<tr><td><tt>%</tt>   </td><td width=20><td>the <tt>%</tt> character is printed</td></tr>
</table>
<h2>Flag characters</h2>
The following flag characters can appear in any order and combination.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>"-"</tt>   </td><td width=20><td>the formatted item is left-justified within the field; normally, items are right-justified</td></tr>
<tr><td><tt>"+"</tt>   </td><td width=20><td>a signed, positive item will always start with a plus character (<tt>+</tt>); normally, only negative items begin with a sign</td></tr>
<tr><td><tt>" "</tt>   </td><td width=20><td>a signed, positive item will always start with a space character; if both <tt>"+"</tt> and <tt>" "</tt> are specified,  <tt>"+"</tt> overrides <tt>" "</tt></td></tr>
</table>
<h2>Width specifiers</h2>
The width specifier sets the minimum field width for an output value.
<p>
Width is specified either directly, through a decimal digit string, or
indirectly, through an asterisk (<tt>*</tt>). If you use an asterisk for the
width specifier, the next argument in the call (which must be an <tt>int</tt>)
specifies the minimum output field width.
<p>
In no case does a nonexistent or small field width cause truncation of
a field. If the result of a conversion is wider than the field width,
the field is simply expanded to contain the conversion result.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt><i>n</i></tt>   </td><td width=20><td>At least <i>n</i> characters are printed. If the output value has less than <i>n</i> characters, the output is padded with blanks (right-padded if <tt>"-"</tt> flag given, left-padded otherwise).</td></tr>
<tr><td><tt>0<i>n</i></tt>   </td><td width=20><td>At least <i>n</i> characters are printed. If the output value has less than <i>n</i> characters, it is filled on the left with zeros.</td></tr>
<tr><td><tt>*</tt>   </td><td width=20><td>The argument list supplies the width specifier, which must precede the actual argument being formatted.</td></tr>
</table>
<h2>Precision specifiers</h2>
A precision specifier always begins with a period (<tt>.</tt>) to
separate it from any preceding width specifier. Then, like width,
precision is specified either directly through a decimal digit string, or
indirectly, through an asterisk (<tt>*</tt>). If you use an asterisk for the
precision specifier, the next argument in the call (which must be an <tt>int</tt>)
specifies the precision.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>none   </td><td width=20><td>Precision set to default.</td></tr>
<tr><td><tt>.0</tt>   </td><td width=20><td>For <tt>int</tt> types, precision is set to default; for <tt>real</tt> types, no decimal point is printed.</td></tr>
<tr><td><tt>.<i>n</i></tt>   </td><td width=20><td><i>n</i> characters or <i>n</i> decimal places are printed. If the output value has more than <i>n</i> characters the output might be truncated or rounded (depending on the type character).</td></tr>
<tr><td><tt>*</tt>   </td><td width=20><td>The argument list supplies the precision specifier, which must precede the actual argument being formatted.</td></tr>
</table>
<h2>Default precision values</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>douxX</tt>   </td><td width=20><td>1</td></tr>
<tr><td><tt>eEf</tt>   </td><td width=20><td>6</td></tr>
<tr><td><tt>gG</tt>   </td><td width=20><td>all significant digits</td></tr>
<tr><td><tt>c</tt>   </td><td width=20><td>no effect</td></tr>
<tr><td><tt>s</tt>   </td><td width=20><td>print entire string</td></tr>
</table>
<h2>How precision specification (<tt>.n</tt>) affects conversion</h2>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>douxX</tt>   </td><td width=20><td><i>.n</i> specifies that at least <i>n</i> characters are printed. If the input argument has less than <i>n</i> digits, the output value is left-padded with zeros. If the input argument has more than <i>n</i> digits, the output value is <b>not</b> truncated.</td></tr>
<tr><td><tt>eEf</tt>   </td><td width=20><td><i>.n</i> specifies that <i>n</i> characters are printed after the decimal point, and the last digit printed is rounded.</td></tr>
<tr><td><tt>gG</tt>   </td><td width=20><td><i>.n</i> specifies that at most <i>n</i> significant digits are printed.</td></tr>
<tr><td><tt>c</tt>   </td><td width=20><td><i>.n</i> has no effect on the output.</td></tr>
<tr><td><tt>s</tt>   </td><td width=20><td><i>.n</i> specifies that no more than <i>n</i> characters are printed.</td></tr>
</table>
<h2>Binary zero characters</h2>
Unlike <a href=#277>sprintf</a>, the <tt>printf</tt> function can print binary zero characters (0x00).
<pre>
char c = 0x00;
printf("%c", c);
</pre>
<h2>Example</h2>
<pre>
int i = 42;
real r = 3.14;
char c = 'A';
string s = "Hello";
printf("Integer: %8d\n", i);
printf("Hex:     %8X\n", i);
printf("Real:    %8f\n", r);
printf("Char:    %-8c\n", c);
printf("String:  %-8s\n", s);
</pre>


<a name=277>
<h1>sprintf()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Writes formatted output into a string.
<dt>
<b>Syntax</b>
<dd>
<tt>int sprintf(string result, string format[, argument, ...]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>sprintf</tt> function returns the number of characters written
into the <tt>result</tt> string.
<p>
In case of an error, <tt>sprintf</tt> returns <tt>-1</tt>.
</dl>
<b>See also</b> <a href=#276>printf</a>
<h2>Format string</h2>
See <a href=#276>printf</a>.
<h2>Binary zero characters</h2>
Note that <tt>sprintf</tt> can not return strings with embedded binary zero
characters (0x00). If the resulting string contains a binary zero character,
any characters following that zero character will be dropped.
Use <a href=#276>printf</a> if you need to output binary data.
<h2>Example</h2>
<pre>
string result;
int number = 42;
sprintf(result, "The number is %d", number);
</pre>


<a name=278>
<h1>String Functions</h1>
<i>String functions</i> are used to manipulate character strings.
<p>
The following string functions are available:
<ul>
<li><a href=#279>strchr()</a>
<li><a href=#280>strjoin()</a>
<li><a href=#281>strlen()</a>
<li><a href=#282>strlwr()</a>
<li><a href=#283>strrchr()</a>
<li><a href=#284>strrstr()</a>
<li><a href=#285>strsplit()</a>
<li><a href=#286>strstr()</a>
<li><a href=#287>strsub()</a>
<li><a href=#288>strtod()</a>
<li><a href=#289>strtol()</a>
<li><a href=#290>strupr()</a>
<li><a href=#291>strxstr()</a>
</ul>


<a name=279>
<h1>strchr()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Scans a string for the first occurrence of a given character.
<dt>
<b>Syntax</b>
<dd>
<tt>int strchr(string s, char c[, int index]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strchr</tt> function returns the integer offset of the
character in the string, or <tt>-1</tt> if the character does not
occur in the string.
</dl>
<b>See also</b> <a href=#283>strrchr</a>,
<a href=#286>strstr</a>
<p>
If <tt>index</tt> is given, the search starts at that position.
Negative values are counted from the end of the string.
<h2>Example</h2>
<pre>
string s = "This is a string";
char c = 'a';
int pos = strchr(s, c);
if (pos &gt;= 0)
   printf("The character %c is at position %d\n", c, pos);
else
   printf("The character was not found\n");
</pre>


<a name=280>
<h1>strjoin()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Joins a string array to form a single string.
<dt>
<b>Syntax</b>
<dd>
<tt>string strjoin(string array[], char separator);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strjoin</tt> function returns the combined entries of <tt>array</tt>.
</dl>
<b>See also</b> <a href=#285>strsplit</a>,
<a href=#265>lookup</a>,
<a href=#253>fileread</a>
<p>
<tt>strjoin</tt> joins all entries in <tt>array</tt>, delimited by the given
<tt>separator</tt> and returns the resulting string.
<p>
If <tt>separator</tt> is the newline character (<tt>"\n"</tt>) the resulting
string will be terminated with a newline character.
This is done to have a text file that
consists of N lines (each of which is terminated with a newline) and is read
in with the <a href=#253>fileread()</a> function and
<a href=#285>split</a> into
an array of N strings to be joined to the original string as read from the file.
<h2>Example</h2>
<pre>
string a[] = { "Field 1", "Field 2", "Field 3" };
string s = strjoin(a, ':');
</pre>


<a name=281>
<h1>strlen()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Calculates the length of a string.
<dt>
<b>Syntax</b>
<dd>
<tt>int strlen(string s);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strlen</tt> function returns the number of characters in
the string.
</dl>
<h2>Example</h2>
<pre>
string s = "This is a string";
int l = strlen(s);
printf("The string is %d characters long\n", l);
</pre>


<a name=282>
<h1>strlwr()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Converts uppercase letters in a string to lowercase.
<dt>
<b>Syntax</b>
<dd>
<tt>string strlwr(string s);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strlwr</tt> function returns the modified string.
The original string (given as parameter) is not changed.
</dl>
<b>See also</b> <a href=#290>strupr</a>,
<a href=#246>tolower</a>
<h2>Example</h2>
<pre>
string s = "This Is A String";
string r = strlwr(s);
printf("Prior to strlwr: %s - after strlwr: %s\n", s, r);
</pre>


<a name=283>
<h1>strrchr()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Scans a string for the last occurrence of a given character.
<dt>
<b>Syntax</b>
<dd>
<tt>int strrchr(string s, char c[, int index]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strrchr</tt> function returns the integer offset of the
character in the string, or <tt>-1</tt> if the character does not
occur in the string.
</dl>
<b>See also</b> <a href=#279>strchr</a>,
<a href=#284>strrstr</a>
<p>
If <tt>index</tt> is given, the search starts at that position.
Negative values are counted from the end of the string.
<h2>Example</h2>
<pre>
string s = "This is a string";
char c = 'a';
int pos = strrchr(s, c);
if (pos &gt;= 0)
   printf("The character %c is at position %d\n", c, pos);
else
   printf("The character was not found\n");
</pre>


<a name=284>
<h1>strrstr()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Scans a string for the last occurrence of a given substring.
<dt>
<b>Syntax</b>
<dd>
<tt>int strrstr(string s1, string s2[, int index]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strrstr</tt> function returns the integer offset of the
first character of s2 in s1, or <tt>-1</tt> if the substring does not
occur in the string.
</dl>
<b>See also</b> <a href=#286>strstr</a>,
<a href=#283>strrchr</a>
<p>
If <tt>index</tt> is given, the search starts at that position.
Negative values are counted from the end of the string.
<h2>Example</h2>
<pre>
string s1 = "This is a string", s2 = "is a";
int pos = strrstr(s1, s2);
if (pos &gt;= 0)
   printf("The substring starts at %d\n", pos);
else
   printf("The substring was not found\n");
</pre>


<a name=285>
<h1>strsplit()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Splits a string into separate fields.
<dt>
<b>Syntax</b>
<dd>
<tt>int strsplit(string &amp;array[], string s, char separator);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strsplit</tt> function returns the number of entries copied into <tt>array</tt>.
</dl>
<b>See also</b> <a href=#280>strjoin</a>,
<a href=#265>lookup</a>,
<a href=#253>fileread</a>
<p>
<tt>strsplit</tt> splits the string <tt>s</tt> at the given <tt>separator</tt>
and stores the resulting fields in the <tt>array</tt>.
<p>
If <tt>separator</tt> is the newline character (<tt>"\n"</tt>) the last field
will be silently dropped if it is empty. This is done to have a text file that
consists of N lines (each of which is terminated with a newline) and is read
in with the <a href=#253>fileread()</a> function to be split into
an array of N strings. With any other <tt>separator</tt> an empty field at the
end of the string will count, so <tt>"a:b:c:"</tt> will result in 4 fields,
the last of which is empty.
<h2>Example</h2>
<pre>
string a[];
int n = strsplit(a, "Field 1:Field 2:Field 3", ':');
</pre>


<a name=286>
<h1>strstr()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Scans a string for the first occurrence of a given substring.
<dt>
<b>Syntax</b>
<dd>
<tt>int strstr(string s1, string s2[, int index]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strstr</tt> function returns the integer offset of the
first character of s2 in s1, or <tt>-1</tt> if the substring does not
occur in the string.
</dl>
<b>See also</b> <a href=#284>strrstr</a>,
<a href=#279>strchr</a>,
<a href=#291>strxstr</a>
<p>
If <tt>index</tt> is given, the search starts at that position.
Negative values are counted from the end of the string.
<h2>Example</h2>
<pre>
string s1 = "This is a string", s2 = "is a";
int pos = strstr(s1, s2);
if (pos &gt;= 0)
   printf("The substring starts at %d\n", pos);
else
   printf("The substring was not found\n");
</pre>


<a name=287>
<h1>strsub()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Extracts a substring from a string.
<dt>
<b>Syntax</b>
<dd>
<tt>string strsub(string s, int start[, int length]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strsub</tt> function returns the substring indicated by
the <tt>start</tt> and <tt>length</tt> value.
<p>
The value for <tt>length</tt> must be positive, otherwise an empty string
will be returned. If <tt>length</tt> is ommitted, the rest of the string
(beginning at <tt>start</tt>) is returned.
<p>
If <tt>start</tt> points to a position outside the string, an empty string
is returned.
</dl>
<h2>Example</h2>
<pre>
string s = "This is a string";
string t = strsub(s, 4, 7);
printf("The extracted substring is: %s\n", t);
</pre>


<a name=288>
<h1>strtod()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Converts a string to a real value.
<dt>
<b>Syntax</b>
<dd>
<tt>real strtod(string s);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strtod</tt> function returns the numerical representation
of the given string as a <tt>real</tt> value. Conversion ends at the
first character that does not fit into the format of a
<a href=#153>real constant</a>.
If an error occurs during conversion of the string <tt>0.0</tt>
will be returned.
</dl>
<b>See also</b> <a href=#289>strtol</a>
<h2>Example</h2>
<pre>
string s = "3.1415";
real r = strtod(s);
printf("The value is %f\n", r);
</pre>


<a name=289>
<h1>strtol()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Converts a string to an integer value.
<dt>
<b>Syntax</b>
<dd>
<tt>int strtol(string s);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strtol</tt> function returns the numerical representation
of the given string as an <tt>int</tt> value. Conversion ends at the
first character that does not fit into the format of an
<a href=#152>integer constant</a>.
If an error occurs during conversion of the string <tt>0</tt>
will be returned.
</dl>
<b>See also</b> <a href=#288>strtod</a>
<h2>Example</h2>
<pre>
string s = "1234";
int i = strtol(s);
printf("The value is %d\n", i);
</pre>


<a name=290>
<h1>strupr()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Converts lowercase letters in a string to uppercase.
<dt>
<b>Syntax</b>
<dd>
<tt>string strupr(string s);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strupr</tt> function returns the modified string.
The original string (given as parameter) is not changed.
</dl>
<b>See also</b> <a href=#282>strlwr</a>,
<a href=#246>toupper</a>
<h2>Example</h2>
<pre>
string s = "This Is A String";
string r = strupr(s);
printf("Prior to strupr: %s - after strupr: %s\n", s, r);
</pre>


<a name=291>
<h1>strxstr()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Scans a string for the first occurrence of a given regular expression.
<dt>
<b>Syntax</b>
<dd>
<tt>int strxstr(string s1, string s2[, int index[, int &amp;length]]);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>strxstr</tt> function returns the integer offset of the substring
in s1 that matches the regular expression in s2, or <tt>-1</tt> if
the regular expression does not match in the string.
</dl>
<b>See also</b> <a href=#286>strstr</a>,
<a href=#279>strchr</a>,
<a href=#284>strrstr</a>
<p>
If <tt>index</tt> is given, the search starts at that position.
Negative values are counted from the end of the string.
<p>
If <tt>length</tt> is given, the actual length of the matching substring
is returned in that variable.
<p>
<i>Regular expressions</i> allow you to find a pattern within a text string.
For instance, the regular expression "i.*a" would find a sequence of characters
that starts with an 'i', followed by any character ('.') any number of times ('*'),
and ends with an 'a'. It would match on "is a" as well as "is this a" or "ia".<br>
Details on regular expressions can be found, for instance, in the book
<i>Mastering Regular Expressions</i> by Jeffrey E. F. Friedl.
<h2>Example</h2>
<pre>
string s1 = "This is a string", s2 = "i.*a";
int len = 0;
int pos = strxstr(s1, s2, 0, len);
if (pos &gt;= 0)
   printf("The substring starts at %d and is %d charcaters long\n", pos, len);
else
   printf("The substring was not found\n");
</pre>


<a name=292>
<h1>Time Functions</h1>
<i>Time functions</i> are used to get and process time and date
information.
<p>
The following time functions are available:
<ul>
<li><a href=#295>t2day()</a>
<li><a href=#295>t2dayofweek()</a>
<li><a href=#295>t2hour()</a>
<li><a href=#295>t2minute()</a>
<li><a href=#295>t2month()</a>
<li><a href=#295>t2second()</a>
<li><a href=#295>t2string()</a>
<li><a href=#295>t2year()</a>
<li><a href=#293>time()</a>
<li><a href=#294>timems()</a>
</ul>


<a name=293>
<h1>time()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Gets the current system time.
<dt>
<b>Syntax</b>
<dd>
<tt>int time(void);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>time</tt> function returns the current system time as the number
of seconds elapsed since a system dependent reference date.
</dl>
<b>See also</b> <a href=#295>Time Conversions</a>,
<a href=#251>filetime</a>,
<a href=#294>timems()</a>
<h2>Example</h2>
<pre>
int CurrentTime = time();
</pre>


<a name=294>
<h1>timems()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Gets the number of milliseconds since the start of the ULP.
<dt>
<b>Syntax</b>
<dd>
<tt>int timems(void);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>timems</tt> function returns the number of milliseconds since the
start of the ULP.
<p>
After 86400000 milliseconds (i.e. every 24 hours), the value starts at 0 again.
</dl>
<b>See also</b> <a href=#293>time</a>
<h2>Example</h2>
<pre>
int elapsed = timems();
</pre>


<a name=295>
<h1>Time Conversions</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Convert a time value to day, month, year etc.
<dt>
<b>Syntax</b>
<dd>
<tt>int t2day(int t);</tt><br>
<tt>int t2dayofweek(int t);</tt><br>
<tt>int t2hour(int t);</tt><br>
<tt>int t2minute(int t);</tt><br>
<tt>int t2month(int t);</tt><br>
<tt>int t2second(int t);</tt><br>
<tt>int t2year(int t);</tt><br>
<br>
<tt>string t2string(int t[, string format]);</tt>
<dt>
<b>Returns</b>
<dd>
<tt>t2day      </tt> returns the day of the month (<tt>1</tt>..<tt>31</tt>)<br>
<tt>t2dayofweek</tt> returns the day of the week (<tt>0</tt>=sunday..<tt>6</tt>)<br>
<tt>t2hour     </tt> returns the hour (<tt>0</tt>..<tt>23</tt>)<br>
<tt>t2minute   </tt> returns the minute (<tt>0</tt>..<tt>59</tt>)<br>
<tt>t2month    </tt> returns the month (<tt>0</tt>..<tt>11</tt>)<br>
<tt>t2second   </tt> returns the second (<tt>0</tt>..<tt>59</tt>)<br>
<tt>t2year     </tt> returns the year (including century!)<br>
<tt>t2string   </tt> returns a formatted string containing date and time
</dl>
<b>See also</b> <a href=#293>time</a>
<p>
The <tt>t2string</tt> function without the optional <tt>format</tt> parameter
converts the given time <tt>t</tt> into a country specific string in local time.
<p>
If <tt>t2string</tt> is called with a <tt>format</tt> string, that format is
used to determine what the result should look like.
<p>
The following expressions can be used in a <tt>format</tt> string:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>d</td><td width=20><td>the day as a number without a leading zero (1 to 31)</td></tr>
<tr><td>dd</td><td width=20><td>the day as a number with a leading zero (01 to 31)</td></tr>
<tr><td>ddd</td><td width=20><td>the abbreviated localized day name (e.g. "Mon" to "Sun")</td></tr>
<tr><td>dddd</td><td width=20><td>the long localized day name (e.g. "Monday" to "Sunday")</td></tr>
<tr><td>M</td><td width=20><td>the month as a number without a leading zero (1-12)</td></tr>
<tr><td>MM</td><td width=20><td>the month as a number with a leading zero (01-12)</td></tr>
<tr><td>MMM</td><td width=20><td>the abbreviated localized month name (e.g. "Jan" to "Dec")</tr>
<tr><td>MMMM</td><td width=20><td>the long localized month name (e.g. "January" to "December")</td></tr>
<tr><td>yy</td><td width=20><td>the year as a two digit number (00-99)</td></tr>
<tr><td>yyyy</td><td width=20><td>the year as a four digit number</td></tr>
<tr><td>h</td><td width=20><td>the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr>
<tr><td>hh</td><td width=20><td>the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr>
<tr><td>m</td><td width=20><td>the minute without a leading zero (0 to 59)</td></tr>
<tr><td>mm</td><td width=20><td>the minute with a leading zero (00 to 59)</td></tr>
<tr><td>s</td><td width=20><td>the second without a leading zero (0 to 59)</td></tr>
<tr><td>ss</td><td width=20><td>the second with a leading zero (00 to 59)</td></tr>
<tr><td>z</td><td width=20><td>the milliseconds without leading zeros (always 0, since the given time only has a one second resolution)</td></tr>
<tr><td>zzz</td><td width=20><td>the milliseconds with leading zeros (always 000, since the given time only has a one second resolution)</td></tr>
<tr><td>AP</td><td width=20><td>use AM/PM display (<i>AP</i> will be replaced by either "AM" or "PM")</td></tr>
<tr><td>ap</td><td width=20><td>use am/pm display (<i>ap</i> will be replaced by either "am" or "pm")</td></tr>
<tr><td>U</td><td width=20><td>display the given time as UTC (must be the first character; default is local time)</td></tr>
</table>
<p>
All other characters will be copied "as is".
Any sequence of characters that are enclosed in singlequotes will be treated as
text and not be used as an expression. Two consecutive single quotes ('') are
replaced by a single quote in the output.
<h2>Example</h2>
<pre>
int t = time();
printf("It is now %02d:%02d:%02d\n",
       t2hour(t), t2minute(t), t2second(t));
printf("ISO time is %s\n", t2string(t, "Uyyyy-MM-dd hh:mm:ss"));
</pre>


<a name=296>
<h1>Object Functions</h1>
<i>Object functions</i> are used to access common information about objects.
<p>
The following object functions are available:
<ul>
<li><a href=#297>clrgroup()</a>
<li><a href=#298>ingroup()</a>
<li><a href=#299>setgroup()</a>
</ul>


<a name=297>
<h1>clrgroup()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Clears the group flags of an object.
<dt>
<b>Syntax</b>
<dd>
<tt>void clrgroup(object);</tt>
<dt>
</dl>
<b>See also</b> <a href=#298>ingroup()</a>,
<a href=#299>setgroup()</a>,
<a href=#54>GROUP command</a>
<p>
The <tt>clrgroup()</tt> function clears the group flags of the given object,
so that it is no longer part of the previously defined group.
<p>
When applied to an object that contains other objects (like a UL_BOARD or
UL_NET) the group flags of all contained objects are cleared recursively.
<h2>Example</h2>
<pre>
board(B) {
  B.elements(E)
    clrgroup(E);
  }
</pre>


<a name=298>
<h1>ingroup()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Checks whether an object is in the group.
<dt>
<b>Syntax</b>
<dd>
<tt>int ingroup(object);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>ingroup</tt> function returns a non-zero value if the given object is
in the group.
</dl>
<b>See also</b> <a href=#297>clrgroup()</a>,
<a href=#299>setgroup()</a>,
<a href=#54>GROUP command</a>
<p>
If a group has been defined in the editor, the <tt>ingroup()</tt> function can
be used to check whether a particular object is part of the group.
<p>
Objects with a single coordinate that are individually selectable in the current
drawing (like UL_TEXT, UL_VIA, UL_CIRCLE etc.) return a non-zero value
in a call to <tt>ingroup()</tt> if that coordinate is within the defined group.
<p>
A UL_WIRE returns 0, 1, 2 or 3, depending on whether none, the first, the second
or both of its end points are in the group.
<p>
A UL_RECTANGLE and UL_FRAME returns a non-zero value if one or more of its corners are in the group.
The value has bit 0 set for the upper right corner, bit 1 for the upper left, bit 2
for the bottom left, and bit 3 for the bottom right corner.
<p>
Objects that have no coordinates (like UL_NET, UL_SEGMENT, UL_SIGNAL etc.) return
a non-zero value if one or more of the objects within them are in the group.
<p>
UL_CONTACTREF and UL_PINREF, though not having coordinates of their own, return
a non-zero value if the referenced UL_CONTACT or UL_PIN, respectively, is within
the group.
<h2>Example</h2>
<pre>
output("group.txt") {
  board(B) {
    B.elements(E) {
      if (ingroup(E))
         printf("Element %s is in the group\n", E.name);
      }
    }
  }
</pre>


<a name=299>
<h1>setgroup()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Sets the group flags of an object.
<dt>
<b>Syntax</b>
<dd>
<tt>void setgroup(object[, int flags]);</tt>
</dl>
<b>See also</b> <a href=#297>clrgroup()</a>,
<a href=#298>ingroup()</a>,
<a href=#54>GROUP command</a>
<p>
The <tt>setgroup()</tt> function sets the group flags of the given object,
so that it becomes part of the group.
<p>
If no <tt>flags</tt> are given, the object is added to the group as a whole
(i.e. all of its selection points, in case it has more than one).
<p>
If <tt>flags</tt> has a non-zero value, only the group flags of the given
points of the object are set. For a UL_WIRE this means that <tt>'1'</tt>
sets the group flag of the first point, <tt>'2'</tt> that of the second point,
and <tt>'3'</tt> sets both. Any previously set group flags remain unchanged
by a call to <tt>setgroup()</tt>.
<p>
When applied to an object that contains other objects (like a UL_BOARD or
UL_NET) the group flags of all contained objects are set recursively.
<h2>Example</h2>
<pre>
board(B) {
  B.elements(E)
    setgroup(E);
  }
</pre>


<a name=300>
<h1>XML Functions</h1>
<i>XML functions</i> are used to process XML (<i>Extensible Markup Language</i>) data.
<p>
The following XML functions are available:
<ul>
<li><a href=#301>xmlattribute()</a>
<li><a href=#301>xmlattributes()</a>
<li><a href=#302>xmlelement()</a>
<li><a href=#302>xmlelements()</a>
<li><a href=#303>xmltags()</a>
<li><a href=#304>xmltext()</a>
</ul>


<a name=301>
<h1>xmlattribute(), xmlattributes()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Extract the attributes of an XML tag.
<dt>
<b>Syntax</b>
<dd>
<tt>string xmlattribute(string xml, string tag, string attribute);</tt><br>
<tt>int xmlattributes(string &amp;array[], string xml, string tag);</tt>
</dl>
<b>See also</b> <a href=#302>xmlelement()</a>,
<a href=#303>xmltags()</a>,
<a href=#304>xmltext()</a>
<p>
The <tt>xmlattribute</tt> function returns the value of the given <tt>attribute</tt>
from the given <tt>tag</tt> within the given <tt>xml</tt> code.
If an attribute appears more than once in the same tag, the value of its last
occurrence is taken.
<p>
The <tt>xmlattributes</tt> function stores the names of all attributes
from the given <tt>tag</tt> within the given <tt>xml</tt> code in the <tt>array</tt>
and returns the number of attributes found.
If an attribute appears more than once in the same tag, its name appears only
once in the <tt>array</tt>.
<p>
The <tt>tag</tt> is given in the form of a <i>path</i>.
<p>
If the given <tt>xml</tt> code contains an error, the result of any XML function
is empty, and a warning dialog is presented to the user, giving information
about where in the ULP and XML code the error occurred. Note that the line and
column number within the XML code refers to the actual string given to this
function as the <tt>xml</tt> parameter.
<h2>Example</h2>
<pre>
// XML contains the following data:
&lt;root&gt;
  &lt;body abc="def" xyz="123"&gt;
    ...
  &lt;/body&gt;
&lt;/root&gt;
//
string s[];
int n = xmlattributes(s, XML, "root/body");
Result: { "abc", "xyz" }
string s = xmlattribute(XML, "root/body", "xyz");
Result: "123"
</pre>


<a name=302>
<h1>xmlelement(), xmlelements()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Extract elements from an XML code.
<dt>
<b>Syntax</b>
<dd>
<tt>string xmlelement(string xml, string tag);</tt><br>
<tt>int xmlelements(string &amp;array[], string xml, string tag);</tt>
</dl>
<b>See also</b> <a href=#303>xmltags()</a>,
<a href=#301>xmlattribute()</a>,
<a href=#304>xmltext()</a>
<p>
The <tt>xmlelement</tt> function returns the complete XML element of the given
<tt>tag</tt> within the given <tt>xml</tt> code.
The result still contains the element's outer XML tag, and can thus be used
for further processing with the other XML functions.
Any whitespace within plain text parts of the element is retained.
The overall formatting of the XML tags within the element may be different
than the original <tt>xml</tt> code, though.<br>
If there is more than one occurrence of <tt>tag</tt> within <tt>xml</tt>, the
first one will be returned. Use <tt>xmlelements</tt> if you want to get all
occurrences.
<p>
The <tt>xmlelements</tt> function works just like <tt>xmlelement</tt>, but returns
all occurrences of elements with the given <tt>tag</tt>. The return value is the
number of elements stored in the <tt>array</tt>.
<p>
The <tt>tag</tt> is given in the form of a <i>path</i>.
<p>
If the given <tt>xml</tt> code contains an error, the result of any XML function
is empty, and a warning dialog is presented to the user, giving information
about where in the ULP and XML code the error occurred. Note that the line and
column number within the XML code refers to the actual string given to this
function as the <tt>xml</tt> parameter.
<h2>Example</h2>
<pre>
// XML contains the following data:
&lt;root&gt;
  &lt;body&gt;
    &lt;contents&gt;
      &lt;string&gt;Some text 1&lt;/string&gt;
      &lt;any&gt;anything 1&lt;/any&gt;
    &lt;/contents&gt;
    &lt;contents&gt;
      &lt;string&gt;Some text 2&lt;/string&gt;
      &lt;any&gt;anything 2&lt;/any&gt;
    &lt;/contents&gt;
    &lt;appendix&gt;
      &lt;string&gt;Some text 3&lt;/string&gt;
    &lt;/appendix&gt;
  &lt;/body&gt;
&lt;/root&gt;
//
string s = xmlelement(XML, "root/body/appendix");
Result: " <appendix>\n  <string>Some text 3</string>\n </appendix>\n"
string s[];
int n = xmlelements(s, XML, "root/body/contents");
Result: { " &lt;contents&gt;\n  &lt;string&gt;Some text 1&lt;/string&gt;\n  &lt;any&gt;anything 1&lt;/any&gt;\n &lt;/contents&gt;\n",
          " &lt;contents&gt;\n  &lt;string&gt;Some text 2&lt;/string&gt;\n  &lt;any&gt;anything 2&lt;/any&gt;\n &lt;/contents&gt;\n"
        }
</pre>


<a name=303>
<h1>xmltags()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Extract the list of tag names within an XML code.
<dt>
<b>Syntax</b>
<dd>
<tt>int xmltags(string &amp;array[], string xml, string tag);</tt>
</dl>
<b>See also</b> <a href=#302>xmlelement()</a>,
<a href=#301>xmlattribute()</a>,
<a href=#304>xmltext()</a>
<p>
The <tt>xmltags</tt> function returns the names of all the tags on the top level
of the given <tt>tag</tt> within the given <tt>xml</tt> code.
The return value is the number of tag names stored in the <tt>array</tt>.
<p>
Each tag name is returned only once, even if it appears several times in the XML code.
<p>
The <tt>tag</tt> is given in the form of a <i>path</i>.
<p>
If the given <tt>xml</tt> code contains an error, the result of any XML function
is empty, and a warning dialog is presented to the user, giving information
about where in the ULP and XML code the error occurred. Note that the line and
column number within the XML code refers to the actual string given to this
function as the <tt>xml</tt> parameter.
<h2>Example</h2>
<pre>
// XML contains the following data:
&lt;root&gt;
  &lt;body&gt;
    &lt;contents&gt;
      &lt;string&gt;Some text 1&lt;/string&gt;
      &lt;any&gt;anything 1&lt;/any&gt;
    &lt;/contents&gt;
    &lt;contents&gt;
      &lt;string&gt;Some text 2&lt;/string&gt;
      &lt;any&gt;anything 2&lt;/any&gt;
    &lt;/contents&gt;
    &lt;appendix&gt;
      &lt;string&gt;Some text 3&lt;/string&gt;
    &lt;/appendix&gt;
  &lt;/body&gt;
&lt;/root&gt;
//
string s[];
int n = xmltags(s, XML, "root/body");
Result: { "contents", "appendix" }
int n = xmltags(s, XML, "");
Result: "root"
</pre>


<a name=304>
<h1>xmltext()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Extract the textual data of an XML element.
<dt>
<b>Syntax</b>
<dd>
<tt>string xmltext(string xml, string tag);</tt>
</dl>
<b>See also</b> <a href=#302>xmlelement()</a>,
<a href=#301>xmlattribute()</a>,
<a href=#303>xmltags()</a>
<p>
The <tt>xmltext</tt> function returns the textual data from
the given <tt>tag</tt> within the given <tt>xml</tt> code.
<p>
Any tags within the text are stripped, whitespace (including
newline characters) is retained.
<p>
The <tt>tag</tt> is given in the form of a <i>path</i>.
<p>
If the given <tt>xml</tt> code contains an error, the result of any XML function
is empty, and a warning dialog is presented to the user, giving information
about where in the ULP and XML code the error occurred. Note that the line and
column number within the XML code refers to the actual string given to this
function as the <tt>xml</tt> parameter.
<h2>Example</h2>
<pre>
// XML contains the following data:
&lt;root&gt;
  &lt;body&gt;
    Some &lt;b&gt;text&lt;/b&gt;.
  &lt;/body&gt;
&lt;/root&gt;
//
string s = xmltext(XML, "root/body");
Result: "\n    Some text.\n  "
</pre>


<a name=305>
<h1>Builtin Statements</h1>
<i>Builtin statements</i> are generally used to open a certain context in which
data structures of files can be accessed.
<p>
The general syntax of a builtin statement is
<pre>
name(parameters) statement
</pre>
where <tt>name</tt> is the name of the builtin statement, <tt>parameters</tt>
stands for one or more parameters, and <tt>statement</tt> is the code that
will be executed inside the context opened by the builtin statement.
<p>
Note that <tt>statement</tt> can be a compound statement, as in
<pre>
board(B) {
  B.elements(E) printf("Element: %s\n", E.name);
  B.Signals(S)  printf("Signal: %s\n", S.name);
  }
</pre>
The following builtin statements are available:
<ul>
<li><a href=#306>board()</a>
<li><a href=#307>deviceset()</a>
<li><a href=#308>library()</a>
<li><a href=#309>output()</a>
<li><a href=#310>package()</a>
<li><a href=#311>schematic()</a>
<li><a href=#312>sheet()</a>
<li><a href=#313>symbol()</a>
</ul>


<a name=306>
<h1>board()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a board context.
<dt>
<b>Syntax</b>
<dd>
<tt>board(identifier) statement</tt>
</dl>
<b>See also</b> <a href=#311>schematic</a>,
<a href=#308>library</a>
<p>
The <tt>board</tt> statement opens a board context if the current editor
window contains a board drawing. A variable of type
<a href=#175>UL_BOARD</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the board context is successfully opened and a board variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the board variable can be accessed to retrieve further
data from the board.
<p>
If the current editor window does not contain a board drawing, an error
message is given and the ULP is terminated.
<h2>Check if there is a board</h2>
By using the <tt>board</tt> statement without an argument you can check
if the current editor window contains a board drawing. In that case,
<tt>board</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a board drawing in the current editor window, and <tt>0</tt>
otherwise.
<h2>Accessing board from a schematic</h2>
If the current editor window contains a schematic drawing, you can still
access that schematic's board by preceding the <tt>board</tt> statement
with the prefix <tt>project</tt>, as in
<pre>
project.board(B) { ... }
</pre>
This will open a board context regardless whether the current editor window
contains a board or a schematic drawing. However, there must be an editor
window containing that board somewhere on the desktop!
<h2>Example</h2>
<pre>
if (board)
   board(B) {
     B.elements(E)
       printf("Element: %s\n", E.name);
     }
</pre>


<a name=307>
<h1>deviceset()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a device set context.
<dt>
<b>Syntax</b>
<dd>
<tt>deviceset(identifier) statement</tt>
</dl>
<b>See also</b> <a href=#310>package</a>,
<a href=#313>symbol</a>,
<a href=#308>library</a>
<p>
The <tt>deviceset</tt> statement opens a device set context if the current editor
window contains a device drawing. A variable of type
<a href=#182>UL_DEVICESET</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the device set context is successfully opened and a device set variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the device set variable can be accessed to retrieve further
data from the device set.
<p>
If the current editor window does not contain a device drawing, an error
message is given and the ULP is terminated.
<h2>Check if there is a device set</h2>
By using the <tt>deviceset</tt> statement without an argument you can check
if the current editor window contains a device drawing. In that case,
<tt>deviceset</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a device drawing in the current editor window, and <tt>0</tt>
otherwise.
<h2>Example</h2>
<pre>
if (deviceset)
   deviceset(D) {
     D.gates(G)
       printf("Gate: %s\n", G.name);
     }
</pre>


<a name=308>
<h1>library()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a library context.
<dt>
<b>Syntax</b>
<dd>
<tt>library(identifier) statement</tt>
</dl>
<b>See also</b> <a href=#306>board</a>,
<a href=#311>schematic</a>,
<a href=#307>deviceset</a>,
<a href=#310>package</a>,
<a href=#313>symbol</a>
<p>
The <tt>library</tt> statement opens a library context if the current editor
window contains a library drawing. A variable of type
<a href=#192>UL_LIBRARY</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the library context is successfully opened and a library variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the library variable can be accessed to retrieve further
data from the library.
<p>
If the current editor window does not contain a library drawing, an error
message is given and the ULP is terminated.
<h2>Check if there is a library</h2>
By using the <tt>library</tt> statement without an argument you can check
if the current editor window contains a library drawing. In that case,
<tt>library</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a library drawing in the current editor window, and <tt>0</tt>
otherwise.
<h2>Example</h2>
<pre>
if (library)
   library(L) {
     L.devices(D)
       printf("Device: %s\n", D.name);
     }
</pre>


<a name=309>
<h1>output()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens an output file for subsequent printf() calls.
<dt>
<b>Syntax</b>
<dd>
<tt>output(string filename[, string mode]) statement</tt>
</dl>
<b>See also</b> <a href=#276>printf</a>,
<a href=#248>fileerror</a>
<p>
The <tt>output</tt> statement opens a file with the given <tt>filename</tt>
and <tt>mode</tt> for output through subsequent printf() calls.
If the file has been successfully opened, the <tt>statement</tt> is
executed, and after that the file is closed.
<p>
If the file cannot be opened, an error message is given and execution
of the ULP is terminated.
<p>
By default the output file is written into the <b>Project</b> directory.
<h2>File Modes</h2>
The <tt>mode</tt> parameter defines how the output file is to be opened.
If no <tt>mode</tt> parameter is given, the default is <tt>"wt"</tt>.
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><tt>a</tt>   </td><td width=20><td>append to an existing file, or create a new file if it does not exist</td></tr>
<tr><td><tt>w</tt>   </td><td width=20><td>create a new file (overwriting an existing file)</td></tr>
<tr><td><tt>t</tt>   </td><td width=20><td>open file in text mode</td></tr>
<tr><td><tt>b</tt>   </td><td width=20><td>open file in binary mode</td></tr>
<tr><td><tt>D</tt>   </td><td width=20><td>delete this file when ending the EAGLE session (only works together with <tt>w</tt>)</td></tr>
<tr><td><tt>F</tt>   </td><td width=20><td>force using this file name (normally *.brd, *.sch and *.lbr are rejected)</td></tr>
</table>
<p>
Mode characters may appear in any order and combination. However, only the
last one of <tt>a</tt> and <tt>w</tt> or <tt>t</tt> and <tt>b</tt>, respectively,
is significant. For example a mode of <tt>"abtw"</tt> would open a file for
textual write, which would be the same as <tt>"wt"</tt>.
<h2>Nested Output statements</h2>
<tt>output</tt> statements can be nested, as long as there are enough file
handles available, and provided that no two active <tt>output</tt> statements
access the <b>same</b> file.
<h2>Example</h2>
<pre>
void PrintText(string s)
{
  printf("This also goes into the file: %s\n", s);
}
output("file.txt", "wt") {
  printf("Directly printed\n");
  PrintText("via function call");
  }
</pre>


<a name=310>
<h1>package()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a package context.
<dt>
<b>Syntax</b>
<dd>
<tt>package(identifier) statement</tt>
</dl>
<b>See also</b> <a href=#308>library</a>,
<a href=#307>deviceset</a>,
<a href=#313>symbol</a>
<p>
The <tt>package</tt> statement opens a package context if the current editor
window contains a package drawing. A variable of type
<a href=#194>UL_PACKAGE</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the package context is successfully opened and a package variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the package variable can be accessed to retrieve further
data from the package.
<p>
If the current editor window does not contain a package drawing, an error
message is given and the ULP is terminated.
<h2>Check if there is a package</h2>
By using the <tt>package</tt> statement without an argument you can check
if the current editor window contains a package drawing. In that case,
<tt>package</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a package drawing in the current editor window, and <tt>0</tt>
otherwise.
<h2>Example</h2>
<pre>
if (package)
   package(P) {
     P.contacts(C)
       printf("Contact: %s\n", C.name);
     }
</pre>


<a name=311>
<h1>schematic()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a schematic context.
<dt>
<b>Syntax</b>
<dd>
<tt>schematic(identifier) statement</tt>
</dl>
<b>See also</b> <a href=#306>board</a>,
<a href=#308>library</a>,
<a href=#312>sheet</a>
<p>
The <tt>schematic</tt> statement opens a schematic context if the current editor
window contains a schematic drawing. A variable of type
<a href=#201>UL_SCHEMATIC</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the schematic context is successfully opened and a schematic variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the schematic variable can be accessed to retrieve further
data from the schematic.
<p>
If the current editor window does not contain a schematic drawing, an error
message is given and the ULP is terminated.
<h2>Check if there is a schematic</h2>
By using the <tt>schematic</tt> statement without an argument you can check
if the current editor window contains a schematic drawing. In that case,
<tt>schematic</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a schematic drawing in the current editor window, and <tt>0</tt>
otherwise.
<h2>Accessing schematic from a board</h2>
If the current editor window contains a board drawing, you can still
access that board's schematic by preceding the <tt>schematic</tt> statement
with the prefix <tt>project</tt>, as in
<pre>
project.schematic(S) { ... }
</pre>
This will open a schematic context regardless whether the current editor window
contains a schematic or a board drawing. However, there must be an editor
window containing that schematic somewhere on the desktop!
<h2>Access the current Sheet</h2>
Use the <tt><a href=#312>sheet</a></tt> statement to
directly access the currently loaded sheet.
<h2>Example</h2>
<pre>
if (schematic)
   schematic(S) {
     S.parts(P)
       printf("Part: %s\n", P.name);
     }
</pre>


<a name=312>
<h1>sheet()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a sheet context.
<dt>
<b>Syntax</b>
<dd>
<tt>sheet(identifier) statement</tt>
</dl>
<b>See also</b> <a href=#311>schematic</a>
<p>
The <tt>sheet</tt> statement opens a sheet context if the current editor
window contains a sheet drawing. A variable of type
<a href=#203>UL_SHEET</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the sheet context is successfully opened and a sheet variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the sheet variable can be accessed to retrieve further
data from the sheet.
<p>
If the current editor window does not contain a sheet drawing, an error
message is given and the ULP is terminated.
<h2>Check if there is a sheet</h2>
By using the <tt>sheet</tt> statement without an argument you can check
if the current editor window contains a sheet drawing. In that case,
<tt>sheet</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a sheet drawing in the current editor window, and <tt>0</tt>
otherwise.
<h2>Example</h2>
<pre>
if (sheet)
   sheet(S) {
     S.parts(P)
       printf("Part: %s\n", P.name);
     }
</pre>


<a name=313>
<h1>symbol()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a symbol context.
<dt>
<b>Syntax</b>
<dd>
<tt>symbol(identifier) statement</tt>
</dl>
<b>See also</b> <a href=#308>library</a>,
<a href=#307>deviceset</a>,
<a href=#310>package</a>
<p>
The <tt>symbol</tt> statement opens a symbol context if the current editor
window contains a symbol drawing. A variable of type
<a href=#206>UL_SYMBOL</a> is created and is given
the name indicated by <tt>identifier</tt>.
<p>
Once the symbol context is successfully opened and a symbol variable has been
created, the <tt>statement</tt> is executed. Within the scope of the
<tt>statement</tt> the symbol variable can be accessed to retrieve further
data from the symbol.
<p>
If the current editor window does not contain a symbol drawing, an error
message is given and the ULP is terminated.
<h2>Check if there is a symbol</h2>
By using the <tt>symbol</tt> statement without an argument you can check
if the current editor window contains a symbol drawing. In that case,
<tt>symbol</tt> behaves like an integer constant, returning <tt>1</tt> if
there is a symbol drawing in the current editor window, and <tt>0</tt>
otherwise.
<h2>Example</h2>
<pre>
if (symbol)
   symbol(S) {
     S.pins(P)
       printf("Pin: %s\n", P.name);
     }
</pre>


<a name=314>
<h1>Dialogs</h1>
User Language Dialogs allow you to define your own frontend to a User Language Program.
<p>
The following sections describe User Language Dialogs in detail:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#315>Predefined Dialogs</a>  </td><td width=20><td>describes the ready to use standard dialogs</td></tr>
<tr><td><a href=#319>Dialog Objects</a>  </td><td width=20><td>defines the objects that can be used in a dialog</td></tr>
<tr><td><a href=#343>Layout Information</a>  </td><td width=20><td>explains how to define the location of objects within a dialog</td></tr>
<tr><td><a href=#344>Dialog Functions</a>  </td><td width=20><td>describes special functions for use with dialogs</td></tr>
<tr><td><a href=#351>A Complete Example</a>  </td><td width=20><td>shows a complete ULP with a data entry dialog</td></tr>
</table>


<a name=315>
<h1>Predefined Dialogs</h1>
<i>Predefined Dialogs</i> implement the typical standard dialogs that are frequently used
for selecting file names or issuing error messages.
<p>
The following predefined dialogs are available:
<ul>
<li><a href=#316>dlgDirectory()</a>
<li><a href=#317>dlgFileOpen()</a>
<li><a href=#317>dlgFileSave()</a>
<li><a href=#318>dlgMessageBox()</a>
</ul>
See <a href=#319>Dialog Objects</a> for information on how to
define your own complex user dialogs.


<a name=316>
<h1>dlgDirectory()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Displays a directory dialog.
<dt>
<b>Syntax</b>
<dd>
<tt>string dlgDirectory(string Title[, string Start])</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>dlgDirectory</tt> function returns the full pathname of the selected directory.<br>
If the user has canceled the dialog, the result will be an empty string.
</dl>
<b>See also</b> <a href=#317>dlgFileOpen</a>
<p>
The <tt>dlgDirectory</tt> function displays a directory dialog from which the user can
select a directory.
<p>
<tt>Title</tt> will be used as the dialog's title.
<p>
If <tt>Start</tt> is not empty, it will be used as the starting point for the <tt>dlgDirectory</tt>.
<h2>Example</h2>
<pre>
string dirName;
dirName = dlgDirectory("Select a directory", "");
</pre>


<a name=317>
<h1>dlgFileOpen(), dlgFileSave()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Displays a file dialog.
<dt>
<b>Syntax</b>
<dd>
<tt>string dlgFileOpen(string Title[, string Start[, string Filter]])</tt><br>
<tt>string dlgFileSave(string Title[, string Start[, string Filter]])</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>dlgFileOpen</tt> and <tt>dlgFileSave</tt> functions return the full pathname of the selected file.<br>
If the user has canceled the dialog, the result will be an empty string.
</dl>
<b>See also</b> <a href=#316>dlgDirectory</a>
<p>
The <tt>dlgFileOpen</tt> and <tt>dlgFileSave</tt> functions display a file dialog from which the user can
select a file.
<p>
<tt>Title</tt> will be used as the dialog's title.
<p>
If <tt>Start</tt> is not empty, it will be used as the starting point for the file dialog.
Otherwise the current directory will be used.
<p>
Only files matching <tt>Filter</tt> will be displayed. If <tt>Filter</tt> is empty, all files will
be displayed.
<p>
<tt>Filter</tt> can be either a simple wildcard (as in <tt>"*.brd"</tt>), a list of
wildcards (as in <tt>"*.bmp&nbsp;*.jpg"</tt>) or may even contain descriptive text, as in
<tt>"Bitmap&nbsp;files&nbsp;(*.bmp)"</tt>. If the "File type" combo box of the file dialog shall
contain several entries, they have to be separated by double semicolons, as in
<tt>"Bitmap&nbsp;files&nbsp;(*.bmp);;Other&nbsp;images&nbsp;(*.jpg&nbsp;*.png)"</tt>.
<h2>Example</h2>
<pre>
string fileName;
fileName = dlgFileOpen("Select a file", "", "*.brd");
</pre>


<a name=318>
<h1>dlgMessageBox()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Displays a message box.
<dt>
<b>Syntax</b>
<dd>
<tt>int dlgMessageBox(string Message[, <i>button_list</i>])</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>dlgMessageBox</tt> function returns the index of the button the user has selected.<br>
The first button in <tt>button_list</tt> has index <tt>0</tt>.
</dl>
<b>See also</b> <a href=#268>status()</a>
<p>
The <tt>dlgMessageBox</tt> function displays the given <tt>Message</tt> in a modal dialog and
waits until the user selects one of the buttons defined in <tt>button_list</tt>.
<p>
If <tt>Message</tt> contains any HTML tags, the characters '&lt;', '&gt;' and '&amp;'
must be given as "&amp;lt;", "&amp;gt;" and "&amp;amp;", respectively, if they shall
be displayed as such.
<p>
<tt>button_list</tt> is an optional list of comma separated strings, which defines the
set of buttons that will be displayed at the bottom of the message box.<br>
A maximum of three buttons can be defined.
If no <tt>button_list</tt> is given, it defaults to <tt>"OK"</tt>.
<p>
The first button in <tt>button_list</tt> will become the default button (which will be selected
if the user hits ENTER), and the last button in the list will become the "cancel button", which
is selected if the user hits ESCape or closes the message box. You can make a different
button the default button by starting its name with a <tt>'+'</tt>, and you can make
a different button the cancel button by starting its name with a <tt>'-'</tt>.
To start a button text with an actual <tt>'+'</tt> or <tt>'-'</tt> it has to be <a href=#350>escaped</a>.
<p>
If a button text contains an <tt>'&amp;'</tt>, the character following the ampersand
will become a hotkey, and when the user hits the corresponding key, that button will be selected.
To have an actual <tt>'&amp;'</tt> character in the text it has to be <a href=#350>escaped</a>.
<p>
The message box can be given an icon by setting the first character of <tt>Message</tt> to<br>
&nbsp;&nbsp;&nbsp;<tt>'<b>;</b>'</tt> - for an <i>Information</i><br>
&nbsp;&nbsp;&nbsp;<tt>'<b>!</b>'</tt> - for a <i>Warning</i><br>
&nbsp;&nbsp;&nbsp;<tt>'<b>:</b>'</tt> - for an <i>Error</i><br>
If, however, the <tt>Message</tt> shall begin with one of these characters, it has to be <a href=#350>escaped</a>.
<p>
<table><tr><td valign="top"><img src="platforms-mac.png"></td><td valign="middle">
On <b>Mac OS X</b> only the character <tt>'<b>:</b>'</tt> will actually result in
showing an icon. All others are ignored.
</td></tr></table>
<h2>Example</h2>
<pre>
if (dlgMessageBox("!Are you sure?", "&amp;Yes", "&amp;No") == 0) {
   // let's do it!
   }
</pre>


<a name=319>
<h1>Dialog Objects</h1>
A User Language Dialog is built from the following <i>Dialog Objects</i>:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#320>dlgCell</a>    </td><td width=20><td>a grid cell context</td></tr>
<tr><td><a href=#321>dlgCheckBox</a>      </td><td width=20><td>a checkbox</td></tr>
<tr><td><a href=#322>dlgComboBox</a>      </td><td width=20><td>a combo box selection field</td></tr>
<tr><td><a href=#323>dlgDialog</a>          </td><td width=20><td>the basic container of any dialog</td></tr>
<tr><td><a href=#324>dlgGridLayout</a>  </td><td width=20><td>a grid based layout context</td></tr>
<tr><td><a href=#325>dlgGroup</a>            </td><td width=20><td>a group field</td></tr>
<tr><td><a href=#326>dlgHBoxLayout</a>  </td><td width=20><td>a horizontal box layout context</td></tr>
<tr><td><a href=#327>dlgIntEdit</a>        </td><td width=20><td>an integer entry field</td></tr>
<tr><td><a href=#328>dlgLabel</a>            </td><td width=20><td>a text label</td></tr>
<tr><td><a href=#329>dlgListBox</a>        </td><td width=20><td>a list box</td></tr>
<tr><td><a href=#330>dlgListView</a>      </td><td width=20><td>a list view</td></tr>
<tr><td><a href=#331>dlgPushButton</a>  </td><td width=20><td>a push button</td></tr>
<tr><td><a href=#332>dlgRadioButton</a></td><td width=20><td>a radio button</td></tr>
<tr><td><a href=#333>dlgRealEdit</a>      </td><td width=20><td>a real entry field</td></tr>
<tr><td><a href=#334>dlgSpacing</a>        </td><td width=20><td>a layout spacing object</td></tr>
<tr><td><a href=#335>dlgSpinBox</a>        </td><td width=20><td>a spin box selection field</td></tr>
<tr><td><a href=#336>dlgStretch</a>        </td><td width=20><td>a layout stretch object</td></tr>
<tr><td><a href=#337>dlgStringEdit</a>  </td><td width=20><td>a string entry field</td></tr>
<tr><td><a href=#338>dlgTabPage</a>        </td><td width=20><td>a tab page</td></tr>
<tr><td><a href=#339>dlgTabWidget</a>    </td><td width=20><td>a tab page container</td></tr>
<tr><td><a href=#340>dlgTextEdit</a>      </td><td width=20><td>a text entry field</td></tr>
<tr><td><a href=#341>dlgTextView</a>      </td><td width=20><td>a text viewer field</td></tr>
<tr><td><a href=#342>dlgVBoxLayout</a>  </td><td width=20><td>a vertical box layout context</td></tr>
</table>
<p>


<a name=320>
<h1>dlgCell</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a cell location within a grid layout context.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgCell(int row, int column[, int row2, int column2]) <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#324>dlgGridLayout</a>,
<a href=#326>dlgHBoxLayout</a>,
<a href=#342>dlgVBoxLayout</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgCell</tt> statement defines the location of a cell within a
<a href=#324>grid layout context</a>.
<p>
The row and column indexes start at 0, so the upper left cell has the index&nbsp;(0,&nbsp;0).
<p>
With two parameters the dialog object defined by <tt>statement</tt> will be placed in
the single cell addresses by <tt>row</tt> and <tt>column</tt>.
With four parameters the dialog object will span over all cells from <tt>row</tt>/<tt>column</tt>
to <tt>row2</tt>/<tt>column2</tt>.
<p>
By default a <tt>dlgCell</tt> contains a <a href=#326>dlgHBoxLayout</a>,
so if the cell contains more than one dialog object, they will be placed next to
each other horizontally.
<h2>Example</h2>
<pre>
string Text;
dlgGridLayout {
  dlgCell(0, 0) dlgLabel("Cell 0,0");
  dlgCell(1, 2, 4, 7) dlgTextEdit(Text);
  }
</pre>


<a name=321>
<h1>dlgCheckBox</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a checkbox.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgCheckBox(string Text, int &amp;Checked) [ <i>statement</i> ]</tt>
</dl>
<b>See also</b> <a href=#332>dlgRadioButton</a>,
<a href=#325>dlgGroup</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgCheckBox</tt> statement defines a check box with the given <tt>Text</tt>.
<p>
If <tt>Text</tt> contains an <tt>'&amp;'</tt>, the character following the ampersand
will become a hotkey, and when the user hits <tt>Alt+hotkey</tt>, the checkbox will be toggled.
To have an actual <tt>'&amp;'</tt> character in the text it has to be <a href=#350>escaped</a>.
<p>
<tt>dlgCheckBox</tt> is mainly used within a <a href=#325>dlgGroup</a>,
but can also be used otherwise.<br>
All check boxes within the same dialog must have <b>different</b> <tt>Checked</tt> variables!
<p>
If the user checks a <tt>dlgCheckBox</tt>, the associated <tt>Checked</tt> variable is set
to <tt>1</tt>, otherwise it is set to <tt>0</tt>.
The initial value of <tt>Checked</tt> defines whether a checkbox is initially checked.
If <tt>Checked</tt> is not equal to <tt>0</tt>, the checkbox is initially checked.
<p>
The optional <tt>statement</tt> is executed every time the <tt>dlgCheckBox</tt> is toggled.
<h2>Example</h2>
<pre>
int mirror = 0;
int rotate = 1;
int flip   = 0;
dlgGroup("Orientation") {
  dlgCheckBox("&amp;Mirror", mirror);
  dlgCheckBox("&amp;Rotate", rotate);
  dlgCheckBox("&amp;Flip", flip);
  }
</pre>


<a name=322>
<h1>dlgComboBox</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a combo box selection field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgComboBox(string array[], int &amp;Selected) [ <i>statement</i> ]</tt>
</dl>
<b>See also</b> <a href=#329>dlgListBox</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgComboBox</tt> statement defines a combo box selection field with the contents
of the given <tt>array</tt>.
<p>
<tt>Selected</tt> reflects the index of the selected combo box entry. The first entry has index <tt>0</tt>.
<p>
Each element of <tt>array</tt> defines the contents of one entry in the combo box.
None of the strings in <tt>array</tt> may be empty (if there is an empty string,
all strings after and including that one will be dropped).
<p>
The optional <tt>statement</tt> is executed whenever the selection in the <tt>dlgComboBox</tt> changes.<br>
Before the <tt>statement</tt> is executed, all variables that have been used with dialog objects
are updated to their current values, and any changes made to these variables inside the
<tt>statement</tt> will be reflected in the dialog when the statement returns.
<p>
If the initial value of <tt>Selected</tt> is outside the range of the <tt>array</tt>
indexes, it is set to <tt>0</tt>.
<h2>Example</h2>
<pre>
string Colors[] = { "red", "green", "blue", "yellow" };
int Selected = 2; // initially selects "blue"
dlgComboBox(Colors, Selected) dlgMessageBox("You have selected " + Colors[Selected]);
</pre>


<a name=323>
<h1>dlgDialog</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Executes a User Language Dialog.
<dt>
<b>Syntax</b>
<dd>
<tt>int dlgDialog(string Title) <i>block</i> ;</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>dlgDialog</tt> function returns an integer value that can be given a user defined meaning
through a call to the <tt><a href=#345>dlgAccept()</a></tt> function.<br>
If the dialog is simply closed, the return value will be <tt>0</tt>.
</dl>
<b>See also</b> <a href=#324>dlgGridLayout</a>,
<a href=#326>dlgHBoxLayout</a>,
<a href=#342>dlgVBoxLayout</a>,
<a href=#345>dlgAccept</a>,
<a href=#347>dlgReset</a>,
<a href=#348>dlgReject</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgDialog</tt> function executes the dialog defined by
<tt><a href=#229>block</a></tt>.
This is the only dialog object that actually is a User Language builtin
function. Therefore it can be used anywhere where a function call is allowed.
<p>
The <tt>block</tt> normally contains only other <a href=#319>dialog objects</a>,
but it is also possible to use other User Language statements, for example to conditionally add
objects to the dialog (see the second example below).
<p>
By default a <tt>dlgDialog</tt> contains a <a href=#342>dlgVBoxLayout</a>,
so a simple dialog doesn't have to worry about the layout.
<p>
A <tt>dlgDialog</tt> should at some point contain a call to the <tt><a href=#345>dlgAccept()</a></tt>
function in order to allow the user to close the dialog and accept its contents.
<p>
If all you need is a simple message box or file dialog you might want to use one of the
<a href=#315>Predefined Dialogs</a> instead.
<h2>Examples</h2>
<pre>
int Result = dlgDialog("Hello") {
  dlgLabel("Hello world");
  dlgPushButton("+OK") dlgAccept();
  };
int haveButton = 1;
dlgDialog("Test") {
  dlgLabel("Start");
  if (haveButton)
     dlgPushButton("Here") dlgAccept();
  };
</pre>


<a name=324>
<h1>dlgGridLayout</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a grid layout context.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgGridLayout <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#320>dlgCell</a>,
<a href=#326>dlgHBoxLayout</a>,
<a href=#342>dlgVBoxLayout</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgGridLayout</tt> statement opens a grid layout context.
<p>
The only dialog object that can be used directly in <tt>statement</tt> is
<a href=#320>dlgCell</a>, which defines the location of a particular
dialog object within the grid layout.
<p>
The row and column indexes start at 0, so the upper left cell has the index&nbsp;(0,&nbsp;0).<br>
The number of rows and columns is automatically extended according to the location of
dialog objects that are defined within the grid layout context, so you don't have
to explicitly define the number of rows and columns.
<h2>Example</h2>
<pre>
dlgGridLayout {
  dlgCell(0, 0) dlgLabel("Row 0/Col 0");
  dlgCell(1, 0) dlgLabel("Row 1/Col 0");
  dlgCell(0, 1) dlgLabel("Row 0/Col 1");
  dlgCell(1, 1) dlgLabel("Row 1/Col 1");
  }
</pre>


<a name=325>
<h1>dlgGroup</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a group field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgGroup(string Title) <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#321>dlgCheckBox</a>,
<a href=#332>dlgRadioButton</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgGroup</tt> statement defines a group with the given <tt>Title</tt>.
<p>
By default a <tt>dlgGroup</tt> contains a <a href=#342>dlgVBoxLayout</a>,
so a simple group doesn't have to worry about the layout.
<p>
<tt>dlgGroup</tt> is mainly used to contain a set of <a href=#332>radio buttons</a>
or <a href=#321>check boxes</a>, but may as well contain any other objects in its
<tt>statement</tt>.<br>
Radio buttons within a <tt>dlgGroup</tt> are numbered starting with <tt>0</tt>.
<h2>Example</h2>
<pre>
int align = 1;
dlgGroup("Alignment") {
  dlgRadioButton("&amp;Top", align);
  dlgRadioButton("&amp;Center", align);
  dlgRadioButton("&amp;Bottom", align);
  }
</pre>


<a name=326>
<h1>dlgHBoxLayout</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a horizontal box layout context.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgHBoxLayout <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#324>dlgGridLayout</a>,
<a href=#342>dlgVBoxLayout</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgHBoxLayout</tt> statement opens a horizontal box layout context for the given
<tt>statement</tt>.
<h2>Example</h2>
<pre>
dlgHBoxLayout {
  dlgLabel("Box 1");
  dlgLabel("Box 2");
  dlgLabel("Box 3");
  }
</pre>


<a name=327>
<h1>dlgIntEdit</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines an integer entry field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgIntEdit(int &amp;Value, int Min, int Max)</tt>
</dl>
<b>See also</b> <a href=#333>dlgRealEdit</a>,
<a href=#337>dlgStringEdit</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgIntEdit</tt> statement defines an integer entry field with the given <tt>Value</tt>.
<p>
If <tt>Value</tt> is initially outside the range defined by <tt>Min</tt> and <tt>Max</tt>
it will be limited to these values.
<h2>Example</h2>
<pre>
int Value = 42;
dlgHBoxLayout {
  dlgLabel("Enter a &amp;Number between 0 and 99");
  dlgIntEdit(Value, 0, 99);
  }
</pre>


<a name=328>
<h1>dlgLabel</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a text label.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgLabel(string Text [, int Update])</tt>
</dl>
<b>See also</b> <a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>,
<a href=#346>dlgRedisplay()</a>
<p>
The <tt>dlgLabel</tt> statement defines a label with the given <tt>Text</tt>.
<p>
<tt>Text</tt> can be either a string literal, as in <tt>"Hello"</tt>, or a string variable.
<p>
If <tt>Text</tt> contains any HTML tags, the characters '&lt;', '&gt;' and '&amp;'
must be given as "&amp;lt;", "&amp;gt;" and "&amp;amp;", respectively, if they shall
be displayed as such.
<p>
External hyperlinks in the <tt>Text</tt> will be opened with the appropriate
application program.
<p>
If the <tt>Update</tt> parameter is not <tt>0</tt> and <tt>Text</tt> is a string variable,
its contents can be modified in the <tt>statement</tt> of, e.g., a <a href=#331>dlgPushButton</a>,
and the label will be automatically updated. This, of course, is only
useful if <tt>Text</tt> is a dedicated string variable (not, e.g., the loop variable of
a <tt>for</tt> statement).
<p>
If <tt>Text</tt> contains an <tt>'&amp;'</tt>, and the object following the label
can have the keyboard focus, the character following the ampersand
will become a hotkey, and when the user hits <tt>Alt+hotkey</tt>, the focus will go to the
object that was defined immediately following the <tt>dlgLabel</tt>.
To have an actual <tt>'&amp;'</tt> character in the text it has to be <a href=#350>escaped</a>.
<h2>Example</h2>
<pre>
string OS = "Windows";
dlgHBoxLayout {
  dlgLabel(OS, 1);
  dlgPushButton("&amp;Change OS") { OS = "Linux"; }
  }
</pre>


<a name=329>
<h1>dlgListBox</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a list box selection field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgListBox(string array[], int &amp;Selected) [ <i>statement</i> ]</tt>
</dl>
<b>See also</b> <a href=#322>dlgComboBox</a>,
<a href=#330>dlgListView</a>,
<a href=#349>dlgSelectionChanged</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgListBox</tt> statement defines a list box selection field with the contents
of the given <tt>array</tt>.
<p>
<tt>Selected</tt> reflects the index of the selected list box entry. The first entry has index <tt>0</tt>.
<p>
Each element of <tt>array</tt> defines the contents of one line in the list box.
None of the strings in <tt>array</tt> may be empty (if there is an empty string,
all strings after and including that one will be dropped).
<p>
The optional <tt>statement</tt> is executed whenever the user double clicks on an entry
of the <tt>dlgListBox</tt> (see <a href=#349>dlgSelectionChanged</a>
for information on how to have the <tt>statement</tt> called when only the selection in the list
changes).<br>
Before the <tt>statement</tt> is executed, all variables that have been used with dialog objects
are updated to their current values, and any changes made to these variables inside the
<tt>statement</tt> will be reflected in the dialog when the statement returns.
<p>
If the initial value of <tt>Selected</tt> is outside the range of the <tt>array</tt>
indexes, no entry will be selected.
<h2>Example</h2>
<pre>
string Colors[] = { "red", "green", "blue", "yellow" };
int Selected = 2; // initially selects "blue"
dlgListBox(Colors, Selected) dlgMessageBox("You have selected " + Colors[Selected]);
</pre>


<a name=330>
<h1>dlgListView</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a multi column list view selection field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgListView(string Headers, string array[], int &amp;Selected[, int &amp;Sort]) [ <i>statement</i> ]</tt>
</dl>
<b>See also</b> <a href=#329>dlgListBox</a>,
<a href=#349>dlgSelectionChanged</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgListView</tt> statement defines a multi column list view selection field with the contents
of the given <tt>array</tt>.
<p>
<tt>Headers</tt> is the tab separated list of column headers.
<p>
<tt>Selected</tt> reflects the index of the selected list view entry in the <tt>array</tt>
(the sequence in which the entries are actually displayed may be different, because the contents
of a <tt>dlgListView</tt> can be sorted by the various columns).
The first entry has index <tt>0</tt>.<br>
If no particular entry shall be initially selected, <tt>Selected</tt> should be
initialized to <tt>-1</tt>.
If it is set to <tt>-2</tt>, the first item according
to the current sort column is made current.
<p>
<tt>Sort</tt> defines which column should be used to sort the list view. The leftmost
column is numbered <tt>1</tt>. The sign of this parameter defines the direction in which
to sort (positive values sort in ascending order). If <tt>Sort</tt> is <tt>0</tt> or
outside the valid number of columns, no sorting will be done. The returned value of
<tt>Sort</tt> reflects the column and sort mode selected by the user by clicking
on the list column headers. By default <tt>dlgListView</tt> sorts by the first
column, in ascending order.
<p>
Each element of <tt>array</tt> defines the contents of one line in the list view,
and must contain tab separated values. If there are fewer values in an element of <tt>array</tt>
than there are entries in the <tt>Headers</tt> string the remaining fields will be empty.
If there are more values in an element of <tt>array</tt> than there are entries in the
<tt>Headers</tt> string the superfluous elements will be silently dropped.
None of the strings in <tt>array</tt> may be empty (if there is an empty string,
all strings after and including that one will be dropped).
<p>
A list entry that contains line feeds (<tt>'\n'</tt>) will be displayed in several
lines accordingly.
<p>
The optional <tt>statement</tt> is executed whenever the user double clicks on an entry
of the <tt>dlgListView</tt> (see <a href=#349>dlgSelectionChanged</a>
for information on how to have the <tt>statement</tt> called when only the selection in the list
changes).<br>
Before the <tt>statement</tt> is executed, all variables that have been used with dialog objects
are updated to their current values, and any changes made to these variables inside the
<tt>statement</tt> will be reflected in the dialog when the statement returns.
<p>
If the initial value of <tt>Selected</tt> is outside the range of the <tt>array</tt>
indexes, no entry will be selected.
<p>
If <tt>Headers</tt> is an empty string, the first element of the <tt>array</tt> is used
as the header string. Consequently the index of the first entry is then <tt>1</tt>.
<p>
The contents of a <tt>dlgListView</tt> can be sorted by any column by clicking on
that column's header. Columns can also be swapped by "click&amp;dragging" a column
header. Note that none of these changes will have any effect on the contents of the
<tt>array</tt>.
If the contents shall be sorted alphanumerically a <tt>numeric string[]</tt> array
can be used.
<h2>Example</h2>
<pre>
string Colors[] = { "red\tThe color RED", "green\tThe color GREEN", "blue\tThe color BLUE" };
int Selected = 0; // initially selects "red"
dlgListView("Name\tDescription", Colors, Selected) dlgMessageBox("You have selected " + Colors[Selected]);
</pre>


<a name=331>
<h1>dlgPushButton</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a push button.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgPushButton(string Text) <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#343>Layout Information</a>,
<a href=#344>Dialog Functions</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgPushButton</tt> statement defines a push button with the given <tt>Text</tt>.
<p>
If <tt>Text</tt> contains an <tt>'&amp;'</tt>, the character following the ampersand
will become a hotkey, and when the user hits <tt>Alt+hotkey</tt>, the button will be selected.
To have an actual <tt>'&amp;'</tt> character in the text it has to be <a href=#350>escaped</a>.
<p>
If <tt>Text</tt> starts with a <tt>'+'</tt> character, this button will become the default
button, which will be selected if the user hits ENTER.<br>
If <tt>Text</tt> starts with a <tt>'-'</tt> character, this button will become the cancel
button, which will be selected if the user closes the dialog.<br>
<b>CAUTION: Make sure that the <tt>statement</tt> of such a marked cancel button contains
a call to <a href=#348>dlgReject()</a>! Otherwise the user may be unable
to close the dialog at all!</b><br>
To have an actual <tt>'+'</tt> or <tt>'-'</tt> character as the first character of the text
it has to be <a href=#350>escaped</a>.
<p>
If the user selects a <tt>dlgPushButton</tt>, the given <tt>statement</tt> is executed.<br>
Before the <tt>statement</tt> is executed, all variables that have been used with dialog objects
are updated to their current values, and any changes made to these variables inside the
<tt>statement</tt> will be reflected in the dialog when the statement returns.
<h2>Example</h2>
<pre>
int defaultWidth = 10;
int defaultHeight = 20;
int width = 5;
int height = 7;
dlgPushButton("&amp;Reset defaults") {
  width = defaultWidth;
  height = defaultHeight;
  }
dlgPushButton("+&amp;Accept") dlgAccept();
dlgPushButton("-Cancel") { if (dlgMessageBox("Are you sure?", "Yes", "No") == 0) dlgReject(); }
</pre>


<a name=332>
<h1>dlgRadioButton</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a radio button.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgRadioButton(string Text, int &amp;Selected) [ <i>statement</i> ]</tt>
</dl>
<b>See also</b> <a href=#321>dlgCheckBox</a>,
<a href=#325>dlgGroup</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgRadioButton</tt> statement defines a radio button with the given <tt>Text</tt>.
<p>
If <tt>Text</tt> contains an <tt>'&amp;'</tt>, the character following the ampersand
will become a hotkey, and when the user hits <tt>Alt+hotkey</tt>, the button will be selected.
To have an actual <tt>'&amp;'</tt> character in the text it has to be <a href=#350>escaped</a>.
<p>
<tt>dlgRadioButton</tt> can only be used within a <a href=#325>dlgGroup</a>.<br>
All radio buttons within the same group must use the <b>same</b> <tt>Selected</tt> variable!
<p>
If the user selects a <tt>dlgRadioButton</tt>, the index of that button within the <tt>dlgGroup</tt>
is stored in the <tt>Selected</tt> variable.<br>
The initial value of <tt>Selected</tt> defines which radio button is initially selected.
If <tt>Selected</tt> is outside the valid range for this group, no radio button will be selected.
In order to get the correct radio button selection, <tt>Selected</tt> must be set <b>before</b>
the first <tt>dlgRadioButton</tt> is defined, and must not be modified between adding subsequent
radio buttons. Otherwise it is undefined which (if any) radio button will be selected.
<p>
The optional <tt>statement</tt> is executed every time the <tt>dlgRadioButton</tt> is selected.
<h2>Example</h2>
<pre>
int align = 1;
dlgGroup("Alignment") {
  dlgRadioButton("&amp;Top", align);
  dlgRadioButton("&amp;Center", align);
  dlgRadioButton("&amp;Bottom", align);
  }
</pre>


<a name=333>
<h1>dlgRealEdit</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a real entry field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgRealEdit(real &amp;Value, real Min, real Max)</tt>
</dl>
<b>See also</b> <a href=#327>dlgIntEdit</a>,
<a href=#337>dlgStringEdit</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgRealEdit</tt> statement defines a real entry field with the given <tt>Value</tt>.
<p>
If <tt>Value</tt> is initially outside the range defined by <tt>Min</tt> and <tt>Max</tt>
it will be limited to these values.
<h2>Example</h2>
<pre>
real Value = 1.4142;
dlgHBoxLayout {
  dlgLabel("Enter a &amp;Number between 0 and 99");
  dlgRealEdit(Value, 0.0, 99.0);
  }
</pre>


<a name=334>
<h1>dlgSpacing</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines additional space in a box layout context.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgSpacing(int Size)</tt>
</dl>
<b>See also</b> <a href=#326>dlgHBoxLayout</a>,
<a href=#342>dlgVBoxLayout</a>,
<a href=#336>dlgStretch</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgSpacing</tt> statement defines additional space in a vertical or horizontal box layout context.
<p>
<tt>Size</tt> defines the number of pixels of the additional space.
<h2>Example</h2>
<pre>
dlgVBoxLayout {
  dlgLabel("Label 1");
  dlgSpacing(40);
  dlgLabel("Label 2");
  }
</pre>


<a name=335>
<h1>dlgSpinBox</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a spin box selection field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgSpinBox(int &amp;Value, int Min, int Max)</tt>
</dl>
<b>See also</b> <a href=#327>dlgIntEdit</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgSpinBox</tt> statement defines a spin box entry field with the given <tt>Value</tt>.
<p>
If <tt>Value</tt> is initially outside the range defined by <tt>Min</tt> and <tt>Max</tt>
it will be limited to these values.
<h2>Example</h2>
<pre>
int Value = 42;
dlgHBoxLayout {
  dlgLabel("&amp;Select value");
  dlgSpinBox(Value, 0, 99);
  }
</pre>


<a name=336>
<h1>dlgStretch</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines an empty stretchable space in a box layout context.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgStretch(int Factor)</tt>
</dl>
<b>See also</b> <a href=#326>dlgHBoxLayout</a>,
<a href=#342>dlgVBoxLayout</a>,
<a href=#334>dlgSpacing</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgStretch</tt> statement defines an empty stretchable space in a vertical or horizontal box layout context.
<p>
<tt>Factor</tt> defines the stretch factor of the space.
<h2>Example</h2>
<pre>
dlgHBoxLayout {
  dlgStretch(1);
  dlgPushButton("+OK")    { dlgAccept(); };
  dlgPushButton("Cancel") { dlgReject(); };
  }
</pre>


<a name=337>
<h1>dlgStringEdit</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a string entry field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgStringEdit(string &amp;Text)</tt>
</dl>
<b>See also</b> <a href=#333>dlgRealEdit</a>,
<a href=#327>dlgIntEdit</a>,
<a href=#340>dlgTextEdit</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgStringEdit</tt> statement defines a text entry field with the given <tt>Text</tt>.
<h2>Example</h2>
<pre>
string Name = "Linus";
dlgHBoxLayout {
  dlgLabel("Enter &amp;Name");
  dlgStringEdit(Name);
  }
</pre>


<a name=338>
<h1>dlgTabPage</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a tab page.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgTabPage(string Title) <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#339>dlgTabWidget</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgTabPage</tt> statement defines a tab page with the given <tt>Title</tt> containing
the given <tt>statement</tt>.
<p>
If <tt>Title</tt> contains an <tt>'&amp;'</tt>, the character following the ampersand
will become a hotkey, and when the user hits <tt>Alt+hotkey</tt>, this tab page will be opened.
To have an actual <tt>'&amp;'</tt> character in the text it has to be <a href=#350>escaped</a>.
<p>
Tab pages can only be used within a <a href=#339>dlgTabWidget</a>.
<p>
By default a <tt>dlgTabPage</tt> contains a <a href=#342>dlgVBoxLayout</a>,
so a simple tab page doesn't have to worry about the layout.
<h2>Example</h2>
<pre>
dlgTabWidget {
  dlgTabPage("Tab &amp;1") {
    dlgLabel("This is page 1");
    }
  dlgTabPage("Tab &amp;2") {
    dlgLabel("This is page 2");
    }
  }
</pre>


<a name=339>
<h1>dlgTabWidget</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a container for tab pages.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgTabWidget <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#338>dlgTabPage</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgTabWidget</tt> statement defines a container for a set of tab pages.
<p>
<tt>statement</tt> must be a sequence of one or more <a href=#338>dlgTabPage</a> objects.
There must be no other dialog objects in this sequence.
<h2>Example</h2>
<pre>
dlgTabWidget {
  dlgTabPage("Tab &amp;1") {
    dlgLabel("This is page 1");
    }
  dlgTabPage("Tab &amp;2") {
    dlgLabel("This is page 2");
    }
  }
</pre>


<a name=340>
<h1>dlgTextEdit</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a multiline text entry field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgTextEdit(string &amp;Text)</tt>
</dl>
<b>See also</b> <a href=#337>dlgStringEdit</a>,
<a href=#341>dlgTextView</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgTextEdit</tt> statement defines a multiline text entry field with the given <tt>Text</tt>.
<p>
The lines in the <tt>Text</tt> have to be delimited by a newline character (<tt>'\n'</tt>).
Any whitespace characters at the end of the lines contained in <tt>Text</tt> will be
removed, and upon return there will be no whitespace characters at the end of the lines.
Empty lines at the end of the text will be removed entirely.
<h2>Example</h2>
<pre>
string Text = "This is some text.\nLine 2\nLine 3";
dlgVBoxLayout {
  dlgLabel("&amp;Edit the text");
  dlgTextEdit(Text);
  }
</pre>


<a name=341>
<h1>dlgTextView</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Defines a multiline text viewer field.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgTextView(string Text)</tt><br>
<tt>dlgTextView(string Text, string &amp;Link) <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#340>dlgTextEdit</a>,
<a href=#328>dlgLabel</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgTextView</tt> statement defines a multiline text viewer field with the given <tt>Text</tt>.
<p>
The <tt>Text</tt> may contain <a href=#352>HTML</a> tags.
<p>
External hyperlinks in the <tt>Text</tt> will be opened with the appropriate
application program.
<p>
If <tt>Link</tt> is given and the <tt>Text</tt> contains hyperlinks, <tt>statement</tt>
will be executed every time the user clicks on a hyperlink, with the value of <tt>Link</tt>
set to whatever the <tt>&lt;a href=...&gt;</tt> tag defines as the value of <i>href</i>.
If, after the execution of <tt>statement</tt>, the <tt>Link</tt> variable is not empty,
the default handling of hyperlinks will take place. This is also the case if <tt>Link</tt>
contains some text before dlgTextView is opened, which allows for an initial
scrolling to a given position.
If a <tt>Link</tt> is given, external hyperlinks will not be opened.
<h2>Example</h2>
<pre>
string Text = "This is some text.\nLine 2\nLine 3";
dlgVBoxLayout {
  dlgLabel("&amp;View the text");
  dlgTextView(Text);
  }
</pre>


<a name=342>
<h1>dlgVBoxLayout</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Opens a vertical box layout context.
<dt>
<b>Syntax</b>
<dd>
<tt>dlgVBoxLayout <i>statement</i></tt>
</dl>
<b>See also</b> <a href=#324>dlgGridLayout</a>,
<a href=#326>dlgHBoxLayout</a>,
<a href=#343>Layout Information</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgVBoxLayout</tt> statement opens a vertical box layout context for the given
<tt>statement</tt>.
<p>
By default a <a href=#323>dlgDialog</a> contains a <tt>dlgVBoxLayout</tt>,
so a simple dialog doesn't have to worry about the layout.
<h2>Example</h2>
<pre>
dlgVBoxLayout {
  dlgLabel("Box 1");
  dlgLabel("Box 2");
  dlgLabel("Box 3");
  }
</pre>


<a name=343>
<h1>Layout Information</h1>
All objects within a User Language Dialog a placed inside a <i>layout context</i>.
<p>
Layout contexts can be either <a href=#324>grid</a>, <a href=#326>horizontal</a>
or <a href=#342>vertical</a>.
<h2>Grid Layout Context</h2>
Objects in a grid layout context must specify the grid coordinates of the cell or cells into
which they shall be placed. To place a text label at row 5, column 2, you would write
<pre>
dlgGridLayout {
  dlgCell(5, 2) dlgLabel("Text");
  }
</pre>
If the object shall span over more than one cell you need to specify the coordinates of the
starting cell and the ending cell. To place a group that extends from row 1, column 2 up to row 3,
column 5, you would write
<pre>
dlgGridLayout {
  dlgCell(1, 2, 3, 5) dlgGroup("Title") {
    //...
    }
  }
</pre>
<h2>Horizontal Layout Context</h2>
Objects in a horizontal layout context are placed left to right.
<p>
The special objects <a href=#336>dlgStretch</a> and <a href=#334>dlgSpacing</a>
can be used to further refine the distribution of the available space.
<p>
To define two buttons that are pushed all the way to the right edge of the dialog,
you would write
<pre>
dlgHBoxLayout {
  dlgStretch(1);
  dlgPushButton("+OK")    dlgAccept();
  dlgPushButton("Cancel") dlgReject();
  }
</pre>
<h2>Vertical Layout Context</h2>
Objects in a vertical layout context follow the same rules as those in a horizontal
layout context, except that they are placed top to bottom.
<h2>Mixing Layout Contexts</h2>
Vertical, horizontal and grid layout contexts can be mixed to create the desired layout
structure of a dialog.
See the <a href=#351>Complete Example</a> for a demonstration of this.


<a name=344>
<h1>Dialog Functions</h1>
The following functions can be used with User Language Dialogs:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><a href=#345>dlgAccept()</a>  </td><td width=20><td>closes the dialog and accepts its contents</td></tr>
<tr><td><a href=#346>dlgRedisplay()</a>  </td><td width=20><td>immediately redisplays the dialog after changes to any values</td></tr>
<tr><td><a href=#347>dlgReset()</a>  </td><td width=20><td>resets all dialog objects to their initial values</td></tr>
<tr><td><a href=#348>dlgReject()</a>  </td><td width=20><td>closes the dialog and rejects its contents</td></tr>
<tr><td><a href=#349>dlgSelectionChanged()</a>  </td><td width=20><td>tells whether the current selection in a dlgListView or dlgListBox has changed</td></tr>
</table>


<a name=345>
<h1>dlgAccept()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Closes the dialog and accepts its contents.
<dt>
<b>Syntax</b>
<dd>
<tt>void dlgAccept([ <i>int Result</i> ]);</tt>
</dl>
<b>See also</b> <a href=#348>dlgReject</a>,
<a href=#323>dlgDialog</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgAccept</tt> function causes the <a href=#323>dlgDialog</a> to be closed
and return after the current statement sequence has been completed.
<p>
Any changes the user has made to the dialog values will be accepted and are copied into
the variables that have been given when the <a href=#319>dialog objects</a>
were defined.
<p>
The optional <tt>Result</tt> is the value that will be returned by the dialog.
Typically this should be a positive integer value.
If no value is given, it defaults to <tt>1</tt>.
<p>
Note that <tt>dlgAccept()</tt> does return to the normal program execution,
so in a sequence like
<pre>
dlgPushButton("OK") {
  dlgAccept();
  dlgMessageBox("Accepting!");
  }
</pre>
the statement after <tt>dlgAccept()</tt> will still be executed!
<h2>Example</h2>
<pre>
int Result = dlgDialog("Test") {
               dlgPushButton("+OK")    dlgAccept(42);
               dlgPushButton("Cancel") dlgReject();
               };
</pre>


<a name=346>
<h1>dlgRedisplay()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Redisplays the dialog after changing values.
<dt>
<b>Syntax</b>
<dd>
<tt>void dlgRedisplay(void);</tt>
</dl>
<b>See also</b> <a href=#347>dlgReset</a>,
<a href=#323>dlgDialog</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgRedisplay</tt> function can be called to immediately refresh the
<a href=#323>dlgDialog</a> after changes have been made to the variables
used when defining the <a href=#319>dialog objects</a>.
<p>
You only need to call <tt>dlgRedisplay()</tt> if you want the dialog to be refreshed
while still executing program code. In the example below the status is changed
to "Running..." and <tt>dlgRedisplay()</tt> has to be called to make this change
take effect before the "program action" is performed. After the final status
change to "Finished." there is no need to call <tt>dlgRedisplay()</tt>, since
all dialog objects are automatically updated after leaving the statement.
<h2>Example</h2>
<pre>
string Status = "Idle";
int Result = dlgDialog("Test") {
               dlgLabel(Status, 1); // note the '1' to tell the label to be updated!
               dlgPushButton("+OK")    dlgAccept(42);
               dlgPushButton("Cancel") dlgReject();
               dlgPushButton("Run") {
                 Status = "Running...";
                 dlgRedisplay();
                 // some program action here...
                 Status = "Finished.";
                 }
               };
</pre>


<a name=347>
<h1>dlgReset()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Resets all dialog objects to their initial values.
<dt>
<b>Syntax</b>
<dd>
<tt>void dlgReset(void);</tt>
</dl>
<b>See also</b> <a href=#348>dlgReject</a>,
<a href=#323>dlgDialog</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgReset</tt> function copies the initial values back into all
<a href=#319>dialog objects</a> of the current
<a href=#323>dlgDialog</a>.
<p>
Any changes the user has made to the dialog values will be discarded.
<p>
Calling <a href=#348><tt>dlgReject()</tt></a> implies a call
to <tt>dlgReset()</tt>.
<h2>Example</h2>
<pre>
int Number = 1;
int Result = dlgDialog("Test") {
               dlgIntEdit(Number);
               dlgPushButton("+OK")    dlgAccept(42);
               dlgPushButton("Cancel") dlgReject();
               dlgPushButton("Reset")  dlgReset();
               };
</pre>


<a name=348>
<h1>dlgReject()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Closes the dialog and rejects its contents.
<dt>
<b>Syntax</b>
<dd>
<tt>void dlgReject([ <i>int Result</i> ]);</tt>
</dl>
<b>See also</b> <a href=#345>dlgAccept</a>,
<a href=#347>dlgReset</a>,
<a href=#323>dlgDialog</a>,
<a href=#351>A Complete Example</a>
<p>
The <tt>dlgReject</tt> function causes the <a href=#323>dlgDialog</a> to be closed
and return after the current statement sequence has been completed.
<p>
Any changes the user has made to the dialog values will be discarded.
The variables that have been given when the <a href=#319>dialog objects</a>
were defined will be reset to their original values when the dialog returns.
<p>
The optional <tt>Result</tt> is the value that will be returned by the dialog.
Typically this should be <tt>0</tt> or a negative integer value.
If no value is given, it defaults to <tt>0</tt>.
<p>
Note that <tt>dlgReject()</tt> does return to the normal program execution,
so in a sequence like
<pre>
dlgPushButton("Cancel") {
  dlgReject();
  dlgMessageBox("Rejecting!");
  }
</pre>
the statement after <tt>dlgReject()</tt> will still be executed!
<p>
Calling <tt>dlgReject()</tt> implies a call to <a href=#347><tt>dlgReset()</tt></a>.
<h2>Example</h2>
<pre>
int Result = dlgDialog("Test") {
               dlgPushButton("+OK")    dlgAccept(42);
               dlgPushButton("Cancel") dlgReject();
               };
</pre>


<a name=349>
<h1>dlgSelectionChanged()</h1>
<dl>
<dt>
<b>Function</b>
<dd>
Tells whether the current selection in a dlgListView or dlgListBox has changed.
<dt>
<b>Syntax</b>
<dd>
<tt>int dlgSelectionChanged(void);</tt>
<dt>
<b>Returns</b>
<dd>
The <tt>dlgSelectionChanged</tt> function returns a nonzero value if only the
selection in the list has changed.
</dl>
<b>See also</b> <a href=#330>dlgListView</a>,
<a href=#329>dlgListBox</a>
<p>
The <tt>dlgSelectionChanged</tt> function can be used in a list context
to determine whether the statement of the <tt>dlgListView</tt> or <tt>dlgListBox</tt> was
called because the user double clicked on an item, or whether only the
current selection in the list has changed.
<p>
If the statement of a <tt>dlgListView</tt> or <tt>dlgListBox</tt> doesn't contain any
call to <tt>dlgSelectionChanged</tt>, that statement is only executed when the user
double clicks on an item in the list. However, if a ULP needs to react on changes
to the current selection in the list, it can call <tt>dlgSelectionChanged</tt> within
the list's statement. This causes the statement to also be called if the current
selection in the list changes.
<p>
If a list item is initially selected when the dialog is opened and the list's statement
contains a call to <tt>dlgSelectionChanged</tt>, the statement is executed with
<tt>dlgSelectionChanged</tt> returning true in order to indicate the initial change
from "no selection" to an actual selection. Any later programmatical changes to the strings
or the selection of the list will not trigger an automatic execution of the list's
statement. This is important to remember in case the current list item controls another
dialog object, for instance a <tt>dlgTextView</tt> that shows an extended representation of
the currently selected item.
<h2>Example</h2>
<pre>
string Colors[] = { "red\tThe color RED", "green\tThe color GREEN", "blue\tThe color BLUE" };
int Selected = 0; // initially selects "red"
string MyColor;
dlgLabel(MyColor, 1);
dlgListView("Name\tDescription", Colors, Selected) {
  if (dlgSelectionChanged())
     MyColor = Colors[Selected];
  else
     dlgMessageBox("You have chosen " + Colors[Selected]);
  }
</pre>


<a name=350>
<h1>Escape Character</h1>
Some characters have special meanings in button
or label texts, so they need to be <i>escaped</i> if they shall appear literally.
<p>
To do this you need to prepend the character with a <i>backslash</i>, as in
<pre>
dlgLabel("Miller \\&amp; Co.");
</pre>
This will result in "Miller &amp; Co." displayed in the dialog.
<p>
Note that there are actually <b>two</b> backslash characters here, since this line
will first go through the User Language parser, which will strip the first backslash.


<a name=351>
<h1>A Complete Example</h1>
Here's a complete example of a User Language Dialog.
<pre>
int hor = 1;
int ver = 1;
string fileName;
int Result = dlgDialog("Enter Parameters") {
  dlgHBoxLayout {
    dlgStretch(1);
    dlgLabel("This is a simple dialog");
    dlgStretch(1);
    }
  dlgHBoxLayout {
    dlgGroup("Horizontal") {
      dlgRadioButton("&amp;Top", hor);
      dlgRadioButton("&amp;Center", hor);
      dlgRadioButton("&amp;Bottom", hor);
      }
    dlgGroup("Vertical") {
      dlgRadioButton("&amp;Left", ver);
      dlgRadioButton("C&amp;enter", ver);
      dlgRadioButton("&amp;Right", ver);
      }
    }
  dlgHBoxLayout {
    dlgLabel("File &amp;name:");
    dlgStringEdit(fileName);
    dlgPushButton("Bro&amp;wse") {
      fileName = dlgFileOpen("Select a file", fileName);
      }
    }
  dlgGridLayout {
    dlgCell(0, 0) dlgLabel("Row 0/Col 0");
    dlgCell(1, 0) dlgLabel("Row 1/Col 0");
    dlgCell(0, 1) dlgLabel("Row 0/Col 1");
    dlgCell(1, 1) dlgLabel("Row 1/Col 1");
    }
  dlgSpacing(10);
  dlgHBoxLayout {
    dlgStretch(1);
    dlgPushButton("+OK")    dlgAccept();
    dlgPushButton("Cancel") dlgReject();
    }
  };
</pre>


<a name=352>
<h1>Supported HTML tags</h1>
EAGLE supports a subset of the tags used to format HTML pages.
This can be used to format the text of several <a href=#314>User Language Dialog</a> objects,
in the <tt><a href=#147>#usage</a></tt> directive or in the <a href=#44>description</a>
of library objects.
<p>
Text is considered to be HTML if the first line contains a tag.
If this is not the case, and you want the text to be formatted, you need to
enclose the entire text in the <tt>&lt;html&gt;...&lt;/html&gt;</tt> tag.
<p>
The following table lists all supported HTML tags and their available attributes:
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b>Tag</b></td><td width=20><td><b>Description</b></td></tr>
<tr><td>&lt;html&gt;...&lt;/html&gt;</td><td width=20><td>An HTML document. It understands the following attributes
<ul>
<li><tt>bgcolor</tt> - The background color, for example <tt>bgcolor="yellow"</tt> or <tt>bgcolor="#0000FF"</tt>.
<li><tt>background</tt> - The background pixmap, for example <tt>background="granit.xpm"</tt>.
<li><tt>text</tt> - The default text color, for example <tt>text="red"</tt>.
<li><tt>link</tt> - The link color, for example <tt>link="green"</tt>.
</ul>
</td></tr>
<tr><td>&lt;h1&gt;...&lt;/h1&gt;</td><td width=20><td>A top-level heading.</td></tr>
<tr><td>&lt;h2&gt;...&lt;/h2&gt;</td><td width=20><td>A sub-level heading.</td></tr>
<tr><td>&lt;h3&gt;...&lt;/h3&gt;</td><td width=20><td>A sub-sub-level heading.</td></tr>
<tr><td>&lt;p&gt;...&lt;/p&gt;</td><td width=20><td>A left-aligned paragraph. Adjust the alignment with the <tt>align</tt> attribute. Possible values are <tt>left</tt>, <tt>right</tt> and <tt>center</tt>.</td></tr>
<tr><td>&lt;center&gt;...&lt;/center&gt;</td><td width=20><td>A centered paragraph.</td></tr>
<tr><td>&lt;blockquote&gt;...&lt;/blockquote&gt;</td><td width=20><td>An indented paragraph, useful for quotes.</td></tr>
<tr><td>&lt;ul&gt;...&lt;/ul&gt;</td><td width=20><td>An un-ordered list. You can also pass a type argument to define the bullet style. The default is <tt>type=disc</tt>,  other types are <tt>circle</tt> and <tt>square</tt>.</td></tr>
<tr><td>&lt;ol&gt;...&lt;/ol&gt;</td><td width=20><td>An ordered list. You can also pass a type argument to define the enumeration label style. The default is <tt>type="1"</tt>, other types are <tt>"a"</tt> and <tt>"A"</tt>.</td></tr>
<tr><td>&lt;li&gt;...&lt;/li&gt;</td><td width=20><td>A list item. This tag can only be used within the context of <tt>ol</tt> or <tt>ul</tt>.</td></tr>
<tr><td>&lt;pre&gt;...&lt;/pre&gt;</td><td width=20><td>For larger chunks of code. Whitespaces in the contents are preserved. For small bits of code, use the inline-style <tt>code</tt>.</td></tr>
<tr><td>&lt;a&gt;...&lt;/a&gt;</td><td width=20><td>An anchor or link. It understands the following attributes:
<ul>
<li><tt>href</tt> - The reference target as in <tt>&lt;a href="target.html"&gt;...&lt;/a&gt;</tt>. You can also specify an additional anchor within the specified target document, for example <tt>&lt;a href="target.html#123"&gt;...&lt;/a&gt;</tt>.
<li><tt>name</tt> - The anchor name, as in <tt>&lt;a name="123"&gt;...&lt;/a&gt;</tt>.
</ul>
</td></tr>
<tr><td>&lt;em&gt;...&lt;/em&gt;</td><td width=20><td>Emphasized (same as <tt>&lt;i&gt;...&lt;/i&gt;</tt>).</td></tr>
<tr><td>&lt;strong&gt;...&lt;/strong&gt;</td><td width=20><td>Strong (same as <tt>&lt;b&gt;...&lt;/b&gt;</tt>).</td></tr>
<tr><td>&lt;i&gt;...&lt;/i&gt;</td><td width=20><td>Italic font style.</td></tr>
<tr><td>&lt;b&gt;...&lt;/b&gt;</td><td width=20><td>Bold font style.</td></tr>
<tr><td>&lt;u&gt;...&lt;/u&gt;</td><td width=20><td>Underlined font style.</td></tr>
<tr><td>&lt;big&gt;...&lt;/big&gt;</td><td width=20><td>A larger font size.</td></tr>
<tr><td>&lt;small&gt;...&lt;/small&gt;</td><td width=20><td>A smaller font size.</td></tr>
<tr><td>&lt;code&gt;...&lt;/code&gt;</td><td width=20><td>Indicates Code. (same as <tt>&lt;tt&gt;...&lt;/tt&gt;</tt>. For larger chunks of code, use the block-tag <tt>pre</tt>.</td></tr>
<tr><td>&lt;tt&gt;...&lt;/tt&gt;</td><td width=20><td>Typewriter font style.</td></tr>
<tr><td>&lt;font&gt;...&lt;/font&gt;</td><td width=20><td>Customizes the font size, family and text color. The tag understands the following attributes:
<ul>
<li><tt>color</tt> - The text color, for example <tt>color="red"</tt> or <tt>color="#FF0000"</tt>.
<li><tt>size</tt> - The logical size of the font. Logical sizes 1 to 7 are supported. The value may either be absolute, for example <tt>size=3,</tt> or relative like <tt>size=-2</tt>. In the latter case, the sizes are simply added.
<li><tt>face</tt> - The family of the font, for example <tt>face=times</tt>.
</ul>
</td></tr>
<tr><td>&lt;img...&gt;</td><td width=20><td>An image. This tag understands the following attributes:
<ul>
<li><tt>src</tt> - The image name, for example <tt>&lt;img src="image.png"&gt;</tt>.<br>
The URL of the image may be external, as in <tt>&lt;img src="http://www.cadsoft.de/cslogo.gif"&gt;</tt>.
<li><tt>width</tt> - The width of the image. If the image does not fit to the specified size, it will be scaled automatically.
<li><tt>height</tt> - The height of the image.
<li><tt>align</tt> - Determines where the image is placed. Per default, an image is placed inline, just like a normal character. Specify <tt>left</tt> or <tt>right</tt> to place the image at the respective side.
</ul>
</td></tr>
<tr><td>&lt;hr&gt;</td><td width=20><td>A horizonal line.</td></tr>
<tr><td>&lt;br&gt;</td><td width=20><td>A line break.</td></tr>
<tr><td>&lt;nobr&gt;...&lt;/nobr&gt;</td><td width=20><td>No break. Prevents word wrap.</td></tr>
<tr><td>&lt;table&gt;...&lt;/table&gt;</td><td width=20><td>A table definition.
The default table is frameless. Specify the boolean attribute
<tt>border</tt> in order to get a frame. Other attributes are:
<ul>
<li><tt>bgcolor</tt> - The background color.
<li> <tt>width</tt> - The table width. This is either absolute in pixels or relative in percent of the column width, for example <tt>width=80%</tt>.
<li> <tt>border</tt> - The width of the table border. The default is 0 (= no border).
<li> <tt>cellspacing</tt> - Additional space around the table cells. The default is 2.
<li> <tt>cellpadding</tt> - Additional space around the contents of table cells. Default is 1.
</ul>
</td></tr>
<tr><td>&lt;tr&gt;...&lt;/tr&gt;</td><td width=20><td>A table row. Can only be used within <tt>table</tt>. Understands the attribute
<ul>
<li><tt>bgcolor</tt> - The background color.
</ul>
</td></tr>
<tr><td>&lt;td&gt;...&lt;/td&gt;</td><td width=20><td>A table data cell. Can only be used within <tt>tr.</tt> Understands the attributes
<ul>
<li><tt>bgcolor</tt> - The background color.
<li> <tt>width</tt> - The cell width. This is either absolute in pixels or relative in percent of the entire table width, for example <tt>width=50%</tt>.
<li> <tt>colspan</tt> - Defines how many columns this cell spans. The default is 1.
<li> <tt>rowspan</tt> - Defines how many rows this cell spans. The default is 1.
<li> <tt>align</tt> - Alignment, possible values are <tt>left</tt>, <tt>right</tt> and <tt>center</tt>. The default is left-aligned.
</ul>
</td></tr>
<tr><td>&lt;th&gt;...&lt;/th&gt;</td><td width=20><td>A table header cell. Like <tt>td</tt> but defaults to center-alignment and a bold font.</td></tr>
<tr><td>&lt;author&gt;...&lt;/author&gt;</td><td width=20><td>Marks the author of this text.</td></tr>
<tr><td>&lt;dl&gt;...&lt;/dl&gt;</td><td width=20><td>A definition list.</td></tr>
<tr><td>&lt;dt&gt;...&lt;/dt&gt;</td><td width=20><td>A definition tag. Can only be used within <tt>dl</tt>.</td></tr>
<tr><td>&lt;dd&gt;...&lt;/dd&gt;</td><td width=20><td>Definition data. Can only be used within <tt>dl</tt>.</td></tr>
</table>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td><b>Tag</b></td><td width=20><td><b>Meaning</b></td></tr>
<tr><td>&amp;lt;</td><td width=20><td>&lt;</td></tr>
<tr><td>&amp;gt;</td><td width=20><td>&gt;</td></tr>
<tr><td>&amp;amp;</td><td width=20><td>&amp;</td></tr>
<tr><td>&amp;nbsp;</td><td width=20><td>non-breaking space</td></tr>
<tr><td>&amp;auml;</td><td width=20><td>&auml;</td></tr>
<tr><td>&amp;ouml;</td><td width=20><td>&ouml;</td></tr>
<tr><td>&amp;uuml;</td><td width=20><td>&uuml;</td></tr>
<tr><td>&amp;Auml;</td><td width=20><td>&Auml;</td></tr>
<tr><td>&amp;Ouml;</td><td width=20><td>&Ouml;</td></tr>
<tr><td>&amp;Uuml;</td><td width=20><td>&Uuml;</td></tr>
<tr><td>&amp;szlig;</td><td width=20><td>&szlig;</td></tr>
<tr><td>&amp;copy;</td><td width=20><td>&copy;</td></tr>
<tr><td>&amp;deg;</td><td width=20><td>&deg;</td></tr>
<tr><td>&amp;micro;</td><td width=20><td>&micro;</td></tr>
<tr><td>&amp;plusmn;</td><td width=20><td>&plusmn;</td></tr>
</table>


<a name=353>
<h1>Automatic Backup</h1>
<h2>Maximum backup level</h2>
The WRITE command creates backup copies of the saved files.
These backups have the same name as the original file, with a
modified extension that follows the pattern
<pre>
.x#n
</pre>
In this pattern <tt>'x'</tt> is replaced by the character
<p>
<tt>'b'</tt> for board files<br>
<tt>'s'</tt> for schematic files<br>
<tt>'l'</tt> for library files
<p>
<tt>'n'</tt> stands for a single digit number in
the range 1..9. Higher numbers indicate older files.
<p>
The fixed '#' character makes it easy to delete all backup files
from the operating system, using <b><tt>*.?#?</tt></b> as a wildcard.
<p>
Note that backup files with the same number 'n' do not necessarily
represent consistent combinations of board and schematic files!
<p>
The maximum number of backup copies can be set in the
<a href=#15>backup dialog</a>.
<h2>Auto backup interval</h2>
If a drawing has been modified a safety backup copy will be automatically
created after at most the given <i>Auto backup interval</i>.
<p>
This safety backup file will have a name that follows the pattern
<pre>
.x##
</pre>
In this pattern <tt>'x'</tt> is replaced by the character
<p>
<tt>'b'</tt> for board files<br>
<tt>'s'</tt> for schematic files<br>
<tt>'l'</tt> for library files
<p>
The safety backup file will be deleted after a successful regular save
operation. If the drawing has not been saved with the WRITE command
(e.g. due to a power failure) this file can be renamed and loaded as a
normal board, schematic or library file, repectively.
<p>
The auto backup interval can be set in the <a href=#15>backup dialog</a>.


<a name=354>
<h1>Forward&amp;Back Annotation</h1>
A schematic and board file are logically interconnected through automatic
Forward&amp;Back Annotation. Normally there are no special things to be
considered about Forward&amp;Back Annotation. This section, however, lists all of the
details about what exactly happens during f/b activities:
<ul>
<li>When adding a new part to a schematic, the part's package is added
to the board at the lower left corner of the drawing.
If the part contains power pins (pins with Direction "Pwr") the related
pads will be automatically connected to their power signals.
<li>When deleting a part from a schematic drawing, the part's package is
deleted from the board. Any wires that were connected to that package
are left unchanged. This may require additional vias to be set in
order to keep signals connected. These vias will <b>not</b> be set automatically!
The ratsnest will be re-calculated for those signals that were connected
to the removed package.
<li>When deleting a part from a board drawing, all of the gates contained
in that part will be deleted from the schematic. Note that this may
affect more than one sheet, if the gates were placed on different
sheets!
<li>After an operation that removes a pad from a signal that has a supply
layer, the Thermal/Annulus display may be incorrect. In such a case
a window refresh will show the correct Thermal/Annulus symbols.
The same applies to Undo/Redo operations that involve pads connected
to supply layers.
<li>A PinSwap or GateSwap operation in the schematic will make all the
necessary changes to the wires of the board. However, after this
operation the wires may overlap or violate minimum distance rules.
Therefore the user should take a look at these wires and modify them
with Move, Split, Change Layer etc.
<li>To make absolutely sure that a board and schematic belong to each
other (and are therefore connected via Forward&amp;Back Annotation)
the two files must have the same file name (with extensions .brd and .sch)
and must be located in the same directory!
<li>The Replace command checks whether all pads in the old package which
have been assigned to pins will also be present in the new package,
regardless whether they are connected to a signal or not.
<li>When the pins of two parts in the schematic are directly overlapping
(and thus connected without a visible net wire), a net wire will be
generated when these parts are moved away from each other.
This is done to avoid unnecessary ripup of signal wires in the board.
</ul>


<a name=355>
<h1>Consistency Check</h1>
In order to use Forward&amp;Back Annotation a board and schematic
must be consistent, which means they must contain an equivalent set of
parts/elements and nets/signals.
<p>
Normally a board and schematic will always be consistent as long as they
have never been edited separately (in which case the message
<i>"No Forward&amp;Back Annotation will be performed!"</i>
will have warned you).
<p>
When loading a pair of board and schematic files the program will check
some consistency markers in the data files to see if these two files are
still consistent. If these markers indicate an inconsistency, you will be
offered to run an <a href=#48>Electrical Rule Check</a> (ERC),
which will do a detailed cross-check on both files.
<p>
If this check turns out positive, the two files are marked as consistent
and Forward&amp;Back Annotation will be activated.
<p>
If the two files are found to be inconsistent the ERC protocol file will
be brought up in a dialog and Forward&amp;Back Annotation will
<b>not</b> be activated.
<p>
<b>Please do not be alarmed if you get a lot
of inconsistency messages. In most cases fixing one error (like renaming
a part or a net) will considerably reduce the number of error messages you get in the next
ERC run.</b>
<h2>Making a Board and Schematic consistent</h2>
To make an inconsistent pair of board and schematic files consistent, you
have to manually fix any inconsistency listed in the ERC protocol.
This can be done by applying editor commands like
<a href=#68>NAME</a>,
<a href=#103>VALUE</a>,
<a href=#76>PINSWAP</a>,
<a href=#86>REPLACE</a> etc.
After fixing the inconsistencies you must use the
<a href=#48>ERC</a> command again to check the files and
eventually activate Forward&amp;Back Annotation.


<a name=356>
<h1>Limitations</h1>
The following actions are not allowed in a board when Back Annotation
is active (i.e. the schematic is loaded, too):
<ul>
<li>adding or copying a part that contains Pads or Smds
<li>deleting an airwire
<li>defining connections with the Signal command
<li>pasting from a board into a board, if the pasted objects contain
parts with Pads or Smds, or Signals with connections
</ul>
If you try to do one of the above things, you will receive a message
telling you that this operation cannot be backannotated. In such a
case please do the necessary operations in the schematic (they will
then be forward annotated to the board). If you absolutely have to
do it in the board, you can close the schematic window and then do
anything you like inside the board. In that case, however, board and
schematic will not be consistent any more!


<a name=357>
<h1>Technical Support</h1>
As a registered EAGLE user you get free technical support from CadSoft.
There are several ways to contact us or obtain the latest part libraries,
drivers or program versions:
<p>
CadSoft Computer<br>
19620 Pines Blvd. Suite 217<br>
Pembroke Pines, FL 33029<br>
USA
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td>Phone    </td><td width=20><td>954-237-0932</td></tr>
<tr><td>Fax      </td><td width=20><td>954-237-0968</td></tr>
<tr><td>Email    </td><td width=20><td><a href="mailto:support@cadsoftusa.com">support@cadsoftusa.com</a></td></tr>
<tr><td>URL      </td><td width=20><td><a href="http://www.cadsoftusa.com">www.cadsoftusa.com</a></td></tr>
</table>


<a name=358>
<h1>License</h1>
To legally use EAGLE you need a registered user license.
Please check whether the dialog "Help/About EAGLE" contains your name and address
under "Registered to:".
If you have any doubts about the validity or authenticity of your license,
please contact our
<a href=#357>Technical Support</a> staff
for verification.
<table><tr><td valign="top"><img src="platforms-mac.png"></td><td valign="middle">
Under <b>Mac OS X</b> you can find this information under "EAGLE/About EAGLE".
</td></tr></table>
<p>
There are different types of licenses, varying in the number of users
who may use the program and in the areas of application the program
may be used in:
<h2>Single-User License</h2>
Only <b>one</b> user may use the program at any given time.
However, that user may install the program on any of his computers, as long
as he makes sure that the program will only be used on one of these
computers at a time.
<p>
A typical application of this kind would be a user who has a PC at home
and also a notebook or laptop computer which he uses "on the road". As
he would only use one of these computers at a time it is ok to have EAGLE
installed on both of them.
<h2>Multi-user License</h2>
A multi-user license may be used by several users (up to the maximum number
listed on the license) simultaneously. The program may be installed on any
number of different computers at the location of the license holder.
<h2>Commercial License</h2>
The program may be used for any purpose, be it commercial or private.
<h2>Educational License</h2>
The program may only be used in an educational environment like a school,
university or training workshop, in order to teach how to use ECAD
software.
<h2>Student License</h2>
The program may only be used for private ("non-profit") purposes.
Student versions are sold at a very low price, to allow people who
could otherwise never afford buying EAGLE the use of the program
for their private hobby or education. It is a violation of the license
terms if you "earn money" by using a Student Licence of EAGLE.


<a name=359>
<h1>EAGLE License</h1>
Before you can work with EAGLE it is necessary to register the program with
your personalized license data.
<p>
In the dialog "EAGLE License" enter the name of your EAGLE license file, as well
as the corresponding Installation Code you have received together with your
license file (this code consists of 10 lowercase characters).
<p>
After pressing enter or clicking on the
<b>OK</b>
button, EAGLE will be installed with your personalized license data.
<p>
If you have problems installing EAGLE or are in doubt about the
validity of your license please contact our
<a href=#357>Technical Support</a> staff for
assistance.
<h2>Installing additional modules</h2>
If you decided to update your license with the schematic/autorouter module
you get a new license file with a new Installation Code.
To make the new modules available you have to register your EAGLE again.
Start the EAGLE program and choose in the <a href=#12>Control Panel</a>
in the Help menu the item <i>EAGLE License</i>.


<a name=360>
<h1>EAGLE Editions</h1>
EAGLE is available in three different editions to fit various
user requirements.
<h2>Professional</h2>
The <i>Professional</i> edition provides full functionality:
<ul>
<li>board area up to 1600x1600mm (64x64inch)
<li>up to 16 routing layers
<li>up to 999 sheets per schematic
</ul>
<h2>Standard</h2>
The <i>Standard</i> edition has the following limitations:
<ul>
<li>board area limited to 160x100mm (6.3x4inch), which corresponds to a full Eurocard
<li>only six routing layers (Top, Route2, Route3, Route14, Route15 and Bottom)
<li>a schematic can consist of up to 99 separate sheets
</ul>
<h2>Light</h2>
The <i>Light</i> edition has the following limitations:
<ul>
<li>board area limited to 100x80mm (4x3.2inch), which corresponds to half of a Eurocard
<li>only two routing layers (Top and Bottom)
<li>a schematic can consist of only one single sheet
</ul>
<h2>Freemium</h2>
The <i>Freemium</i> edition is a <i>Free Premium</i> edition, which has capabilities
between the <i>Light</i> and the <i>Standard</i> editions. The Freemium edition is
available only after registration on <a href="http://www.element-14.com/eagle-freemium">http://www.element-14.com/eagle-freemium</a>
and has the following limitations:
<ul>
<li>board area limited to 100x80mm (4x3.2inch), which corresponds to half of a Eurocard
<li>only four routing layers (Top, Route2, Route15 and Bottom)
<li>a schematic can consist of only four sheets
<li>a Freemium license is limited to one single user and computer, and requires
    an active connection to the Internet in order to work; it expires 60 days after
    installation
</ul>
<p>
If you receive an error message like
<p>
<i>The Light edition of EAGLE can't perform the requested action!</i>
<p>
this means that you are attempting to do something that would violate
the limitations that apply to the EAGLE edition in use, like for example
placing an element outside of the allowed area.
<p>
All editions of EAGLE can be
used to view files created with the <i>Standard</i> or <i>Professional</i> edition,
even if these drawings exceed the editing capabilities of the edition
currently in use.
<p>
To check which edition your license has enabled, select
<i>Help/About EAGLE</i> from the Control Panel's menu.

</body>
</html>