#include <vcl.h>
#include<math.h>
#include<iostream.h>
#include<fstream.h>
#include<cstring.h>
#include<stdlib.h>
#include<stdio.h>
#pragma hdrstop
#include "Unit1.h"
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
int aux=0,aux1=0, aux3;
AnsiString *cfechas;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button2Click(TObject *Sender) //AQUI ESTA EL ERROR
{
int p=0;//auxiliar
aux3=aux-1;
cfechas = new AnsiString[aux3];
for (p=0; p<=aux3; p++)
{
cfechas[p]="pepe";//ListBox2->Items->Strings[p];
}
Form2->Hide();
Form1->Show();
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender)
{
int j=1, p;
int ncolum = Form1->ncolum;
for(p=0; p<=ncolum-1; p++)
{
ListBox1->Items->Strings[p] = Form1->StringGrid1->Cells[j][0];
j++;
aux1++;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button3Click(TObject *Sender)
{
String cambio1;
try
{
cambio1 = ListBox1->Items->Strings[ListBox1->ItemIndex];
ListBox1->Items->Delete(ListBox1->ItemIndex);
ListBox2->Items->Strings[aux]= cambio1;
aux++;
aux1--;
}
catch(...)
{
ShowMessage("Elige un componente");
}
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button4Click(TObject *Sender)
{
String cambio2;
try
{
cambio2 = ListBox2->Items->Strings[ListBox2->ItemIndex];
ListBox2->Items->Delete(ListBox2->ItemIndex);
ListBox1->Items->Strings[aux1]=cambio2;
aux--;
aux1++;
}
catch(...)
{
ShowMessage("Elige un componente");
}
}