Witam,
jestem w trakcie robienia programu, który bedzie mial za zadanie tworzenie plików .lua .
Jak na obrazku, kiedy nacisne "Dodaj" w ListBoxie 1 pojawi sie wpis. Chce, zeby w moim pliku pojawił się wpis:
elseif msgcontains(msg, 'Boots') then
buy(cid,5312,getCount(msg),12000)
Kiedy nacisnę usuń wpis z ListBoxa1 sie usuwa i z mojego pliku tez ma sie usunąć ten wpis co wyżej. Jak to zrobic??
Oto kod mojego programu:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
ListBox2: TListBox;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Button1: TButton;
Button2: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Usuń: TButton;
Button3: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var a,b,c,d,e:string;
begin
a:=Edit1.Text;
b:=Edit2.Text;
c:=Edit3.Text;
d:='-';
e:=b+d+c+d+a;
ListBox1.Items.Add(e);
end;
procedure TForm1.Button2Click(Sender: TObject);
var f,g,h,i,j:string;
begin
f:=Edit1.Text;
g:=Edit2.Text;
h:=Edit3.Text;
i:='-';
j:=g+i+h+i+f;
ListBox2.Items.Add(j);
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
ListBox2.DeleteSelected;
end;
end.