# Hash variable?

**URL:** https://www.finalbuilder.com/forums/t/hash-variable/850
**Category:** Discussion
**Created:** [May 25, 2008, 11:15am UTC](https://www.finalbuilder.com/forums/t/hash-variable/850 "2008-05-25T11:15:02Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 25, 2008, 11:15am UTC](https://www.finalbuilder.com/forums/t/hash-variable/850/1 "2008-05-25T11:15:02Z")

</div>

Hey guys.

We have an INI file which we read throughout our build process, which we run every day.

Among others, it contains a list of Solution files to be compile.

Now, we want to count how many times each solution was failed and to set this counter to zero, once it succeed.

In order to do that, we have to use project variable.

&nbsp;

The problem is that&nbsp;&nbsp; 1) we can't tell how many solution files there will be in that INI file and we don't know their names.

I though about using an array but it doesn't feel right.

&nbsp;

What we need is a hash-variables (mapping) and we would like to use it like this -

%myHash%.%currentSolutionFilename% += 1 or something like this.

We will decalre myHash as a project (hash) variable and this will contain string variables, each of which will contain a counter.

&nbsp;

It that possible to accomplish in any way?

&nbsp;

Please advice.

&nbsp;

Thanks,

Guy.

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [May 26, 2008, 1:21am UTC](https://www.finalbuilder.com/forums/t/hash-variable/850/2 "2008-05-26T01:21:34Z")

</div>

Hi guy,  
  
Thanks for your post. There's no built-in support for this functionality, but you can use the JavaScript "Associative Array" feature (which behaves like a hashtable) to implement this with some Run Script actions.  
  
I've mocked up a dummy project which emulates the kind of functionality you need. A JavaScript Associative Array object is created and stored in the FB Variable "FailureDictionary".

The dictionary counts the number of times each dummy project fails to build, and resets the failure count to zero any time a dummy project builds successfully.  
  
Please let us know how you go.  
  
Regards,  
  
Angus

[JavaScript Associative Array.fbp6](https://www.finalbuilder.com/forums/uploads/default/original/2X/0/03081a15849fad320715fcc5ca4debbd35ccaa18.fbp6) (23.366 KB)

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [May 26, 2008, 8:28am UTC](https://www.finalbuilder.com/forums/t/hash-variable/850/3 "2008-05-26T08:28:40Z")

</div>

Angus, thank you for your help.

&nbsp;

Can u&nbsp;please send it in a FB5 file?

&nbsp;

Thanks again!

Guy.

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [May 27, 2008, 1:09am UTC](https://www.finalbuilder.com/forums/t/hash-variable/850/4 "2008-05-27T01:09:33Z")

</div>

You know you're missing all the awesome new feature in FB 6, don't you?

[JavaScript Associative Array.fbp5](https://www.finalbuilder.com/forums/uploads/default/original/2X/f/fee9ed0fa7ecacb14c28aab96e59eea363c50194.fbp5) (23.852 KB)
