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;
相关问答:
[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#:
& ......
project project3.exe raised exception class ERemotableException with message 'access violation at address 004037B in module'project2.exe'.read of address 00000003'.process stopped.use ......
我调用vc的dll,传送结构体参数。vc接受后从内存中拷贝出我传送的值。转换之后是乱码
结构体怎么定义的?
//向终端发送门禁报警信息
function alarmSentDoor(var pDoorPara :Alley_ALARM_PARA) ......
从数据里读出一些数据放到一个listview里 然后用户要搜索‘跑车’ 我就要把只要有跑车字眼的数据都取出来比如’法拉利跑车‘ 请问 这个字符串怎么比较呀? 不能在数据库里写存储过程来取,只能在当前的listvie ......