Sub ReadFile(FileName As String, cpb As CircularProgressBar)
TagsMap.Initialize
ecount=0
Starter.IsChanged=False
Dim c1, progress=1, scount As Int, c2, c3 As String
Dim isconc As Boolean
myStack.Initialize
db.Initialize
UserTags.Initialize
UncnowMap.Initialize
Dim h As Int=0
fileError=FileName
Try
Dim rd As TextReader
scount=File.ReadList(Starter.myFolder, FileName).Size
rd.Initialize(File.OpenInput(Starter.myFolder, FileName))
Dim strLines As String= rd.ReadLine
Dim r As record
r.Initialize
Do While strLines <> Null
ecount=ecount+1
Dim sb As StringBuilder: sb.Initialize
Dim m As Matcher = Regex.Matcher(pat,strLines)
Do While m.Find
c1=m.Group(1): c2=m.Group(2): c3=m.Group(3)
Loop
Select Case c2
Case "CONC"
r.c3=sb.Append(r.c3).Append(c3)
strLines = rd.ReadLine
Case "CONT"
r.c3=sb.Append(r.c3).Append(CRLF).Append(c3)
strLines = rd.ReadLine
Case Else
If isconc Then
FillDB(r)
End If
r.c1=c1: r.c2=c2: r.c3=c3
isconc=True
strLines = rd.ReadLine
End Select
If cpb.IsInitialized Then
Dim x As Int=100*progress/(scount)
If x>h Then
cpb.Value=x
Sleep(0)
h=x
End If
progress=progress+1
End If
Loop
Catch
Log(LastException)
End Try
rd.Close
End Sub