ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / Errors / WLanguage errors
  • Reason
  • Correction
  • Examples
  • Code for class declaration used in the button code
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 1045: A class cannot be declared outside the declaration code of a class
Reason
The current code corresponds to a class declaration. This code is found in an event other than the class "Declaration" event.
Correction
Check whether the class was created in your project and copy the declaration code of the class into the class "Declaration" event.
Examples

Code for class declaration used in the button code

Code triggering the error
// -- Click on BTN_Button1
AFile is Class
Name is string
Extension is string
Directory is string
END
Possible correction
Create the AFile class and copy the code for declaring the AFile class into the class "Declaration" event.
// -- Declaration of AFile class
AFile is Class
Name is string
Extension is string
Directory is string
END
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help