# How to create a stack into a resources verse file

**URL:** <https://forums.unrealengine.com/t/how-to-create-a-stack-into-a-resources-verse-file/1566897>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [December 28, 2023, 3:15am UTC](https://forums.unrealengine.com/t/how-to-create-a-stack-into-a-resources-verse-file/1566897 "2023-12-28T03:15:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChrixBed](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrixbed/32/702407_2.png) [@ChrixBed](https://forums.unrealengine.com/u/ChrixBed)\
**Post date:** [December 28, 2023, 3:15am UTC](https://forums.unrealengine.com/t/how-to-create-a-stack-into-a-resources-verse-file/1566897/1 "2023-12-28T03:15:48Z")

</div>

I have a verse file utils.verse that I want to declare a stack to be use in all my verse scripts.

```using
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Random }

stack<public>(t:type) := class<computes>:
    Items<public>:[]t = array{}
 
    Push<public>(Item:t)<computes>:stack(t)=
        stack(t){ Items := Items + array{Item} }
 
    Pop<public>()<decides><computes>:tuple(stack(t), t)=
        Ret:t = Items[Items.Length - 1]
        (stack(t){ Items := Items.RemoveElement[Items.Length - 1] }, Ret)
    
    isEmpty<public>():logic=
        if(Items.Length = 0):
            return true
        false

```

But I keep having an error declaration in VCStudio with: stack(t:type) := class

```auto
(t:type) Can't access a function from a preceding type.(3502)

```

---

<div class="post-metadata">

**Author:** ![Starkiller9229](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Starkiller9229](https://forums.unrealengine.com/u/Starkiller9229)\
**Post date:** [February 14, 2024, 9:13am UTC](https://forums.unrealengine.com/t/how-to-create-a-stack-into-a-resources-verse-file/1566897/2 "2024-02-14T09:13:02Z")

</div>

I know this is an old post, but did you ever manage to resolve this? I’m running into the same issue

---

<div class="post-metadata">

**Author:** ![ChrixBed](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chrixbed/32/702407_2.png) [@ChrixBed](https://forums.unrealengine.com/u/ChrixBed)\
**Post date:** [July 9, 2024, 2:38pm UTC](https://forums.unrealengine.com/t/how-to-create-a-stack-into-a-resources-verse-file/1566897/3 "2024-07-09T14:38:59Z")

</div>

Nope! I just got back to the project and still have this odd situation where I can’t declare a generic stack type for all my verse files. It is such a basic and frustrating case, no idea why I can’t declare a type t
