I use assert checks throughout my code, in fact I try to check variables
and parameters religiously (unfortunately my grasp of religion must be
patchy).
One common check is of the type...
Assert Vartype(liValue,.t.) = 'N' Message 'General Error - Stop and
investigate!' + Chr(13) + 'Variable (liValue) not valid type.'
Assert int(liValue) = liValue Message 'General Error - Stop and
investigate!' + Chr(13) + 'Variable (liValue) not INT (Probably)'
(Yes I know the message is daft but it helps to stop me just continuing
through them thinking they are assert .f. lines that I use all over.)
To save the typing I was looking at using #defines to automate the lines
but you can't enter variable in the #defines to expand out. This leaves
coding them in or using a global object to test the values (I use this
for critical code sections in the live systems just to make sure anyway)
but this adds to the overheads especially even if you check on call if
you are in dev mode (.lDevMode = Version(2) = 2)
Can you think of a better way?
--
Michael Hawksworth
Visual Fox Solutions
[EMAIL PROTECTED]
www.foxpro.co.uk
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.