user497849
user497849

Reputation:

DWScript uses clause

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

Upvotes: 3

Views: 586

Answers (1)

Eric Grange
Eric Grange

Reputation: 6211

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.

Upvotes: 2

Related Questions