4 messages in org.openoffice.fr.prog[prog] Lecture d'un fichier texte com...
FromSent OnAttachments
DominiqueDec 13, 2005 1:30 am 
Bernard MarcellyDec 13, 2005 2:31 am 
fean...@free.frDec 13, 2005 2:36 am 
DominiqueDec 13, 2005 2:38 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[prog] Lecture d'un fichier texte comportant plusieurs groupes de lignesActions...
From:Dominique (dbra@tele2.fr)
Date:Dec 13, 2005 1:30:11 am
List:org.openoffice.fr.prog

Bonjour,

J'arrive avec le code suivant à intégrer la totalité de mon fichier comportant plusieurs groupes de cinq lignes, dans un un combobox. Mais je n'arrive pas à lire exclusivement les premières lignes de chaque groupe. Je possède l'identique e code VBA, mais rien à y faire en OOobasic

Sub Lire2() Dim f1 As Integer Dim unTexte As String Dim Tf1 as object Dim tt as object Dim dlg as object Dim nomInfo as string dim I as double DialogLibraries.LoadLibrary("Library1") Dlg = CreateUnoDialog( DialogLibraries.Library1.Dialog2) NomInfo ="C:\Docs OpenOffice\info.Txt" f1 = FreeFile ' obtenir un numéro de fichier ouvert Open nomInfo For Input As #f1

Input #f1, unTexte Tf1 = dlg.GetControl("Combo1") 'Tf1.text = unTexte

f1 = FreeFile ' obtenir un numéro de fichier ouvert Open nomInfo For Input As #f1

do While not Eof(f1)

line Input #f1, untexte

tt= dlg.GetControl("Combo2") tt.additem (unTexte,1) loop dlg.Execute()

for I = 1 to 5 line Input #f1, untexte next I 'wend

Close #f1 End Sub