Page 1 of 1

Easier Defined() Check for Module's Objects

Posted: Sun Dec 18, 2016 4:37 pm
by c4s
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:

Code: Select all

Debug "Module's procedure defined? -> " + Bool(Defined(MyModule, #PB_Module) And Defined(MyModule::Proc, #PB_Procedure))
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? -> " + Defined(MyModule::Proc, #PB_Procedure)