Question about units

Issue #172 closed
Former user created an issue

I'am using DWSII 2.0.beta.1 now for a lot of years in D7. While in changing to Delphi 10.3 I am about to change to the current release of DWS.

In the old version there was no "uses" clause, one had to use {$INCLUDE 'LibName'} This lead in my case to a large memory consumption because of very much small scripts (event handlers) and a larger include. I endet up in merging the event handlers to one script.

Now that DWS has the "uses" clause I've tried to find out if there is a possibility to have a unit compiled once and use it in several IdwsProgram.

If this is possible, it would be nice if someone could point me the right direction.

Reagrds

Thomas

Comments (2)

  1. Anders Melander

    It is not possible to have script units precompiled, like dcu-files in Delphi, if that’s what you’re asking.

    Instead you just reference external unit files just like you would in Delphi. Make sure you have the DWS compiler search path set up before you compile.

    Basically you should structure your source exactly like you would in Delphi.

  2. Log in to comment