delphi - 记录文件错误

标签 delphi delphi-2007 record

我正在使用Delphi 2007,我正在尝试制作记录类型文件。在 Delphi 7 中对我来说没有任何问题。

Type
Kompiuteris = record
...
end;
Failas = file of Kompiuteris;

但是在 Delphi 2007 中我遇到了问题。错误表明:类型“Kompiuteris”需要最终确定。那么,到底出了什么问题呢?

最佳答案

来自documentation :

Certain types are treated specially by the compiler on an internal basis in that they must be correctly finalized to release any resources that they might currently own. Because the compiler cannot determine what type is actually stored in a record's variant section at runtime, it is not possible to guarantee that these special data types are correctly finalized.

String is one of those data types which need finalization, and as such they cannot be stored in a File type.

关于delphi - 记录文件错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2410351/

相关文章:

delphi - 使用.AsString 还是.Text?

delphi - 表单中的消息 'ToolsAPI not found'

multithreading - 从 OnTimer 事件访问父窗体中的变量 - 获取异常

ios - 如何在后台开始录制 iOS Audio Session ?

delphi - 在 TWebBrowser 中手动编写 HTML

delphi - 为什么 DoubleBuffered 默认被禁用?

delphi - Adoconnection 在打开 Delphi 时要求输入用户名和密码

delphi - 无法加载 SSL 库

Erlang - 列表推导式 - 填充记录

flash - 如何录制/拼接FLV片段?