The concept of protected procedures is explained in section “Protected Procedures”. The status of a procedure can be changed via the procedure interface dialog. To manage the status of multiple procedures at once, click Menu Procedures ▹ Manage Procedures and select the tab card Manage Passwords.
If you want to protect a procedure with a password, do the following:
Then, a separate window appears and the new password must be entered twice (see figure 6.51). If both times the same password is used, clicking OK assigns the password. Otherwise, an error message is displayed and you have to repeat the password assignment. When a protected procedure is finally saved, it is stored in a binary format.
If you set up a password for the main procedure, you may optionally lock the entire program, i.e., protect all local procedures with the same password. The same mechanism works for library procedures: You may either protect the library procedures individually, or protect the entire library at once (see page 167). If individual local procedures have been password-protected before, this option will only work, if the same password is selected. Otherwise you will have to remove all other passwords from local procedures before locking the entire program.
Figure 6.51: Entering a password to protect a procedure. The option “Lock entire...” is only available for the main() procedure.
When you start HDevelop the next time, the protected procedure is locked, i.e., when trying to edit the procedure, e.g., by selecting it from the combo box in the program window, a corresponding message is displayed in the program window see figure 6.52). Additionally, a password button is displayed in the program window. Upon entering the correct password, the procedure remains unlocked for this session, i.e., until you close HDevelop or lock the procedure again manually.
Changing the Status of a Protected Procedure
To change the status of a protected procedure, you must first unlock it by entering the password. Then, you can use the procedure interface dialog to change the password or remove the password entirely. Click the button Password to change the status.
Figure 6.53: Changing the status of a protected procedure. The option “Unlock entire...” is only available if local procedures have been locked at once.
The following options are available:
When working with protected procedures, be aware that the password cannot be reconstructed, so be very careful not to forget it and not to repeat a typing error when assigning it! Further, in some situations protected procedures behave differently from common procedures. In particular, as they cannot be viewed and modified by unauthorized users, they also cannot be copied, printed, or exported to any programming language (however, they can be duplicated using the menu entry Menu Procedures ▹ Duplicate...). Additionally, if a protected procedure contains a call to another procedure for which the interface was changed, the procedure call is not adapted to the changes but is disabled for the current program.