Verse Library verse

01 Language

Stores and updates session-specific integer data using a weak map for safe scoped memory.

extracted-snippets/documentation/en-us/fortnite/25-00-release-notes-in-unreal-editor-for-fortnite/01-language.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/25-00-release-notes-in-unreal-editor-for-fortnite
# Local doc:  epic-docs/documentation/en-us/fortnite/25-00-release-notes-in-unreal-editor-for-fortnite.md
# Section:    Language
var GlobalInt:weak_map(session, int) = map{}
ExampleFunction():void=
X := if (Y := GlobalInt[GetSession()]) then Y + 1 else 0
if:
set GlobalInt[GetSession()] = X
Print({X})

Comments

    Sign in to vote, comment, or suggest an edit. Sign in