Hi Brian,
re:
> Is there a text editor to create messages in an alert box?
> In the past I have had to use /n for newline and + and '
That's the main way to do it. Sometimes it can be good to build it up in smaller chunks like
str += '...';
str += '...';
But there is also a string formatter you can use like this:
code:
var x1 = 5, dValue = 3, x0 = 8;
var msg = moi.ui.formatString( 'x1 = %1% cm\ndValue = %2% cm\nx0 = %3% cm', x1, dValue, x0 );
moi.ui.alert( msg );
So for that way you have one "template string" that contains placeholders %1% , %2%, etc.. which are replaced by the values passed after the format string.
That method reduces the amount of little fragments that the regular way uses.
- Michael
|