AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Editores / Editor de código
  • 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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Otros
Procedimientos almacenados
Overview
A set of programming guidelines automatically prefixes the names of all variables and project elements (window, control of an report, class, 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 via the tooltip displayed when the element is hovered by the mouse cursor:
How to?

Enabling the automatic prefixing

To enable the automatic prefixing:
  1. Open the project description: on the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
  2. Display the "Options" tab.
  3. Check "Activar prefijos automáticos de variables y elementos del proyecto".
  4. Choose the code style to use. The "Standard" style (provided with WINDEV, WEBDEV or WINDEV Mobile) is used by default.
  5. 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.
  6. 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.
  7. Validate. When creating new elements or new variables, the corresponding prefixing will be automatically added.
Remarks:
  • Another solution to enable the automatic prefixing: on the "Proyecto" tab, in the "Otras acciones" group, expand "Estilo de código" and select "Use code style".
  • From version 27 onwards, when creating a new project, only the automatic prefixes for project elements are enabled by default. Prefixes are not added automatically (especially in WLanguage code).
    The "Agregar prefijos automáticamente a las nuevas variables" option allows you to enable prefixes for variables as well, as soon as you create the project.
  • 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 open the project description, go to the "Proyecto" tab, "Proyecto" group and click "Descripción".

Create a code style

To create a code style:
  1. Open the project description: on the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
  2. Display the "Options" tab.
  3. Click "Crear un estilo de código" and validate the window that appears.
  4. Select the location of the new code style and enter its name (".CDP" file).
  5. Validate ("Save" button). The new code style is created.
    By default, this style is the "Standard" style (provided with WINDEV, WEBDEV or WINDEV Mobile).
  6. Click the "Edit" button.
  7. Define the different prefixes and validate.
Remark: The "Standard" code style cannot be modified.

Modifying a code style

To modify a code style:
  1. Open the project description: on the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
  2. Display the "Options" tab.
  3. Select the code style to modify.
  4. Click "Editar estilo de código".
  5. 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.
  • Another solution to edit the current code style: on the "Proyecto" tab, in the "Otras acciones" group, expand "Estilo de código" and select "Edit code style".

Modifying the code style used

To modify the code style used:
  1. Open the project description: on the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
  2. Display the "Options" tab.
  3. Select the code style to use (in the "Code style" list or via the "..." button).
  4. Validate.
Remark: The same code style (".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:
  1. Open the project description: on the "Proyecto" tab, in the "Proyecto" group, click "Descripción".
  2. Display the "Options" tab.
  3. To add prefixes automatically, select "Agregar prefijos automáticamente".
  4. 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".
  5. Validate.
Versión mínima requerida
  • Versión 10
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 04/04/2024

Señalar un error o enviar una sugerencia | Ayuda local