I think this is what you're looking for : ref
In reply to Re: Detecting declaration type? by RichardK in thread Detecting declaration type? by LanX