Pete Goodeve wrote:
> define echo();
> lvars temp;
> ''->str;
> repeat forever
> cucharin()->temp;
> if temp = termin then return; endif;
> str><consstring(temp, 1)->str;
> endrepeat;
> enddefine;
>
> Still can't see any way to get rid of 'temp' because I have to check
> for termin, but I guess that's no biggie.
Well, you could do
define echo();
until dup(cucharin()) = termin then enduntil;
.erase; ;;; don't include termin in the string
consstring(stacklength())->str;
enddefine;
That actually tacks a new line on the end of str, because you have to
press return before ^D in order to get cucharin to produce a termin if
it is reading from the keyboard. A second erase command will fix that.
|