ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • Reason
  • Correction
  • Example
  • A constant is declared in the click code of a button found in the "WIN_Menu" window
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Error 102: The constants can be defined in the initialization code of project, ...
Reason
You are trying to declare a constant in a process where this type of declaration is not allowed.
Reminder: The constants must be declared in:
  • The initialization code of the project in order to be used in all the processes of the project (code of project, code of windows and code of controls).
  • The opening code of a window or page in order to be used in all the processes of the window or page (codes of window/page and codes of the controls found in the window/page).
Correction
Declare your constant in the appropriate code.
Example

A constant is declared in the click code of a button found in the "WIN_Menu" window

Code triggering the error
// -- Click code of BTN_DISPLAY
CONSTANT
VATRate = 22.6
END


Possible corrections
Declare the constant in the opening code of the window.
// -- Opening code of WIN_Menu
CONSTANT
VATRate = 22.6
END


Declare the constant in the declaration code of the global variables of the page.
// -- Declaration code of global variables of PAGE_Menu
CONSTANT
VATRate = 22.6
END
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help