Sub Main

dim m as integer
dim z as integer
dim  adresse(100) as integer
dim  ma(100) as integer
dim  vit(100) as integer
dim  f0(100) as integer
dim  f1(100) as integer
dim  f2(100) as integer
dim  f3(100) as integer
dim  f4(100) as integer
dim  f5(100) as integer
dim  f6(100) as integer
dim  f7(100) as integer
dim  f8(100) as integer
dim  dt(100) as integer
dim  ag(100) as integer
dim  c(100) as integer
dim  hp(100) as integer

m=0

oDoc = ThisComponent
	sURL = oDoc.Url
	MonRep =  MonRepertoire(sURL)

 open MonRep + "temp/trajet0loco1.txt" for input as #1
    
    do
    m=m+1
    input #1, adresse(m), ma(m), vit(m), f0(m), f1(m), f2(m), f3(m), f4(m), f5(m), f6(m), f7(m), f8(m), dt(m), ag(m), c(m), hp(m)
    loop until adresse(m)=0
    
    
    Close #1
    z=m
    

oSheet = ThisComponent.getSheets.getByName("loco1")

for i=1 to z
cellule=oSheet.getCellByPosition(0,5+i)
cellule.value=adresse(i)
cellule=oSheet.getCellByPosition(1,5+i)
cellule.value=ma(i)
cellule=oSheet.getCellByPosition(2,5+i)
cellule.value=vit(i)
next i



End Sub

Function MonRepertoire(sURL As String) As String
Dim Chemin() As String, MonRep As String 
	Chemin = Split(sURL,"/")
	Chemin(Ubound(Chemin())) = ""
	MonRepertoire = join(Chemin, "/")
End Function