Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Field color change on error.

From: louisaturk:coxinet at: 17-Oct-2002 11:22

Hi Gabriele, Andrew, Anton, and Carl, Many thanks for all the help. I now have almost everything I want. Compositing everything all of you said I came up with this: lab "email:" email: field [ either email? attempt [load value] [ face/colors: reduce [white white] set-font face color black set-font face style 'normal ; <====<< DOESN'T WORK ][ replace value value "<<<<< INVALID EMAIL >>>>>" face/colors: reduce [red red] set-font face color yellow set-font face style 'bold show face ] ] return When an invalid email is entered, this sets the background color to red, and the font to bold yellow, and prints "<<<<< INVALID EMAIL >>>>>" exactly as I want. Then when a valid email is entered the colors are set back as they were. However, the font style remains bold. How do I set it back to normal? Also, why does this result in an error message instead of false?
>> email? kkkkk
** Script Error: kkkkk has no value ** Near: email? kkkkk
That just doesn't seem right to me in this particular context. I know that kkkkk is an unset word, but all you want to know with email? is the validity of the entry. It seems to me that email? value by itself should do what email? attempt [load value] does. Anton, your example is very interesting, and I am still studying it. Thanks again to all of you. Louis At 11:34 AM 10/17/2002 +0200, you wrote: