script: writing text without newline
Henrique Barbosa
hmjbarbosa at GMAIL.COM
Wed May 11 14:43:09 EDT 2005
Diane and Mathias,
You both sugestted the same, but that doesn't work for me.
My intention is to create a kind of progress bar, so it doesn't
make sense to accumulate a line's content.
For that, I really need to write strings to the same line, one after the other.
That's what prompt does, but I need to eliminate the buffer, so that the
strings appear on the screen as soon as the are written.
Any other clue?
Henrique Barbosa
On 5/11/05, Diane Stokes <diane.stokes at noaa.gov> wrote:
> Henrique,
>
> How about storing up the values in a string, then say the string at the
> end of the inner loop. Something like:
>
> x=1
> while (x<xmax)
> 'set x 'x
> * initialize variable xystring with "x" info
> xystring='x'x' & '
> y=1
> while (y<ymax)
> 'set y 'y
> * append your "y" info to xystring
> xystring=xystring%'y'y' '
>
> (...) some time consuming calculation
>
> y=y+1
> endwhile
> * print completed xystring
> say xystring
> x=x+1
> endwhile
>
> Diane
>
>
> Henrique Barbosa wrote:
>
> > Hi All,
> > Anybody know how can we "say" a text without a newline?
> >
> > I have a script which loops through x and y, and I want
> > to output something for each grigpoint, however, for all y in the
> > same line. Something like:
> >
> > ga-> my_script.gs
> > x1 & y1 y2 y3 y4 ....
> > x2 & y1 y2 ...
> > ...
> >
> > The script looks like this:
> >
> > x=1
> > while (x<xmax)
> > 'set x 'x
> > say 'x'x' & '
> >
> > y=1
> > while (y<ymax)
> > 'set y 'y
> > say 'y'y' '
> >
> > (...) some time consuming calculation
> >
> > y=y+1
> > endwhile
> > x=x+1
> > endwhile
> >
> > The problem is that the command [say] always add a new line,
> > and the output ends up like:
> >
> > ga-> my_script.gs
> > x1 &
> > y1
> > y2
> > ...
> >
> > Any sugestions?
> >
> > Henrique Barbosa
> >
>
More information about the gradsusr
mailing list