{$APPTYPE CONSOLE}
program _WatchEnums;
uses
Windows
;
type
{$PACKENUM 1}
TDATA_TYPE = { prefix: dt_ }
(
dt_not_examined = 0,
dt_unknown,
dt_code_first,
dt_code_last,
dt_data_first,
dt_data_last,
{ make the filler and markers easy to recognize by setting their numeric }
{ values to easily identifiable numbers }
dt_pe_filler_first = 240, { filler is supposed to be }
dt_pe_filler_code, { inaccessible }
dt_pe_filler_data,
dt_pe_filler_last,
dt_markers_first = 250,
dt_marker_bottom, { bottom message map sentinel }
dt_marker_top, { top " " " }
dt_markers_last
);
{$PACKENUM 4}
type
TRECORD = record
field_value : DWORD;
field_type : TDATA_TYPE;
field_info : array[0..5] of DWORD;
end;
function AFunction : boolean;
var
Table : array[0..9] of TRECORD;
ti : DWORD = 0;
begin
result := FALSE;
ZeroMemory(@Table, sizeof(Table));
for ti := 0 to 3 do
begin
with Table[ti] do
begin
field_value := ti;
Field_info[0] := ti;
case ti of
0 : field_type := dt_marker_bottom;
1, 2 : field_type := dt_pe_filler_code;
3 : field_type := dt_marker_top;
end;
end;
end;
result := TRUE;
end;
begin
AFunction();
readln;
end.