我要较验一组数据
function IsArrayValid(BA:string):Boolean;
var
i,mint:integer;
mbyte:byte;
marray:array of integer;
mstr:string;begin mbyte:=$d2;
for i:=1 to 29 do
begin
setlength(marray,29);
marray[i-1]:=strtoint(ba[i]);
mbyte:=mbyte xor marray[i-1];
end;
mint:=strtoint(ba[30]);
if mbyte<>mint then
result :=false
else
result :=true;
end;function IsValid(BA:string):Boolean;
var
i,mhigh,mint:integer;
mbyte:byte;
marray:array of integer;
mx:string;begin
mbyte:=$d2;
for i:=7 to mhigh-2 do
begin
setlength(marray,mhigh-8);
mx:=ba[i];
mint := strtoint(mx);
marray[i-7]:=mint;
mbyte:=mbyte xor marray[i-7];
end;
mint:=strtoint(ba[mhigh-1]);
if mbyte<>mint then
result :=false
else
result :=true;
end;
function IsArrayValid(BA:string):Boolean;
var
i,mint:integer;
mbyte:byte;
marray:array of integer;
mstr:string;begin mbyte:=$d2;
for i:=1 to 29 do
begin
setlength(marray,29);
marray[i-1]:=strtoint(ba[i]);
mbyte:=mbyte xor marray[i-1];
end;
mint:=strtoint(ba[30]);
if mbyte<>mint then
result :=false
else
result :=true;
end;function IsValid(BA:string):Boolean;
var
i,mhigh,mint:integer;
mbyte:byte;
marray:array of integer;
mx:string;begin
mbyte:=$d2;
for i:=7 to mhigh-2 do
begin
setlength(marray,mhigh-8);
mx:=ba[i];
mint := strtoint(mx);
marray[i-7]:=mint;
mbyte:=mbyte xor marray[i-7];
end;
mint:=strtoint(ba[mhigh-1]);
if mbyte<>mint then
result :=false
else
result :=true;
end;
解决方案 »
- 读取别人图片保存遇到的问题?
- 获取鼠标选择DBGrid一行的数据
- 数据库读取和写入问题
- 我觉得Borland公司极其没有眼光,不善于把握机会,跟随Borland公司是没有前途的。
- 关于VCD的左右声道问题
- 高分求两个数据库之间表的导入问题!(分数不够,可以在加,up者有分)
- 我的错误在哪儿?关于SQL语句语法
- 在98下程序执行正确,2000下为什么报错??
- 各位哪个手上有一个进销存系统??要求设计理念合理,使用方便。请速与我联系!!我有一个客户需要一个这样的系统。
- 如何在BDE中连接dbf数据库?
- 十六进制的几个数 $30 $23 $23 $45 $21 $24 $40 使用什么方法能把这些数据存成常量, 最好能存成字符串或者是字符数组.
- MilliSecondOfTheMonth的用法问题
var
i,mint:integer;
mbyte:byte;
marray:array of integer;
mstr:string;begin mbyte:=$d2;
for i:=1 to 29 do
begin
setlength(marray,29); //设定数组长度
marray[i-1]:=strtoint(ba[i]); //把字符串转化为整形数组
mbyte:=mbyte xor marray[i-1]; //异或
end;
mint:=strtoint(ba[30]); //校验位
if mbyte<>mint then
result :=false
else
result :=true;
end;