procedure TfrmDBStruct.IdxToValOpt(const fnc_idx: Integer; const chk_sums, chk_only: Boolean; const val_scope: Integer; var val_str: String; var val_opts: TValidateOptions);
begin
{Sweep
Kill Shadows
Mend
Validate}
case fnc_idx of
0:begin
val_opts := [SweepDB];
val_str := 'Sweep';
if chk_sums then
begin
val_str := val_str + ', Include Checksums';
end
else
begin
val_opts := val_opts + [IgnoreChecksum];
val_str := val_str + ', Ignore Checksums';
end;
end;
1:begin
val_opts := [KillShadows];
val_str := 'Kill Shadow Files';
end;
2:begin
val_opts := [MendDB];
val_str := 'Mend';
end;
3:begin
val_str := 'Validate';
if val_scope = 0 then
begin
val_opts := [ValidateDB];
val_str := val_str + ', (Pages only)';
end;
if val_scope = 1 then
begin
val_opts := [ValidateFull];
val_str := val_str + ', Full scope (Records and Pages)';
end;
if chk_sums then
begin
val_str := val_str + ', Include Checksums';
end
else
begin
val_opts := val_opts + [IgnoreChecksum];
val_str := val_str + ', Ignore Checksums';
end;
if chk_only then
begin
val_opts := val_opts + [CheckDB];
val_str := val_str + ', Check only (No fixes)';
end
else
begin
val_str := val_str + ', Check and Fix';
end;
end;
else
ShowMessage('Unknown Index for Validation Option');
end;
end;