[GRASS-dev] Re: G_percent() usage;
    Hamish 
    hamish_b at yahoo.com
       
    Wed Dec 10 00:46:53 EST 2008
    
    
  
Hamish wrote:
> re r34816,  http://trac.osgeo.org/grass/changeset/34816
> 
> G_percent() is needed after the loop has finished, otherwise "100%\n" is
> never printed, and the GUI progress bar* stalls at almost-complete.
> 
> consider the order of what happens here, and when will
> row==nrows (ie 100%):
>   for (row = 0; row < nrows; row++) { printf("row=%d\n", row); }
>   G_percent(row, nrows, 2); 
ok, I see what you did now with
  G_percent(row+1, nrows, 2); 
in the loop. But I think that's wrong. For one thing it incorrectly skips
0% done. (typically harmlessly corrected in rounding, but still
incorrect..)
maybe it's just me, but I prefer the historical way.
:/
Hamish
      
    
    
More information about the grass-dev
mailing list