https://youtu.be/41J0TqQjK3k
Bom Dia/Boa Tarde/Boa Noite
Esse Ao Vivo vai estrear as 11:00 do dia 05/09/2020
DICAS 3059 -WINDEV TUTORIAL 82 -Licao 7.2-05-09-2020 11hrs-GERENCIAMENTO AUTOMATICO ERROS
Tutoriel WINDEV : Leçon 7.2. Programmation avancée - Gestion automatique des erreurs
ASSUNTOS
O QUE SERA VISTO
VISAO GERAL
MODO OPERACIONAL
MOSTRANDO UM CODIGO SOBRE MODO OPERACIONAL
IMPLEMENTACAO
TIPOS DE ERROS AFETADOS
GERENCIMANTO AUMATICO DE ERROS - EXEMPLO
QUAIS JANELAS DE ERROS
MOSTRANDO CADA ERRO E EXPLICANDO
Video original da Franca
Playlist Windev TUTORIAL
Playlist windev Franca
Repositorio Windev
PlayList Pedrosao
Windev
WxSolucoes
Matos Informatica
Amarildo
DICAS 2978 - WINDEV TUTORIAL 1 - 1.1B - WINDEV TEMA ESCURO E IDIOMA DO AMBIENTE
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C
DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C
Lesson 7.2. Automatic management of errors
- What is the automatic management of errors?
- Using the automatic management of errors.
Estimated time: 10 mn |
Previous Lesson | Table of contents | Next Lesson |
The errors can be automatically managed by WINDEV. This feature helps you reduce the number of code lines while centralizing the management of errors.
The use of this feature also makes the code easier to read.
Operating mode
Two operations are performed when an error is detected by a WLanguage function:
- an error value is returned by the function (for example, fOpen returns "-1" if the specified file was not opened).
- WLanguage detects the error (the ErrorOccurred variable is set to True), and its details can be retrieved using ErrorInfo.
This second operation can be automatically managed by the error management of WINDEV.
Implementation
The automatic management of errors can be configured:
- in the code editor: all you have to do is click the link "If error: By program" in the code editor:
- by programming with ErrorChangeParameter.
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.
- To understand the different error cases, we will be using a training example supplied with WINDEV.
- Display the WINDEV home page if necessary (Ctrl + <).
- On the home page, click "Open an example". The list of complete examples, training examples and unit examples supplied with WINDEV is displayed.
- Type "Error" in the search area. Only the examples containing this word are listed.
- 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.
- Run the project test by clicking (among the quick access buttons).
- Click "Managing a non-fatal error".
- The following window is displayed.
- Click the "Test this error management" button.
- When running the code line that triggers the error, an error message is displayed, allowing the user to retry the operation, cancel the operation or stop the application. The "Debug" option should be used:
- in test mode, to directly debug the application.
- in executable mode, to debug an executable directly from WINDEV.
- Click "Cancel the operation" and close the window.
- Click "Managing a fatal error".
- The following window is displayed. This window is used to check the error when an integer is divided by 0.
- Click the "Test this error management" button.
- When running the code line that triggers the error, a procedure is automatically called. This procedure is used to display the error message and to stop the current process.
- Click "OK" and close the window.
- The following window is displayed. This window is used to check the error when an integer is divided by 0.
- Click "Managing an error on several levels".
- The following window is displayed. This window is used to test an error on several levels (process calling a procedure that opens an archive that does not exist).
- Click the "Test this error management" button.
- When running the code line that triggers the error:
- the procedure returns "False" to the calling process.
- the calling process displays an error message and stops the process.
- Click the "Cancel the operation" button.
- The following window is displayed. This window is used to test an error on several levels (process calling a procedure that opens an archive that does not exist).
- Stop the application test.
Example | WINDEV also proposes an automatic management of HFSQL errors. See the "Detecting HFSQL errors" training example (supplied with WINDEV) for more details. This example is accessible from the WINDEV home page. |
Nenhum comentário:
Postar um comentário