[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Dec 21 14:58:32 2001 
Subject:Re: Have I hit a bug already? 
From:Stephen Isard 
Volume-ID:1011221.02 

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.