Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is ASSERT used for?
Message
From
28/09/1998 19:29:22
 
 
To
28/09/1998 19:09:22
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00141677
Message ID:
00141682
Views:
28
>Hi everyone!
>
>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?
>
>Thanks a lot!
>
>Sylvain

ASSERT is used as a programmer tool to help prevent errors. If the assert evaluates to .F., then a dialog box is displayed. In Christof's example, if tcoption is anything other than character, the error is triggered. It is used here to make sure the parameter is of the correct type. When you distribute your application, you can SET ASSERT OFF and the assert will be ignored.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform