Добавил:
Tushkan
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабораторные работы / ЛЗ1 / Программа / Unit2
.cpp//---------------------------------------------------------------------------
//ДОБАВЛЕНИЕ ЭЛЕМЕНТА В ФАЙЛ
#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();
}
//---------------------------------------------------------------------------
Соседние файлы в папке Программа