[Gambas-user] how to detect if class.load was susessfully?

Benoît Minisini g4mba5 at gmail.com
Mon Jul 16 21:26:32 CEST 2018


Le 16/07/2018 à 19:15, PICCORO McKAY Lenz a écrit :
> i can check at runtime if "that" module exist or not compiled into the
> executable?
> Lenz McKAY Gerardo (PICCORO)
> http://qgqlochekone.blogspot.com
> 
> 

If you check the existence of a class just to load it, then you can just 
call Class.Load().

Otherwise, you can use the Class.Stat() method from the gb.util 
component. It will fail if a class name cannot be loaded, without trying 
to actually load it.

Or you can check the existence of the local path ".gambas/CLASSNAME", 
but then you depend on the structure of the executable archive.

Beware that all that won't work if your class/module is not located in 
the main project but in a library or in a component.

Regards,

-- 
Benoît Minisini


More information about the User mailing list