From: Wizzup?
Niels, has this been fixed?
We don't have the file procedures normal script have but Niels can prob just use TFileStream.
TSaveDialog, tFileStream example.
program new;
function SaveDialog(Data: string): boolean;
var
fmCustom: Word;
begin
Result := False;
fmCustom := fmCreate;
try
with TSaveDialog.Create(nil) do
begin
try
Title := 'Save Dialog';
Options := [ofOverwritePrompt];
InitialDir := IncludePath + 'msi\';
Filter := 'Text File (*.txt)|*.txt|All Files (*.*)|*.*';
FilterIndex := 1;
DefaultExt := 'txt';
if (Execute) then
begin
if (FileExists(FileName)) then
fmCustom := fmOpenWrite;
with TFileStream.Create(FileName, fmCustom) do
begin
try
if (Write(Data, SizeOf(Data)) > 0) then
begin
Result := True;
WriteLn('Sucessfully saved: ' + FileName);
end;
finally
Free;
end;
end;
end;
finally
Free;
end;
end;
except
WriteLn(ExceptionToString(ExceptionType, ExceptionParam));
end;
end;
procedure init;
begin
SaveDialog('bleh?')
end;
begin
end.