Type
TMoveType=record
LeftTopBool:Boolean;
TopCenterBool:Boolean;
RightTopBool:Boolean;
RightCenterBool:Boolean;
RightBottomBool:Boolean;
BottomCenterBool:Boolean;
LeftBottomBool:Boolean;
LeftCenterBool:Boolean;
InFrameBool:Boolean;
OutFrameBool:Boolean;
end;我如何写成别的类型 或者 怎么把他作为全局参数调用并修改内容
如
Type
TMoveType=class
LeftTopBool:Boolean;
TopCenterBool:Boolean;
RightTopBool:Boolean;
RightCenterBool:Boolean;
RightBottomBool:Boolean;
BottomCenterBool:Boolean;
LeftBottomBool:Boolean;
LeftCenterBool:Boolean;
InFrameBool:Boolean;
OutFrameBool:Boolean;
end;
TMoveType=record
LeftTopBool:Boolean;
TopCenterBool:Boolean;
RightTopBool:Boolean;
RightCenterBool:Boolean;
RightBottomBool:Boolean;
BottomCenterBool:Boolean;
LeftBottomBool:Boolean;
LeftCenterBool:Boolean;
InFrameBool:Boolean;
OutFrameBool:Boolean;
end;我如何写成别的类型 或者 怎么把他作为全局参数调用并修改内容
如
Type
TMoveType=class
LeftTopBool:Boolean;
TopCenterBool:Boolean;
RightTopBool:Boolean;
RightCenterBool:Boolean;
RightBottomBool:Boolean;
BottomCenterBool:Boolean;
LeftBottomBool:Boolean;
LeftCenterBool:Boolean;
InFrameBool:Boolean;
OutFrameBool:Boolean;
end;
我把其中一个赋值TRUE 结果跟踪后还是全部为false
test : TMoveType; 做为全局的
然后test.LeftTopBool := True;在跟踪其结果是false? 要这样,LZ重装系统吧
begin
test.LeftTopBool := True;
end;
加了var,test的变化才会等同于 调用者传入的test变量
var
gTest: TMoveType;
public ChangeRecord(mtRec: TMoveType);
begin
mtRec.LeftTopBool = true;
end;public TestChange();
begin
ChangeRecord(gTest);
end;在上面这个例子里执行testchange之后 gtest不会发生任何变化,主要是传参时发生完整copy了,像这样的场合delphi中可能还有你没有注意到的地方,最好能看一下你的代码片段.
[/code]