Easier Defined() Check for Module's Objects

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Easier Defined() Check for Module's Objects

Post 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)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!