雪
雪球
Unregistered / Unconfirmed
GUEST, unregistred user!
chart组件添加x,y坐标用的是类似于这样的语句吧。
series1.AddXY(needstr[count+1],needstr[count],'',clblue);
请大家帮我看看这段程序里的画图部分有什么错误
前面的都省略了
for j:=0 to num2-1 do //将字转为十进制数
begin
needstr[j]:=bintodec(binwordstr[j]); //needstr数组为我画图要用的数组
end;
edit4.Text:=floattostr(needstr[0]);
edit3.Text:=floattostr(needstr[1]);
count:=0; //设一个计数变量的初值
if num2>1 then //绘制U-I图(则点必须是成对的)
begin
if num2 mod 2 =0 then
begin
repeat
series1.AddXY(needstr[count+1],needstr[count],'',clblue);
memo1.Lines.Add(inttostr(s)+' '+floattostr(needstr[count])+
' '+floattostr(needstr[count+1]));
s:=s+1;
count:=count+2;
until
count=num2;
end
else
begin
repeat
series1.AddXY(needstr[count+1],needstr[count],'',clblue);
memo1.Lines.Add(inttostr(s)+' '+floattostr(needstr[count])
+' '+floattostr(needstr[count+1]));
s:=s+1;
count:=count+2;
until
count=num2-1;
end;
end;
showstr[step]:=needstr[0];
showstr[step+1]:=needstr[1];
step:=step+2;
progressbar1.StepIt;
if step=10 then
begin
series2.AddXY(strtoint(zhouqi),showstr[0],'',clblack);
a:=2;
for j:=1 to 9 do
begin
if j mod 2=0 then //判断j是否为偶数,奇数为电流,偶数为电压
begin
series2.AddXY(a*strtoint(zhouqi),showstr[j],'',clblack);
end
else
begin
series3.AddXY(a*strtoint(zhouqi),showstr[j],'',clblack); //series3为电压
end;
a:=a+1;
end; //for 循环end;
step:=0;
end; //一屏数据end;
end;
end;
series1的画图部分一直都有问题,会出现“Project Project 2.exe raised exception class EAccess Violation with message "Access violation at address 0041ECA in module 'Project 2.exe' write of address 000020F"的错误提示,
series2,series3则没有问题,而且needstr数组的值在memo显示里面会是一个错误的值,是不是chart赋值的变量有什么定义要求阿,必须是什么样的变量类型阿 ?
着急要用,请高人指点
series1.AddXY(needstr[count+1],needstr[count],'',clblue);
请大家帮我看看这段程序里的画图部分有什么错误
前面的都省略了
for j:=0 to num2-1 do //将字转为十进制数
begin
needstr[j]:=bintodec(binwordstr[j]); //needstr数组为我画图要用的数组
end;
edit4.Text:=floattostr(needstr[0]);
edit3.Text:=floattostr(needstr[1]);
count:=0; //设一个计数变量的初值
if num2>1 then //绘制U-I图(则点必须是成对的)
begin
if num2 mod 2 =0 then
begin
repeat
series1.AddXY(needstr[count+1],needstr[count],'',clblue);
memo1.Lines.Add(inttostr(s)+' '+floattostr(needstr[count])+
' '+floattostr(needstr[count+1]));
s:=s+1;
count:=count+2;
until
count=num2;
end
else
begin
repeat
series1.AddXY(needstr[count+1],needstr[count],'',clblue);
memo1.Lines.Add(inttostr(s)+' '+floattostr(needstr[count])
+' '+floattostr(needstr[count+1]));
s:=s+1;
count:=count+2;
until
count=num2-1;
end;
end;
showstr[step]:=needstr[0];
showstr[step+1]:=needstr[1];
step:=step+2;
progressbar1.StepIt;
if step=10 then
begin
series2.AddXY(strtoint(zhouqi),showstr[0],'',clblack);
a:=2;
for j:=1 to 9 do
begin
if j mod 2=0 then //判断j是否为偶数,奇数为电流,偶数为电压
begin
series2.AddXY(a*strtoint(zhouqi),showstr[j],'',clblack);
end
else
begin
series3.AddXY(a*strtoint(zhouqi),showstr[j],'',clblack); //series3为电压
end;
a:=a+1;
end; //for 循环end;
step:=0;
end; //一屏数据end;
end;
end;
series1的画图部分一直都有问题,会出现“Project Project 2.exe raised exception class EAccess Violation with message "Access violation at address 0041ECA in module 'Project 2.exe' write of address 000020F"的错误提示,
series2,series3则没有问题,而且needstr数组的值在memo显示里面会是一个错误的值,是不是chart赋值的变量有什么定义要求阿,必须是什么样的变量类型阿 ?
着急要用,请高人指点