//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <stdio.h>
#include "ufmMain.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
   FILE * monCanal = NULL; // Déclaration et initialisation du canal
   char cData[100] = "";   // Variable char C pour la gestion du texte
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::buEcritureClick(TObject *Sender)
{
   // Lorsque l'utilisateur clique sur le bouton Ecrire dans le fichier *.txt
   monCanal = fopen("test_lignes.txt","r");     // Ouverture du canal de communication
   char c[100] = "";
   int i;
   while(feof(monCanal))
   {
      i = 0;
      fgets(c,1000,monCanal);
         if(fgets(c,1000,monCanal) == '\n')
         {
            StringGrid1->Cells[0][i + 1];
         }
   }
   StringGrid1->Cells[0][i] = c;
   fclose(monCanal);
			
		
 
	
Partager