New feature: #If Module(...)

does it applies to all .bas file?
i.e. #if Module(name) where name can be either a Class or a Code Module or a Service/Receiver?
what about b4xlibs or other libraries?
 
In B4X, a module is refer to Code Module and Class Module.
B4XLibs contains one or more of modules.
 
If this could "read" from a file, we could have an "include" mimic
 
This is not an "include" feature.

The use cases are mainly for libraries and other shared code. With this feature you can for example include different code based on the project type - whether it is a B4XPages project or not.

SimpleMediaManager is another example that can benefit from such feature. Instead of requiring the developer to add conditional symbols (e.g. SMM_VIDEO), the code can check if the required module is available. Not all cases are covered yet but it is a step in the direction.

Another use case - you created a useful module that you want to reuse in multiple projects. You can use this feature to customize it for a specific project without breaking:
Code: Copy
#If Module(SomeClassSpecificToProject8)
 Do something relevant to this project only, that won't compile in other projects
#End If
 
Back
Top