unit Unit2;
interface
uses
system.StrUtils,
system.Sysutils;
type
TSettings =
record
Show_Errors: Boolean;
Show_Questions: Boolean;
Delete_Fields: Boolean;
end;
type
TResult =
record
String_1:
string;
String_2:
string;
initFoo_MultiUser: Boolean;
initFoo_Done: Boolean;
initFoo_Error: Boolean;
end;
type
TFooMaker =
class
private
FSettings: TSettings;
public
constructor Create(
const ASettings: TSettings);
function init_FOO(
const _FooFileName, _FooDatabaseName:
string; _FooMultiUser: Boolean = True): TResult;
property Settings: TSettings
read FSettings;
end;
const
BR = #13#10;
DBR = BR + BR;
implementation
constructor TFooMaker.Create(
const ASettings: TSettings);
begin
inherited Create;
FSettings := ASettings;
end;
function TFooMaker.init_FOO(
const _FooFileName, _FooDatabaseName:
string; _FooMultiUser: Boolean = True): TResult;
var
StringTest:
string;
begin
try
Result.String_1 := _FooFileName;
Result.String_2 := _FooDatabaseName;
Result.initFoo_MultiUser := _FooMultiUser;
Result.initFoo_Done := (Trim(_FooFileName) <> '
')
and (Trim(_FooDatabaseName) <> '
');
if Trim(_FooFileName) = '
EXCEPTION'
then
begin
StringTest := '
';
StringTest := StringTest[1];
Result.initFoo_Done := True;
end;
Result.initFoo_Error := False;
except
if Settings.Show_Errors
then
Result.initFoo_Error := True;
Result.initFoo_Done := False;
end;
end;
end.