# Correct syntax to assign current grid location value to a GP

**URL:** <https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914>\
**Category:** Module Design\
**Created:** [April 16, 2021, 10:11am UTC](https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914 "2021-04-16T10:11:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Djangtchoub](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/djangtchoub/32/4302_2.png) [@Djangtchoub](https://forum.vassalengine.org/u/Djangtchoub)\
**Post date:** [April 16, 2021, 10:11am UTC](https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914/1 "2021-04-16T10:11:14Z")

</div>

Hello everyone !  
I’m trying to send units in another unit location so I need to assign the current location of the unit to a global property.  
but in the set Global Property trait, I cannot find the correct syntax to do that  
set value directly, I try : $currentLocation$, $gridLocation$  
But that does not work.

---

<div class="post-metadata">

**Author:** ![jrwatts](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/jrwatts/32/6972_2.png) [@jrwatts](https://forum.vassalengine.org/u/jrwatts)\
**Post date:** [April 16, 2021, 10:39am UTC](https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914/2 "2021-04-16T10:39:52Z")

</div>

In what way does it not work? I think $currentLocation$ should be correct…are you trying to store the location from a zone containing a square or hex grid? If so, you may need to change the Location Format field in the Zone’s properties to $gridLocation$, instead of the default of $name$.

---

<div class="post-metadata">

**Author:** ![Djangtchoub](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/djangtchoub/32/4302_2.png) [@Djangtchoub](https://forum.vassalengine.org/u/Djangtchoub)\
**Post date:** [April 16, 2021, 11:55am UTC](https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914/3 "2021-04-16T11:55:04Z")

</div>

Thank you for your answer : when i try a report action trait to see what happened, I have the sentence:  
“Unit is in gridLocation” or whatever syntax I use (“Unit is in currentLocation”) even though I set the Property as numeric.

For the grid, the location format field is already gridLocation, for some specific Hexes I’ve changed the field zone to "$gridLocation$ ($name$)

---

<div class="post-metadata">

**Author:** ![Djangtchoub](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/djangtchoub/32/4302_2.png) [@Djangtchoub](https://forum.vassalengine.org/u/Djangtchoub)\
**Post date:** [April 16, 2021, 11:57am UTC](https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914/4 "2021-04-16T11:57:20Z")

</div>

Everything works if I set a Global Property zone for the Hex with the value of the grid  
Since, I can only disband TF in anchorage, I can do this, I just have around 40 Hexes to define

---

<div class="post-metadata">

**Author:** ![barbanera](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@barbanera](https://forum.vassalengine.org/u/barbanera)\
**Post date:** [April 16, 2021, 8:59pm UTC](https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914/5 "2021-04-16T20:59:46Z")

</div>

Try $LocationName$

---

<div class="post-metadata">

**Author:** ![Djangtchoub](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/djangtchoub/32/4302_2.png) [@Djangtchoub](https://forum.vassalengine.org/u/Djangtchoub)\
**Post date:** [April 18, 2021, 8:41am UTC](https://forum.vassalengine.org/t/correct-syntax-to-assign-current-grid-location-value-to-a-gp/11914/6 "2021-04-18T08:41:52Z")

</div>

It works incompletly because for numbers under 1000, the first 0 is deleted and my unit cannot be sent there.  
For numbers above 1000 it works well.

My solution is :

- a Global Property Zone named : HexLocation
- a Global Property named: TFLocation / numeric
- a trait for my Task Force counter : Set Global property that sets the TFLocation to HexLocation with the syntax : “$HexLocation$”
