Скачиваний:
15
Добавлен:
28.06.2014
Размер:
1.58 Кб
Скачать
//---------------------------------------------------------------------------
//ДОБАВЛЕНИЕ ЭЛЕМЕНТА В ФАЙЛ
#include <vcl.h>
#include <stdio.h>
#include <dstring.h>
#pragma hdrstop

#include "Unit2.h"
#include "Unit1.h"
#include "Unit3.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
extern FILE *FN;
extern Auto Info;
extern void AddInfo(FILE *,Auto);
extern void PrintList(FILE *);
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
//Очистить форму
void __fastcall TForm2::Button2Click(TObject *Sender)
{
  Form2->Edit1->Text = "";
  Form2->Edit2->Text = "";
  Form2->Edit3->Text = "";
  Form2->Edit4->Text = "";
}
//---------------------------------------------------------------------------
//Принять добавление элемента
void __fastcall TForm2::Button1Click(TObject *Sender)
{
  strcpy(Info.Name,Form2->Edit1->Text.c_str());
  strcpy(Info.Mark,Form2->Edit2->Text.c_str());
  Info.SeatsNumb = StrToInt(Form2->Edit3->Text);
  Info.UseP = StrToFloat(Form2->Edit4->Text);
  Info.NotDeleted = true;
  Form2->Edit1->Text = "";
  Form2->Edit2->Text = "";
  Form2->Edit3->Text = "";
  Form2->Edit4->Text = "";  
  AddInfo(FN,Info);
  PrintList(FN);
  Form2->Close();        
}
//---------------------------------------------------------------------------
Соседние файлы в папке Программа
  • #
    28.06.2014108.56 Кб15Unit1.obj
  • #
    28.06.20145.13 Кб16Unit1.~cpp
  • #
    28.06.201451 б16Unit1.~ddp
  • #
    28.06.20143.03 Кб15Unit1.~dfm
  • #
    28.06.20141.69 Кб15Unit1.~h
  • #
    28.06.20141.58 Кб15Unit2.cpp
  • #
    28.06.201451 б15Unit2.ddp
  • #
    28.06.20143.73 Кб16Unit2.dfm
  • #
    28.06.20141.11 Кб16Unit2.h
  • #
    28.06.201443.36 Кб15Unit2.obj
  • #
    28.06.20141.58 Кб15Unit2.~cpp