I am struggling to create a project that is tidy in the fact that it uses units to sub divide the project into units.
The tests work OK when they are all in the same unit with main calling all the functions 1 by 1 in turn. When I try to port the tests into a seperate unit I cannot find any way of scripting such that the main routine in unit1 calls each of the functions held in unit2 in turn. I have put the USEUNIT Unit1 statement at the top of Unit2 and tried in the main routine to put the following line in (it would work if used in an application):
Running it I get a message saying Unit2 not defined.
I am using C# script and have looked through the helpfile for any tips but there does not appear to be any information that is of use. It does mention that circular references are not allowed in C#, J script and I am wondering if what I am trying to do is not supported in C# script.
I really dont want to have to have all my tests in 1 unit as it would get unmanagable once the number of functions gets more than 5.
Oh, I just really read your comment. You don't reference a script unit name when you call a function within it. If your function is in unit 2 and you include unit 2 in unit 1, then you can just call Function() directly. The dot syntax is only necessary for accessing children of objects and Units are not objects.
Just to add to Dan's response: you should add the USEUNIT UnitX statement in every unit that is going to call functions from UnitX.
After you have done that, you can call functions located in UnitX from other units using just the names of the functions.