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

[REBOL] Re: Input validation routines

From: robert:muench:robertmuench at: 27-Aug-2003 14:18

> -----Original Message----- > From: [rebol-bounce--rebol--com] [mailto:[rebol-bounce--rebol--com]] > On Behalf Of Petr Krenzelok > Sent: Wednesday, August 27, 2003 9:15 AM > To: [rebol-list--rebol--com] > Subject: [REBOL] Re: Input validation routines > ha, Robert progressing in db area, right? :-)
Petr, you see I don't forget your input, it just sometimes takes some time :-)) Yes, you are right. I'm progrssing into DB and data-form area.
> My idea was to be able to e.g. have fields like: > > (99) - (999 999) > > where "9" means 'number from 0 - 9, whereas e.g. "x" means > char. Cursor should move so that you would be able to type only
numbers,
> chars "() -" (those would be skipped, you would not be able to delete
them, etc. Yes, something like this. My idea it to have VID styles that have a field 'validation where you attach such a format string too and that will either be valiated while typing or when leaving the field. Further an error-handler exists, which can pop-up a help string. layout [ ... field validate [(99) - (999 999)] validate-error [alter "Plase only enter numbers"]
> "99.99.999" - date format - I saw various implementations :-)
BTW: Do you have a reference how those format strings are expressed? I mean we have dialects and I'm sure we can clone this common way. I would follow the common way, as a lot of people know it.
> Well, in DOS, all letters were of the same width, but in GUI > environments, it is not the same, so " . ." move as you type, it is
a question
> how to do properly hilighting (some implementations failed, as you was
able to
> delete those date-format dots, etc.)
IMO in this case a check-as-you-type handler is needed. This handler will analyze the string (on a positional base) and insert the dots at the right place ;-)) and update the GUI. Robert