PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • How to proceed?
  • 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 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Warning
From version 24 (75), Programing charter is kept for backward compatibility. This function is replaced by Code style.
Overview
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 via the tooltip displayed when the element is hovered by the mouse cursor:
How to proceed?

Enabling the automatic prefixing

To enable the automatic prefixing:
  1. Open the project description: on the "Project" pane, in the "Project" group, click "Description".
  2. Display the "Options" tab.
  3. Check "Automatically prefix the variables and the elements found in the project".
  4. Choose the code style to use. The "Standard" style (supplied with WINDEV, WEBDEV or WINDEV Mobile) is used by default.
  5. 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 "Project" pane, in the "Other actions" group, expand "Code style" and select "Use code style".
  • When creating a new project the automatic prefixing is enabled by default.
  • 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 "Project" pane, in the "Other actions" group, expand "Code style" and uncheck "Use code style".
  • in the "Options" tab of the project description, uncheck "Automatically prefix the variables and the elements found in the project".
Reminder: To open the project description, go to the "Project" pane, "Project" group and click "Description".

Create a code style

To create a code style:
  1. Open the project description: on the "Project" pane, in the "Project" group, click "Description".
  2. Display the "Options" tab.
  3. Click "Create a code style" 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 "Project" pane, in the "Project" group, click "Description".
  2. Display the "Options" tab.
  3. Select the code style to modify.
  4. Click "Edit code style".
  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 "Project" pane, in the "Other actions" group, expand "Code style" and select "Edit code style".

Modifying the code style used

To modify the code style used:
  1. Open the project description: on the "Project" pane, in the "Project" group, click "Description".
  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.
  • Versions 26 and later
    generate a UI compilation error if a control has the wrong prefix.
    New in version 26
    generate a UI compilation error if a control has the wrong prefix.
    generate a UI compilation error if a control has the wrong prefix.
To manage prefixes:
  1. Open the project description: on the "Project" pane, in the "Project" group, click "Description".
  2. Display the "Options" tab.
  3. To add prefixes automatically, select "Add prefixes automatically".
  4. Versions 26 and later
    To generate a UI error if an invalid prefix is used, select "Throw a UI compilation error if a control has the wrong prefix".
    New in version 26
    To generate a UI error if an invalid prefix is used, select "Throw a UI compilation error if a control has the wrong prefix".
    To generate a UI error if an invalid prefix is used, select "Throw a UI compilation error if a control has the wrong prefix".
  5. Validate.
Minimum version required
  • Version 10
This page is also available for…
Comments
Click [Add] to post a comment