PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • Reason
  • Correction
  • Examples
  • Code for class declaration used in the code of a button
Products
WINDEVWEBDEV - Server codeWEBDEV - Browser codeWINDEV MobileReports and Queries
Platforms
WindowsLinuxWindows MobileUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadApple Watch
Languages
JavaPHPAjaxUser code (UMC)External language
Databases
HFSQLHFSQL Client/ServerStored proceduresOLE DBODBCNative Accesses
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 a process other than the declaration process of the class.
Correction
Check whether the class was created in your project and copy the declaration code of the class into the "Class declaration" process.
Examples

Code for class declaration used in the code of a button

Code triggering the error
// -- Click on BTN_Button1
AFile is Class
Name is string
Extension is string
Directory is string
END
Possible correction
Creating the AFile class and copying the code for declaring the AFile class into the declaration code of the class.
// -- 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