Here is a slightly more "modern" way to program it.
Once fired up MSWLogo is free to other things while
that text blinks. It's only "busy" when the timer fires
rather than "busy" all the time in the former infinite
recursive call.
to main ; blink
cs ht
draw
make "Blink.On "True
settimer 1 500 [blink [Welcome to Logo]]
end
to blink :txt
pu setpos[-85 -110] pd seth 90 ; LABEL location
ifelse :Blink.On [setpc [255 0 0] make "Blink.On "False] ~
[setpc screencolor make "Blink.On "True]
label :txt
end
to draw
setpc[0 0 0]
repeat 6[repeat 6[fd 50 rt 60] rt 60]
end
Yehuda Katz wrote:
>
> Hello,
>
> Sometimes it's desirable to erase a LABELed text from the screen, e.g.,
> when creating the digital part in an analogical-digital watch. CS is no
> help here, as it erases EVERYTHING on the screen, while we want
> SELECTIVE erasure.
>
> Erasing LABELed text is done by re-LABELing the text *precisely* on the
> already LABELed text, but this time in the background color. This can be
> accomplished in UCBLogo by:
> SETPC BG
> LABEL [your text]
>
> and in MSWLogo by saying:
> SETPC SCREENCOLOR
> LABEL [your text]
>
> After it you need, of course, restore the original pen color, for the
> rest of your program.
>
> As an illustration, I wrote the following program:
>
> ===================================================
> to main ; blink
> cs ht
> draw
> blink[Welcome to Logo]
> end
>
> to draw
> setpc[0 0 0]
> repeat 6[repeat 6[fd 50 rt 60] rt 60]
> end
>
> to blink :txt
> pu setpos[-85 -110] pd seth 90 ; LABEL location
> setpc [255 0 0] label :txt wait 30 ; red pencolor
> setpc screencolor label :txt wait 30 ; screen color
> blink :txt
> end
> ===================================================
>
> Run it: That's an endless loop; to stop it hit Ctrl+Q or Ctrl+Break (in
> UCBLogo), or push HALT in MSWLogo.
>
> The "trick" for erasing LABELed text is undocumented, maybe because the
> designers found it self evident.
>
> Incidently, George might want to add a digital watch upon his analogical
> demo CLOCK.LGO.
>
> Enjoy it,
>
> [[Yehuda]]
>
> ---------------------------------------------------------------
> Please post messages to the Logo forum to logo-l@gsn.org. Mail
> questions about the list administration to logofdn@gsn.org. To
> unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
--
===============================================================
George Mills (mills@softronix.com)
http://www.softronix.com/
The www page contains some very powerful educational software.
Our single most important investment is our kids.
---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.
Global SchoolNet Foundation -
Linking Kids Around the World!
Copyright GSN - All Rights Reserved
- Comments
& Questions
Visit GSN's
Global
Schoolhouse for more exciting learning resources!
Search our Site
-
Home