Torque's method of "Arrays" is like this:
$inv[0] is the same as "$inv0".
$inv["Hello"] is the same as "$invHello".
$inv["entory"]item is the same as "$inventoryitem".
$inv[3,4] is the same as "$inv3_4" or $inv["3_4"].
Scripts like in above posts can help when looping through large amounts of different variables to find a specific one, i.e. large inventory lists. Instead of %invFirstSlot you'd have %inv[0] or [1].