主题:[em18]帮我看看我加???号的地方怎么么解释
type
dbfUserRec = record
filter: char;
userNo: array [1..9] of char; {编号}
userName: array [1..20] of char; {户名}
userAddr: array [1..20] of char; {地址}
meterNo: array [1..8] of char; {表号}
lastReading: array [1..8] of char; {上月读数}
thisReading: array [1..8] of char; {本月读数}
lastGoing: array [1..8] of char; {CS1}
readingDate: array [1..8] of char; {抄表日期}
readingFlag: char; {抄表标记}
meterReader: array [1..2] of char; {抄表员}
creditFare: array [1..10] of char; {欠费}
cost: array [1..5] of char; {电价}
HZ: array [1..10] of char;
end;
var
datafile: file;
numOfRecord: longint;
dbfRecSize: word;
dbfHeadSize: word;
end;
function dbfOpen(filename: string): boolean; {打开数据库}
var result: boolean;
dbfHead: array [1..32] of char;
reallyRead: word;
s: string;
begin
result:=false;
assign(dataFile, filename); {读取文件}
{$I-}
reset(dataFile, 1); {打开已有的文件}
{$I+}
if IOResult = 0 then begin {返回最新的I/O操作完成状态}
BlockRead(dataFile, dbfHead, 32, reallyRead); {读一个或多个记录到变量中}
if reallyRead = 32 then begin
clrscr;
seek(dataFile, 4); {????将文件的当前指针移动到指定的组件上}
BlockRead(dataFile, NumofRecord, 4); {??NumofRecord???}
writeln('4结果:',NumofRecord);
seek(dataFile, 8);
BlockRead(dataFile, dbfHeadSize, 2); {???dbfHeadSize??}
writeln('8结果:',dbfHeadSize);
seek(dataFile, 10);
BlockRead(dataFile, dbfRecSize, 2); {???dbfRecSize??}
writeln('10结果:',dbfRecSize);
writeln(sizeof(dbfuserrec));
readkey;
if dbfRecSize=Sizeof(dbfUserRec) then
result:=true;
else
close(datafile);
end;
end;
dbfOpen:=result;
end;
dbfUserRec = record
filter: char;
userNo: array [1..9] of char; {编号}
userName: array [1..20] of char; {户名}
userAddr: array [1..20] of char; {地址}
meterNo: array [1..8] of char; {表号}
lastReading: array [1..8] of char; {上月读数}
thisReading: array [1..8] of char; {本月读数}
lastGoing: array [1..8] of char; {CS1}
readingDate: array [1..8] of char; {抄表日期}
readingFlag: char; {抄表标记}
meterReader: array [1..2] of char; {抄表员}
creditFare: array [1..10] of char; {欠费}
cost: array [1..5] of char; {电价}
HZ: array [1..10] of char;
end;
var
datafile: file;
numOfRecord: longint;
dbfRecSize: word;
dbfHeadSize: word;
end;
function dbfOpen(filename: string): boolean; {打开数据库}
var result: boolean;
dbfHead: array [1..32] of char;
reallyRead: word;
s: string;
begin
result:=false;
assign(dataFile, filename); {读取文件}
{$I-}
reset(dataFile, 1); {打开已有的文件}
{$I+}
if IOResult = 0 then begin {返回最新的I/O操作完成状态}
BlockRead(dataFile, dbfHead, 32, reallyRead); {读一个或多个记录到变量中}
if reallyRead = 32 then begin
clrscr;
seek(dataFile, 4); {????将文件的当前指针移动到指定的组件上}
BlockRead(dataFile, NumofRecord, 4); {??NumofRecord???}
writeln('4结果:',NumofRecord);
seek(dataFile, 8);
BlockRead(dataFile, dbfHeadSize, 2); {???dbfHeadSize??}
writeln('8结果:',dbfHeadSize);
seek(dataFile, 10);
BlockRead(dataFile, dbfRecSize, 2); {???dbfRecSize??}
writeln('10结果:',dbfRecSize);
writeln(sizeof(dbfuserrec));
readkey;
if dbfRecSize=Sizeof(dbfUserRec) then
result:=true;
else
close(datafile);
end;
end;
dbfOpen:=result;
end;