type
Tsql = record
FieldN: string; //字段名
Condition: string; //条件
FieldV: string; //字段值
Login: string; //逻辑 or and
end;
IndexSql = ^Tsql; new(myrecord);
with myrecord^ do
begin
FieldN := '用户名称';
Condition := '=';
FieldV := '''梦妹''';
Login := 'or';
end;我定了如上的记录结构,然后我会不断地向里面增加记录,请问如何知道这个 myrecord的记录总数,还有,用完时想释放应该用什么函数?请大家帮忙.
Tsql = record
FieldN: string; //字段名
Condition: string; //条件
FieldV: string; //字段值
Login: string; //逻辑 or and
end;
IndexSql = ^Tsql; new(myrecord);
with myrecord^ do
begin
FieldN := '用户名称';
Condition := '=';
FieldV := '''梦妹''';
Login := 'or';
end;我定了如上的记录结构,然后我会不断地向里面增加记录,请问如何知道这个 myrecord的记录总数,还有,用完时想释放应该用什么函数?请大家帮忙.
定义全局型变量
FCount:integer;
MySQLs:array of IndexSQL;
初始化:
FCount :=0;
setlength(MySQLs,0);
采用如下添加记录方式
inc(FCount);
setLength(MySQLs,FCount);
MySQLs[FCount-1] := new(TSQL);
with MySQLs[FCount-1]^ do
begin
...
end;