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.
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