Generic way to test if all the propertiers of an object are null
I need a generic way to check if all the properties on an object instance are null. Has anyone got some code they could share?
I could of course add a method to each class and pass in all the properties and test them but I'm sure there must be a generic way to do this. A generator method perhaps?
Regards
Mike
Something like this? I had a similar problem, but the check was required only for part of the properties. If you want all of them, remove the line with continue.
Hi Eduard,
Perfect! Just what I wanted. By the way there is a little bug as prop is all lower case in the CONTINE line but 'Prop' everywhere else.
Thanks again
Regards
Mike
If your class inherits properties from another class, substitute %compiledclass for %class in the solution above.