简体   繁体   English

在TdwsUnit中记录方法

[英]Record methods in TdwsUnit

Is there a way to add methods to records in a TdwsUnit? 有没有一种方法可以向TdwsUnit中的记录添加方法? It seems the members property only allows you to add fields. 似乎members属性仅允许您添加字段。 And is it possible to register constructors as well? 是否可以注册构造函数?

Not yet, the TdwsRecord.DoGenerate method doesn't support them yet... 尚未,TdwsRecord.DoGenerate方法尚不支持它们...

Record constructors aren't supported at the moment, I'm considering reserving the syntax for true constructors (ala C++), you can achieve Delphi-like record constructor by using class functions (though due to the above limitation, they can currently only be declared in script code). 目前不支持记录构造函数,我正在考虑为真正的构造函数(ala C ++)保留语法,您可以使用类函数来实现类似Delphi的记录构造函数(尽管由于上述限制,它们目前只能在脚本代码中声明)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM