Hash variable?

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.

 

The problem is that   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.

 

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.

 

It that possible to accomplish in any way?

 

Please advice.

 

Thanks,

Guy.

 

 

 

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 (23.366 KB)

Angus, thank you for your help.

 

Can u please send it in a FB5 file?

 

Thanks again!

Guy.

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

JavaScript Associative Array.fbp5 (23.852 KB)