Witam,
Mam pytanie jak zrobic aby program wczytal plik (zalozmy) txt, w ktorym jest:
Nazwa X Y Z rX rY rZ jakis_tekst
do osobnych Edit'ow
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel; // name of part
Edit1: TEdit; // PosX
Edit2: TEdit; // PosY
Edit3: TEdit; // PosZ
Edit4: TEdit; // RotX
Edit5: TEdit; // RotY
Edit6: TEdit; // RotZ
Memo1: TMemo; // Others
Button1: TButton;
OpenDialog1: TOpenDialog;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
str: string;
T: TextFile;
begin
if OpenDialog1.Execute then // dialog
begin
AssignFile(T, OpenDialog1.FileName);
Reset(T);
Readln(T, str);
// wczytanie do MEMO
Memo1.Text:= str;
CloseFile(T);
end;
end;
end.
Szukalem wiele na ten temat lecz nic konkretnego nie znalazlem, byc moze zle szukalem, ale mysle ze wiecie o co chodzi i pomozecie. U mnie z Delphi nie jest najlepiej :)
Pozdrawiam
Bartosz Bieszka