简体   繁体   English

在DWSWebServer中使用脚本RTTI

[英]Use Script RTTI in DWSWebServer

At the moment I'm playing a little bit with the DWSWebServer. 目前,我正在使用DWSWebServer。 I really like the idea of coding dynamic websites with a pascal style language. 我真的很喜欢用Pascal样式语言编码动态网站的想法。 Now I would like to implement a simple ORM using the script-side-RTTI. 现在,我想使用脚本端RTTI实现一个简单的ORM。 But the scriptcompiler does not know any RTTI functions or classes. 但是脚本编译器不知道任何RTTI函数或类。

Eg if I try the following code: 例如,如果我尝试以下代码:

var test := RTTIRawAttributes;

I will get: 我会得到:

Syntax Error: Unknown name "RTTIRawAttributes" [line: 16, column: 14]

I have already successfully compiled the latest version of the webserver, so is some option needed or library missing for RTTI support? 我已经成功编译了最新版本的Web服务器,因此是否需要某些选项或缺少支持RTTI的库?

Thanks for your help 谢谢你的帮助

Suddenly I got the answer on my own. 突然我自己得到了答案。 I had to include the "dwsRTTIFunctions.pas" Unit and recompile the server. 我必须包括“ dwsRTTIFunctions.pas”单元并重新编译服务器。 Now it works and I can use the RTTI inside my webscripts :) 现在它可以工作了,我可以在我的网页脚本中使用RTTI了:)

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

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