Easier Defined() Check for Module's Objects
Posted: Sun Dec 18, 2016 4:37 pm
When I want to safely check if a module's object is available with Defined(), I first have to make sure that the module itself is defined:
If MyModule isn't defined, PureBasic throws an "Module not found" error. I think it would be better to support the following more streamlined way as well:
Code: Select all
Debug "Module's procedure defined? -> " + Bool(Defined(MyModule, #PB_Module) And Defined(MyModule::Proc, #PB_Procedure))
Code: Select all
Debug "Module's procedure defined? -> " + Defined(MyModule::Proc, #PB_Procedure)