delphi4arab منتديات دلفي للعرب
الكتابة أو القرائة من نص - نسخة قابلة للطباعة

+- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum)
+-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3)
+--- قسم : مصادر دلفي مفتوحة تعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=14)
+--- الموضوع : الكتابة أو القرائة من نص (/showthread.php?tid=3400)



الكتابة أو القرائة من نص - abdalrhman - 06-09-2011

السلام عليكم ورحمة الله
الكتابة داخل نص أو القرائة منه وطرحه على شكل memo
كود :
unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) OpenDialog1: TOpenDialog; Memo1: TMemo; Memo2: TMemo; Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; Afile:textfile; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var Afile:textfile; S:string; begin AssignFile(Afile,OpenDialog1.FileName) ; Append(Afile) ; s:=memo1.Lines.Text; Writeln(Afile,s); CloseFile(AFile) ; end; procedure TForm1.Button2Click(Sender: TObject); var Afile:textfile; S:string; begin AssignFile(Afile,OpenDialog1.FileName) ; Append(Afile) ; s:=memo2.Lines.Text; Writeln(Afile,s); CloseFile(AFile) ; end; end.