SO I see the "Util.log()" function can print to the console some text.
It seems it is missing some very useful features see below.
Question 1: How can I do some type of formatted text, aka: something like printf("The value is %d\n", 42 )
Also - why does: Util.log("Hello, world\n") - complain about the \n? Likewise how do I *NOT* print a newline on the output console?
ie: I want to print in two steps like this: Util.log("Hello "); Util.log("world\n");
Question 2: Is there a means to wait for the user to press a key, consider the following test use case:
void some_custom_function()
{
Util.log("connect test cable, and press anykey to continue\n");
/* Wait 10 seconds aka 10000 milliseconds for user to press a key */
key = Util.wait_keypress( 10000 );
/* this would wait for (X) milliseconds - if no key pressed it returns -1, otherwise it returns the key */
/* the time : 0 - means do not wait, the time (negative) would mean wait for ever */
if( key == -1 ){
Util.log("You did not press a key\n");
} else {
Util.log("You pressed the key: 0x%04x\n", key );
}
}