# Can someone explain why return does not work in a stringtomessage

**URL:** <https://forums.unrealengine.com/t/can-someone-explain-why-return-does-not-work-in-a-stringtomessage/2686197>\
**Category:** Programming & Scripting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [December 18, 2025, 9:11pm UTC](https://forums.unrealengine.com/t/can-someone-explain-why-return-does-not-work-in-a-stringtomessage/2686197 "2025-12-18T21:11:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RandomFoghorn](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RandomFoghorn](https://forums.unrealengine.com/u/RandomFoghorn)\
**Post date:** [December 18, 2025, 9:11pm UTC](https://forums.unrealengine.com/t/can-someone-explain-why-return-does-not-work-in-a-stringtomessage/2686197/1 "2025-12-18T21:11:58Z")

</div>

```auto
    MakeMessage<public><localizes>(Text:string):message = 
        return "{Text}" 

```

I understand it works if you do not use the return keyword. But why exactly is that?

---

<div class="post-metadata">

**Author:** ![BRGJuanCruzMK](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgjuancruzmk/32/1036548_2.png) [@BRGJuanCruzMK](https://forums.unrealengine.com/u/BRGJuanCruzMK)\
**Post date:** [January 9, 2026, 7:43pm UTC](https://forums.unrealengine.com/t/can-someone-explain-why-return-does-not-work-in-a-stringtomessage/2686197/2 "2026-01-09T19:43:42Z")

</div>

Hey @RandomFoghorn how are you?

The reason why it doesn’t works when you use `return` is because, in Verse, functions written with `=` are **expression-based** , not imperative.

Here are three examples showing why and how it works:

1. This works:

```auto
MakeMessage<public><localizes>(Text:string):message =
    "{Text}"
```

because the function body is a single expression, and Verse implicitly returns its value.

1. This does **not** work:

```auto
MakeMessage<public><localizes>(Text:string):message =
    return "{Text}"
```

because `return` is a statement, not an expression, and expression-bodied functions in Verse only accept expressions.

For `localizes`, the expression style is intentional and expected, since the localization system analyzes the returned expression directly.

Hope this helps you to understand!
