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.

fctDoubleCliqueSeptante - 1<br />

Public Function DoubleCliqueSeptante()<br />

Dim lfile As Long 'Lecture<br />

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

Dim ofile2 As String, LFile2 As Long<br />

Dim OFile3 As String, LFile3 As Long<br />

ofile = App.Path & "\tools\greeknt.txt"<br />

ofile2 = App.Path & "\tools\analysemorpho.txt"<br />

OFile3 = App.Path & "\tools\packard.txt"<br />

lfile = FreeFile<br />

LFile2 = FreeFile + 1<br />

LFile3 = FreeFile + 2<br />

Dim erreur<br />

mot = UCase(mot) ' mise en majuscules, selon le format adéquat<br />

'MsgBox mot<br />

If Right(mot, 1) = "J" Then ' pb du s final<br />

mot = Mid(mot, 1, Len(mot) - 1) + "S"<br />

End If<br />

'MsgBox mot, , "mot à chercher dans greeknt"<br />

' trouvons le mot double-cliqué dans le fichier greeknt<br />

' ouverture du fichier greeknt, où se trouve le mot, son code et son origine<br />

Open ofile For Input As #lfile<br />

Do 'début de boucle<br />

Input #lfile, ligne<br />

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

Open ofile2 For Output As #LFile2<br />

Write #LFile2, ligne<br />

Close #LFile2<br />

'frmParse.txtanalyse.Caption = frmParse.txtanalyse.Caption & vbCrLf & ligne<br />

End If<br />

Loop Until EOF(lfile)<br />

Close #lfile<br />

Open ofile2 For Input As #LFile2<br />

nput #LFile2, ligne<br />

lose #LFile2<br />

MsgBox ligne, , "ligne"<br />

>> j'ai ma ligne qui a en elle l'analyse précise du mot<br />

je dois décortiquer cette ligne<br />

à tout hasard, je la mets dans un tampon<br />

rmBible.lbltampon.Text = ligne<br />

la ligne est composée comme suit:<br />

MOTFLECHIMOTORIGINE<br />

j'appelle ma fonction pour me donner le CODE et le MOTORIGINE<br />

all ExtraireCode(mot, ligne, code, origine, chercher)<br />

MsgBox mot, , "mot"<br />

MsgBox ligne, , "ligne"<br />

MsgBox code, , "code"<br />

MsgBox origine, , "origine"<br />

MsgBox chercher, , "chercher"<br />

maintenant que je l'ai, je consulte le fichier packard pour décrypter mon code<br />

Open OFile3 For Input As #LFile3<br />

o<br />

nput #LFile3, nouveau<br />

If nouveau = chercher Then<br />

Do<br />

Input #LFile3, nouveau<br />

Open ofile2 For Append As #LFile2<br />

Write #LFile2, nouveau<br />

Close #LFile2<br />

Loop Until nouveau = "" Or nouveau = vbCrLf<br />

'Else<br />

' Open OFile2 For Output As #LFile2<br />

' Write #LFile2, mot & vbCrLf & origine & "Pas d'analyse"<br />

' Close #LFile2<br />

End If<br />

sg2 = InStr(1, nouveau, chercher, vbTextCompare)<br />

oop Until EOF(LFile3)

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

Saved successfully!

Ooh no, something went wrong!