First of all I would like to say thank you for all the information you guys have posted, I have learned so much with this forum. I've been reading it for months and now I can pretty much do all the basic stuff.
Recently I've been trying to deal the prontoscript and actually i got most of things to work when I followed the developer's guide 1.4.3
However I am stuck into something very simple (for all of you)...
My goal is to create a very simple widget that reads the current volume and change its label...
On the page 42 of the guide, I associated the following code to a button: var e,s; e = CF.extender[0]; if (!e) { Diagnostics.log("Extender 0 is not defined"); } else { s = e.serial[0]; if (!s) { Diagnostics.log("Extender 0 is not a serial extender"); } else { s.bitrate = 9600; s.databits = 8; s.parity = 0; // None s.stopbits = 1; label = s.match("MV?\r","\r",250); } }
And it works!
But how do I do for a widget using non asynchronous operation?
where do I put this line:
s.onData = function(v) { label = v; };
How does it work? Which part goes to the "home" and which goes to button or widget advanced panel?
Please please... just give me a step by step guide to create something THIS simple and I promise you I wont bug you guys anymore!