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
4 comments
Comment actions Permalink
Try this trick: append {INT(} ${"" + node.nb_digits} {)} ;
0
Comment actions Permalink
that did it, thanks :)
0
Comment actions Permalink

It seems that this issue is still there, and with the current MPS, the trick does not work.

How can I generate text for int properties?

0
Comment actions Permalink

I tried once more and noticed that I missed one little detail. Now it works also for me.

0

Please sign in to leave a comment.