AKRAMNOUIR
Messages postés13Date d'inscriptiondimanche 12 mars 2006StatutMembreDernière intervention12 mars 2008
-
7 mai 2007 à 20:31
cs_Exploreur
Messages postés4821Date d'inscriptionlundi 11 novembre 2002StatutMembreDernière intervention15 novembre 2016
-
8 mai 2007 à 17:07
salut je veut savoir comment affiher le contenu d'une ligne dans un fichier txt ( par exemple )
Private Sub suivant_Click()
If Not EOF(1) Then
Line Input #1, etudiant me permet de lire les ligne par orde
Label1.Caption = Mid(etudiant, 1, 20)
Label2.Caption = Mid(etudiant, 21, 20)
Label3.Caption = Mid(etudiant, 41, 5)
Label4.Caption = Mid(etudiant, 46, 5)
Label5.Caption = Mid(etudiant, 51, 5)
n1 = CInt(Label3.Caption)
n2 = CInt(Label4.Caption)
n3 = CInt(Label5.Caption)
Label6.Caption = (n1 + n2 + n3) / 3
End If
End Sub
je veut lire les ligne suivant mon choix ou dans le sens inverse merci
cs_Exploreur
Messages postés4821Date d'inscriptionlundi 11 novembre 2002StatutMembreDernière intervention15 novembre 201615 7 mai 2007 à 20:52
Salut,
Ou même cela de PCPT :
Option Explicit
Type Record ' Désigne un type défini par l'utilisateur.
ID As Integer
Name As String * 20
End Type
Private Sub Form_Load()
Dim MyRecord As Record, Position ' Déclare les variables.
' Ouvre l'exemple de fichier en accès aléatoire.
Open "FICHTEST" For Random As #1 Len = Len(MyRecord)
' Lit l'exemple de fichier à l'aide de l'instruction Get.
Position = 3 ' Définit le numéro d'enregistrement.
Get #1, Position, MyRecord ' Lit le troisième enregistrement.
Close #1 ' Ferme le fichier.
End Sub