KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Note: Pinpoint Coding problems using 4D v12 Assertions
PRODUCT: 4D | VERSION: 12 | PLATFORM: Mac & Win
Published On: September 10, 2010

An assertion is a programming language statement that enables you to test your assumptions about your program. For example, if you write a method that calculates the speed of a particle, you might assert that the calculated speed is less than the speed of light.

This Technical Note discusses the use of four new commands in 4D v12 that implement the support of assertions in 4D: ASSERT, Asserted, Get assert enabled, and SET ASSERT ENABLED. The use of these commands are further enhanced by the additions of two new 4D system variables. Error method and Error line are used during the execution of an error-catching method installed by the ON ERR CALL command.

Download Complete Tech Note and Example: Windows | Mac