Delphi 5:作为函数参数传递时的常量变化值

时间:2020-12-11 20:19:21

I have one spot in very old code (15 years) that has just started acting up:

我有一个非常古老的代码(15年),刚刚开始表演:

cTemp := tblMemList.FieldByName('TTType').AsString;

cTemp:= tblMemList.FieldByName('TTType')。AsString;

in Delphi's DB.pas, the FieldByName function's passed "FieldName" constant shows a value of 'lick on Save or Cancel', not 'TTType'.

在Delphi的DB.pas中,FieldByName函数传递的“FieldName”常量显示“保存或取消时舔”的值,而不是“TTType”。

I thought at first that it might be caused by being in a somewhat large pas unit (about 17k lines), so I broke it up into two pas units, but with no effect.

我一开始以为它可能是因为在一个有点大的舞台单元(大约17k线),所以我把它分成两个舞台单元,但没有效果。

I'm stumped. Any thoughts?

我很难过。有什么想法吗?

2 个解决方案

#1


0  

The cause ended up being too many components on one form. It had about 1,500 components on it. When I removed about 300, the problem went away. It felt like a memory/resources issue.

原因导致一个表单上的组件太多。它上面有大约1,500个组件。当我删除大约300时,问题就消失了。这感觉就像是一个记忆/资源问题。

So, my next step is to re-structure that form so that I can get 1,500 (or more) components on it without causing this problem again.

因此,我的下一步是重新构造该表单,以便我可以在其上获得1,500(或更多)组件,而不会再次导致此问题。

If anyone has any suggestions on other solutions, I would love to hear them.

如果有人对其他解决方案有任何建议,我很乐意听到。

#2


-1  

I would use an intermediary to debug:

我会使用中介来调试:

field := tblMemList.FieldByName ('TTTYpe') ;
cTemp := field.asString ;

#1


0  

The cause ended up being too many components on one form. It had about 1,500 components on it. When I removed about 300, the problem went away. It felt like a memory/resources issue.

原因导致一个表单上的组件太多。它上面有大约1,500个组件。当我删除大约300时,问题就消失了。这感觉就像是一个记忆/资源问题。

So, my next step is to re-structure that form so that I can get 1,500 (or more) components on it without causing this problem again.

因此,我的下一步是重新构造该表单,以便我可以在其上获得1,500(或更多)组件,而不会再次导致此问题。

If anyone has any suggestions on other solutions, I would love to hear them.

如果有人对其他解决方案有任何建议,我很乐意听到。

#2


-1  

I would use an intermediary to debug:

我会使用中介来调试:

field := tblMemList.FieldByName ('TTTYpe') ;
cTemp := field.asString ;