```"
For i = 1 To Len(CoNameS) 'eat the <><><> stuff in micro.txt
List3.AddItem ("RT1 2 " + Str(i))
If Mid\$(CoNameS, i, 1) = "<" Then Mid\$(CoNameS, i, 1) = " "
If Mid\$(CoNameS, i, 1) = ">" Then Mid\$(CoNameS, i, 1) = " "
Next i
Print #1, CoNameS
'do headers - even ch tp
FNS = Mid\$(Text1, 1, 4) 'FileNameS
SDS = Mid\$(Text1, 5, 8)
EDS = Mid\$(Text2, 5, 8)
TMS = Mid\$(Text2, 13, 2) + ":" + Mid\$(Text2, 15, 2)
PRS = PRICE / 100
ATPRS = "" & PRS & "/kwh"
List3.AddItem ("RT1 3 " + Str(i))
Print #1, FNS & " Summary from " & SDS & " to " & EDS & " at " & ATPRS
H1\$ = "Circuit ID                 "
H2\$ = " w/v     kw                      "
H3\$ = "                           "
H4\$ = "amps    kva      kwh     kvah    kvarh    cost      %    pf"
Print #1, H1\$ & H2\$
Print #1, H3\$ & H4\$
Exit Sub
skip1:
End Sub
On Error GoTo skip1
Open FileNameS + "mm.htm" For Output As 1
Q\$ = Chr\$(34)
FF1 = ""
FF2 = ""
FF3 = ""
FF4 = ""
FF5 = ""

TD1 = "microMETER"
'
Print #1, ""
Print #1, ""
For i = 1 To Len(CoNameS) 'eat the <><><> stuff in micro.txt
List3.AddItem ("RH1 2 " + Str(i))
If Mid\$(CoNameS, i, 1) = "<" Then Mid\$(CoNameS, i, 1) = " "
If Mid\$(CoNameS, i, 1) = ">" Then Mid\$(CoNameS, i, 1) = " "
Next i
'do headers - even ch tp
FNS = Mid\$(Text1, 1, 4) 'FileNameS
SDS = Mid\$(Text1, 5, 8)
EDS = Mid\$(Text2, 5, 8)
TMS = Mid\$(Text2, 13, 2) + ":" + Mid\$(Text2, 15, 2)
PRS = PRICE / 100
ATPRS = "" & PRS & "/kwh"
List3.AddItem ("RH1 3 " + Str(i))
Print #1, "```
" c3S = "#aaaaaa" Print #1, "" Print #1, TD1 & "Colspan=" & "1" & ">" & FF1 & CoNameS & "" Print #1, TD1 & "Colspan=" & "7" & ">" & FF1 & FNS & " from " & SDS & " to " & EDS & " at " & TMS & "" Print #1, TD1 & "Colspan=" & "4" & ">" & FF1 & Form1.Caption & "" ' ---------------------------------------- copy to center Print #1, "" Print #1, TD1 & ">" & FF1 & "channel and circuit name" Print #1, TD1 & ">" & FF1 & "amperes" Print #1, TD1 & ">" & FF1 & "kva" Print #1, TD1 & ">" & FF5 & "kwh" Print #1, TD1 & ">" & FF5 & "kvah" Print #1, TD1 & ">" & FF5 & "kvarh" List3.AddItem ("RH1 4 " + Str(i)) Print #1, TD1 & ">" & FF3 & "\$ cost" Print #1, TD1 & ">" & FF1 & "%" Print #1, TD1 & ">" & FF2 & "alarm" Print #1, TD1 & ">" & FF1 & "demand" Print #1, TD1 & ">" & FF4 & "X10(tm)" Print #1, TD1 & ">" & FF1 & "power" Print #1, "" Print #1, TD1 & ">" & FF1 & "(true power)" Print #1, TD1 & ">" & FF1 & "watts/volts" Print #1, TD1 & ">" & FF1 & "kw dem" Print #1, TD1 & ">" & FF5 & "used" Print #1, TD1 & ">" & FF1 & "" Print #1, TD1 & ">" & FF1 & "" Print #1, TD1 & ">" & FF1 & ATPRS & "" Print #1, TD1 & ">" & FF1 & "of total" Print #1, TD1 & ">" & FF2 & "limits" Print #1, TD1 & ">" & FF1 & "graph" Print #1, TD1 & ">" & FF1 & "control" Print #1, TD1 & ">" & FF1 & "factor" Exit Sub skip1: End Sub Private Sub Report2() 'detail Q\$ = Chr\$(34): c3S = "#dddddd" TE1 = "" If Check1.Value = 0 Then TE1 = "": TE2 = "" End If CKTS(I17) = " totals " For i = 1 To I17 List3.AddItem ("R2 1 " + Str(i)) On Error GoTo skip1 'T-kvarh U-kvah V-pf W-amps X-kw Y-kwh Z-cost FORMATS = Format\$(T(i), "0000000.0"): ZeroSuppress: TS = FORMATS FORMATS = Format\$(U(i), "0000000.0"): ZeroSuppress: US = FORMATS FORMATS = Format\$(V(i), "00.000"): ZeroSuppress: VS = FORMATS FORMATS = Format\$(W(i), "0000.0"): ZeroSuppress: WS = FORMATS FORMATS = Format\$(X(i), "00000.0"): ZeroSuppress: XS = FORMATS FORMATS = Format\$(Y(i), "0000000.0"): ZeroSuppress: YS = FORMATS FORMATS = Format\$(Z(i), "00000.00"): ZeroSuppress: ZS = FORMATS If Y(I17) > 0 Then pct = Y(i) / Y(I17) * 100 If C00 = 2 And i < 17 Then If Int(i / 2) = i / 2 Then 'even pct = (Y(i) + Y(i - 1)) / Y(I17) * 100 Else pct = 0 End If End If FORMATS = Format\$(pct, "00000.0"): ZeroSuppress: PS = FORMATS CK2S = CKTS(i) If Check1.Value = 1 Then 'html - set color groupings c1S = "#fofodf": c2S = "#ffffee": c4S = "#fff7d7" If C00 = 0 Then 'normal If Int(i / 2) = i / 2 Then 'even Print #1, "" Else Print #1, "" End If End If If C00 = 2 Then 'anal pair If i = 1 Or i = 2 Or i = 5 Or i = 6 Or i = 9 Or i = 10 Or i = 13 Or i = 14 Then Print #1, "" Else Print #1, "" End If End If If C00 = 3 Then '3-phase If i = 1 Or i = 4 Or i = 7 Or i = 10 Or i = 13 Or i = 16 Then Print #1, "" End If If i = 2 Or i = 5 Or i = 8 Or i = 11 Or i = 14 Then Print #1, "" End If If i = 3 Or i = 6 Or i = 9 Or i = 12 Or i = 15 Then Print #1, "" End If End If List3.AddItem ("R2 2 " + Str(i)) CK2S = TD2 & ">" & FF1 & CKTS(i) & TE2 End If 'advanced options ALS = TE1 & TE2 GRS = TD1 & ">" & FF1 & "d" & TE2 If Check3.Value = 0 Then GRS = TE1 & TE2 If Check1.Value = 0 Then GRS = "" 'TD1 & ">" & FF1 & 2 CTS = TE1 & TE2 PFS = TE1 & TE2 List3.AddItem ("R2 3 " + Str(i)) 'T-kvarh U-kvah V-pf W-amps X-kw Y-kwh Z-cost If sw1 = 1 Then PFS = VS 'PFS = "" If C00 = 2 And i < I17 Then If Int(i / 2) = i / 2 Then 'even PFS = VS US = TE1 & TE2: GRS = TE1 & TE2 Else TS = TE1 & TE2: ZS = TE1 & TE2 PS = TE1 & TE2: YS = TE1 & TE2 End If End If If sw1 = 1 And V(i) < lowv Then PFS = TE1 & TE2 If sw1 = 1 And Y(i) < lowv Then PFS = TE1 & TE2 If sw1 = 1 And Check2.Value = 0 Then PFS = TE1 & TE2: TS = TE1 & TE2: YS = TE1 & TE2 End If If i = I17 Then Print #1, "" 'GRS = TE1 & TE2 'let the totals graph print Else If LL(i) > 0 And Check1.Value = 1 Then If E(i) > LL(i) Or A(i) > LL(i) Then ALS = TD1 & ">" & FF2 & "H" & TE2 End If If HL(i) < 256 And Check1.Value = 1 Then If E(i) < HL(i) Or A(i) < HL(i) Then ALS = TD1 & ">" & FF2 & "L" & TE2 End If End If 'T-kvarh U-kvah V-pf W-amps X-kw Y-kwh Z-cost 'ckt, a w/v, kva kw dem, kwh, kvah, kvarh, \$, % Print #1, CK2S & WS & XS & YS & US & TS & ZS & PS; 'alarm, graph, control, power factor Print #1, ALS & GRS & CTS & PFS List3.AddItem ("R2 4 " + Str(i)) If Check1.Value = 1 Then Print #1, "" End If Next i If Check1.Value = 1 Then Print #1, "
": TE2 = "
pf
" End If List3.AddItem ("R2 5 " + Str(i)) Close 1 List3.AddItem ("R2 6 " + Str(i)) Exit Sub skip1: End Sub Private Sub Graph1(j) 'needs file b.gif in c:\micromtr List3.AddItem ("G1 1 ") amax = 255: amin = 0 On Error GoTo skip1 Open FileNameS + "m" + Trim(Str\$(j)) + ".htm" For Output As 1 Print #1, "
" Print #1, "" p1 = "" BK(17) = BK(1): LV(17) = LV(1) ' total good only for all ckts similar to #1 yy = amax / SCAL * BK(j) / 20 yz = yy * LV(j) / 1000 zz = yz: If j = I17 Then zz = 0 Print #1, p1 & "max=" & Mid\$(Str\$(zz), 2, Len(yy) + 1) & p2 Print #1, "

### kw demand " p2 = "

" Print #1, "" ' alt=""> For i = 1 To 540 List3.AddItem ("G1 2 " + Str(i)) xx = G0(i, j) / SCAL * BK(j) / 20 ' * LV(j) If yy = 0 Then yy = 0.0000000001 p = xx / yy * 255 'Rnd * 300 'If j = I17 Then p = Int(p / 16) 'too small Print #1, ""; ' alt=""> Next i List3.AddItem ("G1 3 " + Str(i)) Print #1, "

### " 'Print #1, "01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24" Print #1, "" & CKTS(j) & "

" If j = I17 Then Print #1, "Total good only for all ckts similar to #1." End If Print #1, "