Tuto WINDEV 25
Part 7: Advanced programming 395 Types of affected errors Two types of errors can occur in WLanguage: • the "non-fatal" errors (also called runtime errors): in most cases, these errors are managed in the code and they do not stop the application. For example, opening a file that cannot be accessed or an archive that does not exist. • the "fatal" errors (also called programming errors): in most cases, these errors are linked to a development problem (access to a non-declared file, use of non-existing controls ...). A "fatal" error can also occur after a "non-fatal" error that was not processed properly. In this case, the application will be stopped. The mechanism for managing errors is used to manage these two types of errors according to different methods in order to specify behaviors adapted to the errors that occur. Automatic management of errors: a training example ▶ To understand the different error cases, we will be using a training example supplied with WINDEV. 1. Display the WINDEV home page if necessary (Ctrl + <). 2. On the home page, click "Open an example". The list of complete examples, training examples and unit examples supplied with WINDEV is displayed. 3. Type "Error" in the search area. Only the examples containing this word are listed. 4. Select the "WD Auto Error Management" project. The project is loaded. ▶ This project presents the management: • of a non-fatal error (opening an archive that does not exist). • of a fatal error (division by 0). • of an error on several levels.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==