开发者

DWScript uses clause

开发者 https://www.devze.com 2023-03-05 01:38 出处:网络
I\'ve hit a wall with DWScript trying to \"use\" other 开发者_JS百科units example: uses utils, qusers;

I've hit a wall with DWScript trying to "use" other 开发者_JS百科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


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:

{$IFNDEF SOME_FILE}
{$DEFINE SOME_FILE}

... the file ...

{$ENDIF}

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号