Files Delphi

Title: Set other file mode
Use FileMode variable for setting some of the valid modes for file.
0 - ReadOnly
1 - WriteOnly
2 - ReadWrite are valid modes.
procedure TForm1.Button2Click(Sender: TObject);
var
MyFile: TextFile;
begin
AssignFile(MyFile,Edit1.Text);
Reset(MyFile);
FileMode:=ComboBox1.ItemIndex;
CloseFile(MyFile);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
Edit1.Text:=OpenDialog1.FileName;
end;