version 2004
EDIT FORM (table; form{; userForm{; library}})
Parameter | Type | Description | |
table | Table | Table of form to modify | |
form | String | Name of form to modify | |
userForm | String | Name of the user form to modify | |
library | String | Full pathname of usable object library |
Description
The EDIT FORM command opens the form set using the table, form and the optional userForm parameters in the User form editor:
Note: The window of the editor opens only if it is the first window of the processs. In other words, usually you will need to open a new process to display the editor.
If you pass an empty string in the userForm parameter and if there is not a user form already linked to form, the source form is displayed in the editor. The modified form is then copied in the user structure file (.4DA) and will be used as a form replacement.
If a user form was already generated from form using this command, the user form is displayed in the editor. If you want to start from the source form, you must first delete the user form using the DELETE USER FORM command.
The userForm parameter allows setting a user form (created using the CREATE USER FORM command) to modify. In this case, the form is displayed in the editor.
In the optional library parameter, pass the full access path of the object library that the user will be authorized to use to customize the form. When used with the User form editor, object libraries will allow you to paste objects with their graphic properties and automatic actions. Objects with methods do not appear in the library. Be careful, it is up to the developer to make sure that the addition of library objects is compatible with the user form (and its objects) in terms of names, variables and types.
In client/server mode, the library must be found in the Extras folder of the database, at the same level as the Plugins folder, so that it is available for all client machines. If the library is valid, it is opened with the form window.
For more information on object libraries, refer to the Design Reference manual of the 4th Dimension documentation.
Example
In this example, the user can choose a library then modify a dialog form:
MAP FILE TYPES("4DLB";"4IL";"4D Library") $vALib:=Select document(1;"4DLB";"Please select a library";0) If(OK=1) `A library was chosen $vALibPath:=Document Else $vALibPath:="" End if EDIT FORM([Dialogs];"Welcome";"Lib_Logos.4il") If(OK=1) `Display of modified form DIALOG([Dialogs];"Welcome") End if
See Also
CREATE USER FORM, DELETE USER FORM, LIST USER FORMS, Overview of user forms.
System Variables or Sets
If the user stores the changes made to the form, the OK variable is set to 1. In case of error, OK is set to 0.
Error Handling
An error is generated if:
the form has not been declared editable by the user in the Design environment or if it does not exist,
the form is already open and being modified in another process,
the user cannot access the form because they do not have the proper access rights.
You can intercept this error with the error-handling method installed by the ON ERR CALL command.