[GRASS-SVN] r34779 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Dec 7 06:04:15 EST 2008


Author: hamish
Date: 2008-12-07 06:04:14 -0500 (Sun, 07 Dec 2008)
New Revision: 34779

Modified:
   grass/trunk/lib/gis/percent.c
Log:
fix my crappy explaination of the placement logic (merge from devbr6)

Modified: grass/trunk/lib/gis/percent.c
===================================================================
--- grass/trunk/lib/gis/percent.c	2008-12-07 11:03:18 UTC (rev 34778)
+++ grass/trunk/lib/gis/percent.c	2008-12-07 11:04:14 UTC (rev 34779)
@@ -42,20 +42,17 @@
   for (row = 0; row < nrows; row++)
   {
       G_percent (row+1, nrows, 10);
-      ...
-      ...
-      ...
+      do_calculation(row);
   }
 \endcode
  *
- * This will print completion messages at 10% increments; i.e., 10%, 20%, 30%,
- * etc., up to 100%. Each message does not appear on a new line, but rather erases
- * the previous message.
+ * This example code will print completion messages at 10% increments;
+ * i.e., 10%, 20%, 30%, etc., up to 100%. Each message does not appear
+ * on a new line, but rather erases the previous message.
  * 
- * G_percent() should stay at the start of the for loop. If the loop takes
- * a long time to run, 0% should print before the first iteration has begun,
- * and final 100% message in loop should not be printed before the last
- * iteration is complete. Otherwise it seems to stall at 99% done, etc.
+ * Note that to prevent the illusion of the module stalling, the G_percent()
+ * call is placed before the time consuming part of the for loop, and an
+ * additional call is added after the loop to "finish it off" at 100%.
  *
  * \param n current element
  * \param d total number of elements



More information about the grass-commit mailing list