15.07.2013 Views

Microsoft Visual Basic - Encyclopaedia Gentium Boni

Microsoft Visual Basic - Encyclopaedia Gentium Boni

Microsoft Visual Basic - Encyclopaedia Gentium Boni

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

fctLireThayer - 1<br />

Public Function LireThayer(mot, reference) As String<br />

mot = Replace(mot, "0", "O")<br />

'If Len(mot) = 4 Then<br />

'mot = "g" & mot<br />

'End If<br />

frmParse2.Text1.Text = ""<br />

Dim lfile As Long 'Lecture<br />

Dim ofile As String 'Fichier à ouvrir<br />

ofile = App.Path & "\modules\Thayer\thayer.txt"<br />

lfile = FreeFile<br />

Dim chercher$<br />

ligne = ""<br />

If Len(mot) = 1 Then<br />

chercher = "OOOO" & mot<br />

ElseIf Len(mot) = 2 Then<br />

chercher = "OOO" & mot<br />

ElseIf Len(mot) = 3 Then<br />

chercher = "OO" & mot<br />

ElseIf Len(mot) = 4 Then<br />

chercher = "O" & mot<br />

End If<br />

reference = chercher<br />

Open ofile For Input As #lfile<br />

Do<br />

Input #lfile, ligne<br />

If ligne = reference Then ' pour que le verset recherché soit exact<br />

'affectation du verset du fichier à la variable<br />

frmParse2.Text1.Text = frmParse2.Text1.Text & ligne<br />

Do While Not EOF(lfile)<br />

Input #lfile, ligne<br />

If Left(ligne, 1) = "O" Then<br />

GoTo apres:<br />

Else<br />

'If IsNumeric(ligne) = True Then<br />

'frmParse2.Text1.Text = frmParse2.Text1.Text & ligne<br />

'Else<br />

frmParse2.Text1.Text = frmParse2.Text1.Text & " " & vbCrLf & ligne<br />

'MsgBox ligne<br />

'End If<br />

Loop<br />

End If<br />

End If<br />

Loop While Not EOF(lfile)<br />

pres:<br />

lose #lfile<br />

nd Function

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!