lua Code:
local registers = {
{value1 = 1, value2 = 3},
{value1 = 1, value2 = 100},
{value1 = 1, value2 = 365}
}
local total_value1, total_value2 = 0, 0
for regnum, register in pairs(registers) do
total_value1 = total_value1 + register.value1
total_value2 = total_value2 + register.value2
end
print("The total of value1 is", total_value1, "The total of value2 is", total_value2)
Would output "The total of value1 is 3 The total of value2 is 468"
As a quick example.