//这个过程的目的,只是想把listbox1中的各项,赋值给数组b
procedure Set_Order();
type b1=array of integer;
var
n,i:integer;
b:b1;begin
n:=form1.ListBox1.Items.Count;
for i:=1 to n do
begin
showmessage(inttostr(i));
showmessage(form1.ListBox1.Items[i-1]);
b[i]:=strtoint(trim(form1.ListBox1.Items[i-1]));/*就是这句出错了,而且编译时没错,运行时,我在listbox1中加入数字时,然后再让他赋值时,就出现了'Project xxxx raised exception class yyyyy with message 'zzzzzz'.Process stopped. Use Step or Run to continue.'提示,然后程序中止运行,但我肯定,listbox中输入的只是100以内的数字*/
end;end;
procedure Set_Order();
type b1=array of integer;
var
n,i:integer;
b:b1;begin
n:=form1.ListBox1.Items.Count;
for i:=1 to n do
begin
showmessage(inttostr(i));
showmessage(form1.ListBox1.Items[i-1]);
b[i]:=strtoint(trim(form1.ListBox1.Items[i-1]));/*就是这句出错了,而且编译时没错,运行时,我在listbox1中加入数字时,然后再让他赋值时,就出现了'Project xxxx raised exception class yyyyy with message 'zzzzzz'.Process stopped. Use Step or Run to continue.'提示,然后程序中止运行,但我肯定,listbox中输入的只是100以内的数字*/
end;end;
解决方案 »
- fastreport中 绑定数据自动换行问题
- delphi窗体 问题
- delphi7 结构体数组 解析。。
- 请教combobox1.text+'''为啥会报错?
- 哈哈。。。这年头也有我当官的份,高兴,散分!
- MIDAS设计中,如何实现动态显示刷新??
- 给50分简单问题!如何检测一个对象实例已经被创建?
- if ...else标准语法格式。
- TAdoDataset当其数据集为空时 不能插入(append)??怎么办
- 各位大哥:opendialog 这样用为什么不行?谢谢!
- activex 的难题!!!!关于 activex 控件包添加了 文件 在客户端调用的问题!!!!!!!
- qreport的横向打印 打不出全部内容 !!!!!!!!!!!!!!急!!!!
真的不明白
type b1=array of integer;
var
n,i:integer;
b:b1;begin
n:=form1.ListBox1.Items.Count; setLength(b,n);//加上这句,为动态数组设置长度 for i:=0 to n-1 do
begin
showmessage(inttostr(i));
showmessage(form1.ListBox1.Items[i]);
b[i]:=strtoint(trim(form1.ListBox1.Items[i]));
end;
end;