>I recently aquired Visual Studio 6 and I bought a copy of FoxPro Advisor with that (October issue).
>
>In his article about the report-wrapper class (p.41 to 49), Chistof Lange uses the ASSERT command (like ASSERT TYPE("tcOption") == "C").
>
>I fail to see what this command does, and VFP's help isn't helping...
>
>Anyone care to elaborate?
ASSERT checks a condition, and if it isn´t true, shows up an error message. (There even is a MESSAGE option to allow for your own text.)
We use ASSERT regularly to check for all "expected" conditions. For example, all routines verify that their parameters are of the correct type (as in the FP Advisor example). We also use ASSERTs in DO CASE structures as shown:
DO CASE
CASE condition1
...
CASE condition2
...
...
OTHERWISE
ASSERT .F.
ENDCASE
We try to check for
all conditions in the CASE (even if it means that some CASE will have no associated code) so the OTHERWISE clause should never be executed.
Believe me, I will use
anything that helps avoiding errors!!
HTH!