S
sjz_no1
Unregistered / Unconfirmed
GUEST, unregistred user!
看看下面的代码都用了那些的编码风格的特点?尽可能的列出来.
// 字段列表功能
class function ListFieldsStr(_feild_list: TList;
_is_include_id: Boolean = True;
_is_include_no_cache: Boolean = True;
_is_no_cache_only: Boolean = False
): string;
class function TBaseDBUtility.ListFieldsStr(_feild_list: TList;
_is_include_id: Boolean
_is_include_no_cache: Boolean;
_is_no_cache_only: Boolean): string;
var
i : Integer;
p_field_info : PBaseDBFieldInfo;
begin
Result := '';
for i := 0 to _feild_list.Count - 1 do
begin
p_field_info := PBaseDBFieldInfo(_feild_list.Items);
// 是否 只包含 非缓存 字段
if _is_no_cache_only then
begin
if p_field_info^.IsCache then
Continue;
// 子表字段 不缓存
if (p_field_info^.FieldType = ftDetailTable) or
(p_field_info^.FieldType = ftMultiRef) then
Continue;
end
else begin
if not _is_include_id and p_field_info^.IsIDField then
Continue;
// 如果 不包含 非缓存 字段,即仅包含缓存字段
if (not _is_include_no_cache) and
(not p_field_info^.IsCache) then
Continue;
end;
if Result = '' then
Result := p_field_info^.FieldName
else
Result := Result + ',' + p_field_info^.FieldName;
end;
end;
// 字段列表功能
class function ListFieldsStr(_feild_list: TList;
_is_include_id: Boolean = True;
_is_include_no_cache: Boolean = True;
_is_no_cache_only: Boolean = False
): string;
class function TBaseDBUtility.ListFieldsStr(_feild_list: TList;
_is_include_id: Boolean
_is_include_no_cache: Boolean;
_is_no_cache_only: Boolean): string;
var
i : Integer;
p_field_info : PBaseDBFieldInfo;
begin
Result := '';
for i := 0 to _feild_list.Count - 1 do
begin
p_field_info := PBaseDBFieldInfo(_feild_list.Items);
// 是否 只包含 非缓存 字段
if _is_no_cache_only then
begin
if p_field_info^.IsCache then
Continue;
// 子表字段 不缓存
if (p_field_info^.FieldType = ftDetailTable) or
(p_field_info^.FieldType = ftMultiRef) then
Continue;
end
else begin
if not _is_include_id and p_field_info^.IsIDField then
Continue;
// 如果 不包含 非缓存 字段,即仅包含缓存字段
if (not _is_include_no_cache) and
(not p_field_info^.IsCache) then
Continue;
end;
if Result = '' then
Result := p_field_info^.FieldName
else
Result := Result + ',' + p_field_info^.FieldName;
end;
end;