Consultor Eletrônico



Kbase P13792: How to create a login request procedure
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   3/10/2003
Status: Unverified

GOAL:

How to create a login request procedure

GOAL:

How to write a procedure that asks for a login (username + password) a limited number of times.

FIX:

Use a counter that keeps track of how many attempts at entering the username/password have been made. The following steps explain how:

1. In the procedure that asks for the username/password, include an integer variable which will be used to count the number of attempts so far.

2. Each time the username/password is entered, increase the counter variable by one.

3. If an incorrect password is entered, check if the maximum number of attempts is reached by checking the value of the counter.
- If the maximum number is not yet reached, ask for the password again.
- If the maximum number of attempts is reached, exit the program.

The way this is implemented depends on whether the program asking the password is procedure-driven or event-driven.