textgen error: type int is not a subtype of string

Hi,

I'm writing a simple textgen for a concept representing an integer on a fixed number of digits. It's only property is the number of digits.

my textgen code is simply:

append {INT(} ${node.nb_digits} {)} ;

But MPS complains that "int is not a subtype of string".
There's no toString method and casting to (string) doesn't seem to work either.. any idea of what I should do?

Thanks
2 comments
Try this trick: append {INT(} ${"" + node.nb_digits} {)} ;
0

Please sign in to leave a comment.