Not Enough Arguments Error

Hi to all!
In one of my datafields I have the following code line:

dc.drawText(fieldWidth - 32, 138, f_XTINY, poMax.format("%0d"), textCenter);

where:
f_XTINY is Graphics.FONT_XTINY
poMax is taken from setup as Numeric: 100 to 500 limited
textCenter is Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_CENTER;

In some cases the above codeline throws an "Not Enough Arguments Error".
It never happened to me, but I can see seldom occurances in ERA.

What can throw this error?
I'm at my wits end...

  • But when it is read as blank from setting into view.mc it behaves like a empty string. It is not null, but it seems to be nothing else but „nothing“.

    Ok, but as a programmer you must understand that when you read that blank setting in your Monkey C code, the result has to be *something*, whether it's null or an empty string (""). I realize that when you log an empty string using System.println() it literally prints as nothing, but in reality, there's still a type associated with the data. It's not like javascript where an object can have an optional property that's literally absent (in a manner that's distinct from the property being equal to null.)

    If you want to confirm that it's an empty string, you could log the result of x instanceof Lang.String && x.length() == 0  for example. Or even more simply: "".equals(x)

  • You‘re right with string checking - I could try this.
    But I thought - if it is a empty string it should throw an exception if a Numeric is feed with a string.

    But anyway - the solution is „required=true“ in settings.

    Thanks to all if you!

  • With type checking, things are only checked at compile time, not run time so even you you cast something as "as Numeric "

    at run time you can set it to be any object type.  There is no checking at that time.