lomat62 Fan de Sébastien Loeb | donc voila une image de base du programme
et voici le code complet du programme :
Code :
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include <stdio.h>
- #include <fstream.h>
- #include <iostream.h>
- using std::ifstream;
- #include <iomanip.h>
- #include <string.h>
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- //char* strpbrk ( const char *s1, const char *s2)
- rechercheFichtxt ();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormShow(TObject *Sender)
- {
- rechercheFichtxt ();
- }
- //---------------------------------------------------------------------------
- //---------------------------------------------------------------------------
- // Méthode sortieLigne
- //---------------------------------------------------------------------------
- void TForm1::sortieLigne ( const char *Nom, const char *M4, const char *M5, const char *M1, const char *M2, const char *M3, const char *RA, const char *DEC, const char *M6)
- {
- ListBox1->Items->Add(Nom);
- if (Editrecherche->Text.c_str()==Nom)
- {
- EditRA->Text=RA;
- EditDec->Text=DEC;
- }
- }
- //---------------------------------------------------------------------------
- // Méthode de recherche
- //---------------------------------------------------------------------------
- void TForm1::rechercheFichtxt ()
- {
- ifstream entreeFichierClient("messieressai.txt",ios::in);
- if (!entreeFichierClient)
- {
- Application->MessageBox("Ouverture du fichier impossible", "Warning" );
- }
- char Nom[12], RA[14], DEC[14], M1[8], M2[8], M3[8], M4[8], M5[8], M6[8] ;
- while (entreeFichierClient>>Nom>>RA>>DEC>>M1>>M2>>M3>>M4>>M5>>M6)
- sortieLigne (Nom, RA, DEC, M1, M2, M3, M4, M5 ,M6);
- }
|
Message édité par lomat62 le 12-04-2006 à 11:07:40 ---------------
MATT ;)
|