If File.Exists(File.DirAssets,"acimtoc.txt") = True Then
'Read each Line from WB Table of Contents "acimtoc2.txt"
Reader.Initialize(File.OpenInput(File.DirAssets,"acimtoc.txt"))
TheLine="start"
EventCounter = 0
Do While TheLine <> Null
TheLine = Reader.ReadLine
If TheLine<>Null Then
If DEBUG_Debugging1 Then Log("TheLine = " & TheLine)
rstACIMTOC.Initialize(TheLine)
rstACIMTOC.Style2(Typeface.STYLE_BOLD, "{B}")
rstACIMTOC.Style2(Typeface.STYLE_ITALIC, "{I}")
rstACIMTOC.Style2(Typeface.STYLE_BOLD_ITALIC, "{BI}")
rstACIMTOC.Style2(Typeface.STYLE_NORMAL, "{N}")
rstACIMTOC.Underscore2("{U}")
If DEBUG_Debugging1 Then Log("Set rstACIMTOC {B}, {I}, {BI}, {N}")
' http://www.rapidtables.com/web/color/RGB_Color.htm
rstACIMTOC.Color2(Colors.RGB(0,0,0), "{BL}")
rstACIMTOC.Color2(Colors.RGB(102,153,153), "{CC}")
rstACIMTOC.Color2(Colors.RGB(204,153,51), "{SC}")
rstACIMTOC.Color2(Colors.RGB(255,102,0), "{OR}")
rstACIMTOC.Color2(Colors.RGB(153,0,153), "{PU}")
If DEBUG_Debugging1 Then Log("Set rstACIMTOC {BL}, {CC}, {SC}, {OR} and {PU}")
FluidTextSizeFloat = FluidTextSize
lvACIMTOC.SingleLineLayout.Label.TextSize = FluidTextSizeFloat ' Gives error if not float
lvACIMTOC.SingleLineLayout.ItemHeight = TheItemHeight
lvACIMTOC.AddSingleLine(rstACIMTOC)
If DEBUG_Debugging1 Then Log("Doing lvACIMTOC.AddSingleLine(" & rstACIMTOC & ")")
End If
EventCounter = EventCounter + 1
If EventCounter Mod 20 = 0 Then DoEvents
Loop
Reader.Close