Castle Game Engine: CastleWarnings

# Unit CastleWarnings
Description | Uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables
## Description Reporting warnings (OnWarning). ## Overview ### Functions and Procedures
`procedure OnWarningWrite(const AType: TWarningType; const Category, S: string);`
`procedure OnWarningLog(const AType: TWarningType; const Category, S: string);`
### Types
`TWarningType = (...);`
`TWarningProc = procedure (const AType: TWarningType; const Category, S: string);`
### Variables
`OnWarning: TWarningProc = @OnWarningLog;`
## Description ### Functions and Procedures
`procedure OnWarningWrite(const AType: TWarningType; const Category, S: string);`
Assign this to OnWarning to report warnings using WarningWrite, and log them too. For Windows programs with no console available, WarningWrite will make a message box, in all other cases the warning just goes to ErrOutput. The warning is also logged using CastleLog.
`procedure OnWarningLog(const AType: TWarningType; const Category, S: string);`
Assign this to OnWarning to only log warnings using CastleLog.
### Types
`TWarningType = (...);`
Types of warnings. ###### Values wtMinor: Something failed (like URL not available), but still the data is semantically correct. For data formats that have a precise specification (like VRML/X3D or Collada), this means that the file satisfies the specification, but there is a minor problem (like one of the referred URLs is not available). wtMajor: The data is invalid. For data formats that have a precise specification (like VRML/X3D or Collada), this means that the file is incorrect with respect to this specification. We can handle it, but other (less forgiving but still correct) software may reject it. It's strongly suggested to report this to the author of the file, as the file should really be corrected.
`TWarningProc = procedure (const AType: TWarningType; const Category, S: string);`
### Variables
`OnWarning: TWarningProc = @OnWarningLog;`
Reporting warnings. Used by other units to report warnings about various data (images, sound files, 3D models), indicating that data is invalid in some way but we can continue. You can assign any procedure here. You can ignore, or report this warning in any way. If you want to be really strict about the data correctness, you can also raise an exception (or raise it only when type is wtMajor). The default behavior is to ignore possible warnings (as there is no safe cross-platform default place where they can be reported). Actually, you can initialize CastleLog to see warnings in the log. You can also assign your own callback to `OnWarning` to record and show warnings in any way.
Generated by PasDoc 0.13.0 on 2013-08-17 21:27:15