Page 1 of 1
User module selection
Posted: Sun Aug 14, 2011 9:00 am
by gramo
David Barker wrote:The compiler will recursively search any folder in the the 'UserLibrary' and use the first module that matches the required include - powerful, but you cannot control which module is found first...
Will a module in the "UserLibrary" parent folder
always take precedence to sub folders. For example;
UserLibrary\test.bas
UserLibrary\Sub Folder\test.bas
A quick test suggests it would..
Posted: Sun Aug 14, 2011 9:22 am
by David Barker
It depends on what the OS decides to give to the compiler first - file or folder. In short, you cannot guarantee any particular order.
Posted: Sun Aug 14, 2011 5:33 pm
by Jerry Messina
Graham,
One thing you CAN do (and I don't know if this helps with what you're trying to do) is to include the subdirectory name in the 'include' statement.
If you have:
UserLibrary\test.bas
UserLibrary\Sub Folder\test.bas
then in your .bas file you can use the syntax:
include "Sub Folder/test.bas"
and SF will find it. Note that you need to use a forward slash, and not a backslash.
This "trick" works because Windows interprets either as a path delimiter, and it seems that SF just passes it along, whereas a backslash doesn't work.
I don't know if this runs afoul of Dave's warning or not.
Posted: Mon Aug 15, 2011 1:04 am
by gramo
Cheers guys. I've had a couple of trial runs with your idea Jerry, things appear to work the way I'd like them to.