Thankyou Daniele,
I struggled to find the error but could not.
When I run the program direct with do %greetings.r
it works as expected, but if I paste the program into
the console it always stops with an error at that
screensize command. Only by breaking the program
there and running it in two parts could I get past the
error.
This is a test for me of whether I have the smarts to
do any serious debugging in Rebol. So far I fail.
Don
--------------------------------------------------------------------------
>[REBOL] Nobody wants to play with me :-(
>
>> Delivered-To: [EMAIL PROTECTED]
>> From: [EMAIL PROTECTED]
>> Date: Thu, 23 Dec 1999 14:28:27 -0800
>> Subject: [REBOL] Nobody wants to play with me :-(
>> Message-Id: <[EMAIL PROTECTED]>
>
>> As nobody else appears to be entering holiday demos, I am entering one more :-)
>>
>> This is actually a proof of concept for a series of text-gui.r functions I
>> have written (needed for several upcoming work-related projects).
>
>Fiddling with your previous %christmas.r I found a problem which could show up with
>this
>function (from %greetings.r) which is the same code
>
>screensize: func [/local xwidth yheight cons screen-dimensions][
> cons: open/binary [scheme: 'console]
> print "^(1B)[7n" screen-dimensions: next next to-string copy cons
> close cons
>
> parse screen-dimensions [copy yheight to ";" thru ";" copy xwidth to "R" to end]
> reduce [(load xwidth) - 1 (load yheight) - 2]
>]
>
>If you write something at the console before the 'print gets executed then the
>following 'next 'next
>would eat other chars than the expected "^(1b)[" and then (load xwitdh) would fail
>E.g. that happens if you strike some keys while the script is not yet arrived at
>'screensize
>(simulated with a 'wait)
>
>wait 3 screensize
>
>I would change
> print "^(1B)[7n" screen-dimensions: next next to-string copy cons
>in
> print "^(1B)[7n" screen-dimensions: to-string copy cons
>
>and
> parse screen-dimensions [copy yheight to ";" thru ";" copy xwidth to "R" to end]
>in
> parse screen-dimensions [ thru "^(1b)[" copy yheight to ";" thru ";" copy xwidth
>to "R" to end]
>
>resulting in
>
>screensize: func [/local xwidth yheight cons screen-dimensions][
> cons: open/binary [scheme: 'console]
> print "^(1B)[7n" screen-dimensions: to-string copy cons
> close cons
>
> parse screen-dimensions [ thru "^(1b)[" copy yheight to ";" thru ";" copy xwidth
>to "R" to end]
> reduce [(load xwidth) - 1 (load yheight) - 2]
>]
>
>Ciao,
>Daniele.