---
url: >-
  /statelake/scripting-reference/functions-and-procedures/logging-functions/messagewarning.md
---

# MessageWarning

**MessageWarning** displays a warning message to the user. How this message is displayed depends on what application is executing the script.

If executed under **Statelake**, this message will show to screen - the user needs to click **OK** to the message to continue processing.

If executed under **Statelake Service** the message will be written to the Windows Event Viewer.

**Declaration**: Procedure MessageWarning( AMessage)

A simple script to try.

```pascal
procedure ScriptEvent (var Value : variant);
begin
  MessageWarning('This is a very important message.   Please take note.');
end;
```

This script produces the following.
