|
|
|
|
|
- Overview
- How to?
- Enabling the automatic prefixing
- Dsabling the automatic prefixing
- Create a code style
- Modifying a code style
- Modifying the code style used
- Managing prefixes
A code style is used to automatically prefix the name of all the variables and project elements (windows, report controls, classes, etc.). This automatic prefixing allows you to easily identify and/or find an element of a given type. In the following example, the type of the controls used can be easily identified: Remark: You can also find out the type of an element using the tooltip displayed when you hover over the element: Enabling the automatic prefixing To enable the automatic prefixing: - Open the project description: On the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
- Go to the "Options" tab.
- Check "Activar prefijos automáticos de variables y elementos del proyecto".
- Choose the code style to use. The "Standard" style (provided with WINDEV, WEBDEV or WINDEV Mobile) is used by default.
- Check "Agregar prefijos automáticamente" if you want prefixes to be added automatically. In this case, prefixes will be automatically used in the different editors if a code style has been defined. Therefore, when writing code, the prefix that corresponds to the type of variable will be automatically added before the name of the variable.
- Check "Generar un error de compilación de UI si un control no tiene el prefijo correcto" to throw a UI error if controls do not use the prefix defined in the code style.
- Validate. When creating new elements or new variables, the corresponding prefixing will be automatically added.
Remarks: - Another solution to activate automatic prefixing: under the "Proyecto" pane, in the "Otras acciones" group, pull down "Estilo de código" and select "Use guidelines"..
- When a new project is created, only the automatic prefixes for project elements are enabled by default. Prefixes are not added automatically (especially in WLanguage code).
- The names of variables containing less than 3 characters are not prefixed.
Dsabling the automatic prefixing To disable the automatic prefixing, use one of the following methods: - on the "Proyecto" tab, in the "Otras acciones" group, expand "Estilo de código" and uncheck "Use code style".
- in the "Options" tab of the project description, uncheck "Activar prefijos automáticos de variables y elementos del proyecto".
Reminder: To display the project description, under the "Proyecto" pane, in the "Proyecto" group, click on "Descripción".. Create a code style To create a code style: - Open the project description: On the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
- Go to the "Options" tab.
- Click "Crear un estilo de código" and validate the window that appears.
- Select the location of the new code style and enter its name (".CDP" file).
- Validate ("Save" button). The new code style is created.
By default, this style is the "Standard" style (provided with WINDEV, WEBDEV or WINDEV Mobile). - Click the "Edit" button.
- Define the different prefixes and validate.
Remark: The "Standard" programming guidelines cannot be modified. Modifying a code style To modify a code style: - Open the project description: On the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
- Go to the "Options" tab.
- Select the code style to modify.
- Click "Editar estilo de código".
- Define the new prefixes and validate.
Remarks: - These modifications will be taken into account when creating new elements or new variables.
- The "Standard" code style cannot be modified.
- Alternatively, you can edit the current programming guidelines: in the "Proyecto" pane, in the "Otras acciones" group, scroll down to "Estilo de código" and select "Edit guidelines"..
Modifying the code style used To modify the code style used: - Open the project description: On the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
- Go to the "Options" tab.
- Select the code style to use (in the "Code style" list or via the "..." button).
- Validate.
Remark: The same programming guidelines (".CDP" file) can be used in several WINDEV, WEBDEV and WINDEV Mobile projects. Managing prefixes In the code style, you can: - automatically add prefixes in the different editors when a code style has been defined.
- generate a UI compilation error if a control has the wrong prefix.
To manage prefixes: - Open the project description: On the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
- Go to the "Options" tab.
- To add prefixes automatically, select "Agregar prefijos automáticamente".
- To generate a UI error if an invalid prefix is used, select "Generar un error de compilación de UI si un control no tiene el prefijo correcto".
- Validate.
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|