double price[31]; for (int i = 0; i <= 30; i++) { price[i] = ObjectGetDouble(0, (string)i, OBJPROP_PRICE2); }