In this example Im showing you a "more elegant" way to display upgrade costs, for example, for buildings.
Here we got a lumbermill and goldmine, starting on "level 0" to a maximum of "level 4" each.
The *.capx is fully commented.
Additional ressources, needed for this example:
Arrays
If you dont know much about them (or how they work), first take a look at: scirra.com/manual/108/array . If you need to know more, simply google "how do 2D arrays work" in your language ;)
Functions
scirra.com/manual/149/function is a good source, especially (on the bottom) the "Call" and "ReturnValue" expression is needed here.
If there are any questions, feel free to ask.