You can store it in a variable, array or object etc. whatever you think is best.
If you are ok at reading English I would suggest that you start reading the following topics in the manual "Variables", "Objects", "Families", "Arrays" they should give you a good idea of how to do it I think.