Verse Library verse

02 Tuple Element Access

Demonstrates indexing into tuples to extract and assign individual elements to typed variables.

extracted-snippets/documentation/en-us/uefn/tuple-in-verse/02-tuple-element-access.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/uefn/tuple-in-verse
# Local doc:  epic-docs/documentation/en-us/uefn/tuple-in-verse.md
# Section:    Tuple Element Access
MyTuple := (1, 2.0, "three")

MyNestedTuple := (1, (10, 20.0, "thirty"), "three")

var MyInt: int = MyTuple(0)
var MyFloat: float = MyTuple(1)
var MyString: string = MyTuple(2)

Print("My variables: {MyInt}, {MyFloat}, {MyString}")

Print("My nested tuple element: {MyNestedTuple(1)(2)}")
Copy full snippet

Comments

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