delphi 数组如何动态增加
//下面是一记录,三维坐标
type
Tposition = record
x:integer;
y:integer;
z:integer;
end;
//======下面是要在一个循环中动态地增加三维坐标数据的长度
//请问如何写会高效。
produce getposition(Sender: TObject)
var
position:array of record;
begin
。。。
for i =A to B do
if k then
position增加一个C(xc,yc,zc)的数; //这里如何写?
。。。
end;
请大侠指点。谢谢!!
SetLength
starluck:
具体如何写?
每次都用setlength?
SetLength(Length(position)+1)
position:array of record; //貌似应当是position:array of Tposition;
____________
SetLength(position, Length(position) + 1);
with position[Length(position) - 1] do
begin
x := xc;
y := yc;
z := zc;
end;
相关问答:
原文地址:http://hi.baidu.com/sqldebug/blog/item/58a764624a44d74eeaf8f863.html
一、如何限制系统服务和桌面程序只运行一个
如何限制系统服务和桌面程序只运行一个
在工程加入下列代码可以 ......
[size=18px]var s,n:integer;
begin
write('输入变长的条数n');
readln(n);
[color=#FF0000]s:=n*(n-1)*(n-2)div 6; //本行替换为s:=n*(n-1)*(n-2)/ ......
delphi 函数:
function RB(A: longint): longint;
begin
Result := (A shr 24) or ((A shr 8) and $FF00) or ((A shl 8) and $FF0000) or (A shl 24);
end;
我转成C#:
& ......
我尝试一个 idhttp 访问网站链接的程序
在设置代理端口的时候出错
编译没有错误
就是在运行的时候 出现了
80 is not a valid integer value 的问题
我已经把 函数分类出来的 port 转换为 integer 了 ......