For my Google Docs spreadsheet module, I'd like a function to be able to accept an array of values and iterate over them, adding them to a hash. The spreadsheet submission form wants values in a format like this:
{"entry.0.single": value0,
"entry.1.single": value1,
"entry.2.single": value2}
If the function accepts an array like the following,
[value0, value1, value2]
is it possible to loop over them, keep a running counter, and create a hash? This would be a simple task in other languages. Python suffices for illustration:
hash = dict()
i = 0
for val in values:
hash["entry.%s.single" % i] = val
i += 1
Can that be done in KRL?