PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
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
Minimum version required
  • Version 0
This page is also available for…
Comments
Click [Add] to post a comment