forked from robertstarr/ulp_user
-
Notifications
You must be signed in to change notification settings - Fork 0
/
part2html.ulp
58 lines (54 loc) · 2.74 KB
/
part2html.ulp
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
#usage "<b>Export an HTML partlist</b>\n"
"<p>"
"Generates an HTML file of a board's partlist for publishing on an intranet."
"<p>"
"<author>Author: Sean D. Alcorn (SYD) <[email protected]><br>Extended by [email protected]</author>"
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED
if (board) board(B) {
string fileName = dlgFileSave("Save File", filesetext(B.name, ".htm"), "*.htm");
if (fileName == "") exit(0);
output(fileName) {
printf("<html>\n\n");
printf("<head>\n");
printf("<meta http-equiv=\"Content-Type\"\n");
printf("content=\"text/html; charset=iso-8859-1\">\n");
printf("<meta name=\"GENERATOR\" content=\"Avion International\'s PART2HTM v0.4\">\n");
printf("<title>Parts Listing for %s</title>\n", B.name);
printf("<head>\n\n");
printf("<body bgcolor=\"\#FFFFFF\">\n\n");
printf("<h1 align=\"center\">Parts List for</h1>\n\n");
printf("<h1 align=\"center\">%s</h1>\n", B.name);
printf("<hr width=\"90%%\">\n\n");
printf("<blockquote>\n");
printf(" <h2 align=\"left\">Parts Listing</h2>\n");
printf("</blockquote>\n");
printf("<div align=\"center\"><center>\n\n");
printf("<table border=\"2\" width=\"90%%\">\n");
printf(" <tr>\n");
printf(" <td align=\"center\" width=\"25%%\"><font size=\"4\"><strong>Part</strong></font></td>\n");
printf(" <td align=\"center\" width=\"25%%\"><font size=\"4\"><strong>Value</strong></font></td>\n");
printf(" <td align=\"center\" width=\"25%%\"><font size=\"4\"><strong>Package</strong></font></td>\n");
printf(" <td align=\"center\" width=\"25%%\"><font size=\"4\"><strong>Library</strong></font></td>\n");
printf(" </tr>\n");
B.elements(E) {
printf(" <tr>\n");
printf("<td align=\"center\" width=\"25%%\">%s</td>\n", E.name);
printf("<td align=\"center\" width=\"25%%\">%s</td>\n", E.value);
printf("<td align=\"center\" width=\"25%%\">%s</td>\n", E.package.name);
printf("<td align=\"center\" width=\"25%%\">%s</td>\n", E.package.library);
printf(" </tr>\n");
}
printf("</table>\n");
printf("</center></div>\n\n");
printf("<p></p>\n\n");
printf("<blockquote>\n");
printf(" <p><em>Generated by PART2HTM v0.4 by </em><a\n");
printf(" href=\"mailto:[email protected]\"><em>Sean D. Alcorn</em></a><em><br>\n");
printf(" © 1997 </em><a href=\"http://www.avion.com.tw/\"><em>Avion\n");
printf(" International Co. Ltd.</em></a><em><br>\n");
printf(" Bangkok • Sydney • Taipei</em></p>\n");
printf("</blockquote>\n");
printf("</body>\n");
printf("</html>");
}
}