I think you should put DEF CUSTOM D[] and then operate with the array, because % is the suffix for integer.