---
url: /flow/guide/scripting-reference/functions/logging/messageerror.md
---

# MessageError

## Declaration

`Procedure MessageError( AMessage : string; HelpID : LongInt; E : Exception)`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := MessageError('This is a message',0, nil);
end;
```

## Description

Displays a error message to the user. HelpId should always be set to 0, E should always be set to nil.

How this message is displayed depends on what application is executing the script. If executed under Flow this message will show to screen - the user needs to click OK to the message to continue processing. If executed under FlowService the message will be written to the Windows Event Viewer.
