DWScript 使用子句
我在 DWScript 尝试“使用”其他单元时遇到了困难,例如:
uses utils、qusers;
语法错误:未知单位“utils”[行:3,列:20]
任何帮助将不胜感激。
附加信息:我还向 Script.Config.ScriptPaths 添加文件的位置,例如:“C:\myscripts”
附加信息2:“uses”用法的目的是“$INCLUDE”或“$I”有问题时间:
unit1.dws 包含unit2.dws
unit3.dws 包括unit3.dws 和unit1.dws
I've hit a wall with DWScript trying to "use" other units example:
uses utils, qusers;
Syntax Error: Unknown unit "utils" [line: 3, column: 20]
any help would be highly appreciated.
Additional info: I also add to Script.Config.ScriptPaths the location of files, for example: "C:\myscripts"
Additional info2: the purpose of "uses" usage was that "$INCLUDE" or "$I" had an issue when:
unit1.dws includes unit2.dws
unit3.dws includes unit3.dws and unit1.dws
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在当前 SVN 版本及更高版本上,您可以使用 $INCLUDE_ONCE,它仅包含尚未包含的文件(区分大小写)。
对于旧版本,您可以使用条件编译,就像在 C 头文件中一样:
编辑:从 2011 年 8 月开始,支持单元,它们必须从主脚本或另一个单元使用。请参阅测试\BuildScripts 以获取示例代码。
On current SVN version and beyond, you can use $INCLUDE_ONCE, which will include a file only if it hasn't been already included (it's case-sensitive).
For older versions, you can use conditional compilations, like in C header files:
Edit: As of august 2011, units are supported, they must be used from a main script or from another unit. See tests\BuildScripts for sample code.