[Laszlo-checkins] r12002 - in openlaszlo/trunk/docs/src/developers/tutorials: . programs

lou@openlaszlo.org lou at openlaszlo.org
Sat Dec 6 15:38:39 PST 2008


Author: lou
Date: 2008-12-06 15:38:00 -0800 (Sat, 06 Dec 2008)
New Revision: 12002

Modified:
   openlaszlo/trunk/docs/src/developers/tutorials/programs/scripting-tutorial-$3.lzx
   openlaszlo/trunk/docs/src/developers/tutorials/scripting.dbk
Log:
Change 20081206-lou-U by lou at loumac.local on 2008-12-06 19:18:02 AST
    in /Users/lou/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: dguide, tutorials, Chapter 10. Introduction to Scripting: improve scripting Example 10.3. JavaScript Subtleties

Bugs Fixed: LPP-7437 (partial)

Details: add example using text.format

Tests: visual verify



Modified: openlaszlo/trunk/docs/src/developers/tutorials/programs/scripting-tutorial-$3.lzx
===================================================================
--- openlaszlo/trunk/docs/src/developers/tutorials/programs/scripting-tutorial-$3.lzx	2008-12-06 23:37:17 UTC (rev 12001)
+++ openlaszlo/trunk/docs/src/developers/tutorials/programs/scripting-tutorial-$3.lzx	2008-12-06 23:38:00 UTC (rev 12002)
@@ -3,6 +3,7 @@
   <text id="sometext" />
   <text id="badtext" />
   <text id="goodtext" />
+  <text id="bettertext" />
   <script>
     var first = 4;
     var second = 3;
@@ -10,6 +11,7 @@
     sometext.setAttribute("text", result);
     badtext.setAttribute("text", first + " plus " + second + " is " + first + second);
     goodtext.setAttribute("text", first + " plus " + second + " is " + (first + second));
+    bettertext.format("%s plus %s is %s", first, second, first + second);
   </script>
 </canvas>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************

Modified: openlaszlo/trunk/docs/src/developers/tutorials/scripting.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/tutorials/scripting.dbk	2008-12-06 23:37:17 UTC (rev 12001)
+++ openlaszlo/trunk/docs/src/developers/tutorials/scripting.dbk	2008-12-06 23:38:00 UTC (rev 12002)
@@ -54,7 +54,7 @@
 
    <para>Everything there is fine, except the "<literal>badtext.setAttribute( … );</literal>" line. Four plus three should be 7, as in 
 the line immediately above it, right? What happened is that we concatenated numbers to strings
-(<literal>(..." is " + first + second)</literal>). The next line shows one way to fix this problem.</para>
+(<literal>(..." is " + first + second)</literal>). The next line shows one way to fix this problem. The line after that shows a better way.</para>
 <para>
 OpenLaszlo documentation is not intended to provide a complete reference for JavaScript. Later chapters do explain some
 advanced topics in scripting, but we recommend that you have a JavaScript reference handy while writing LZX.



More information about the Laszlo-checkins mailing list