Re: Power Objects: Enforcing Constrains During User Edit of Fields

From: Rick Greenwald <greenie_at_interaccess.com>
Date: 1996/06/22
Message-ID: <31CC2FC0.146D_at_interaccess.com>#1/1


Randall Gellens wrote:
>
> How to people enforce field constrants during user edit?
>
> For example, if a field can only contain numbers, it would be nice for
> letter and symbol keys to not work. Or if a field has a maximum length,
> it would be nice for ASCII keys to stop working when the maximum length is
> reached (but delete and backspace, for example, would still work).
>
> The alternative seems to be to put code in Validate(), but that doesn't
> happen until the user leaves the field. So they get an annoying error
> message and have to go back and fix it. I think it's nicer to have it be
> checked while in the field.
>
> I tried adding code to OnKey, and something like "If LEN ( Self.Value ) =
> Self.DataSize AND KeyCode = 0" seems to work, except that the length isn't
> updated as the user types. It only seems to get updated when the user
> leaves the field.
>
> Any ideas?
>
> --
> Randy Gellens "I speak for myself alone" Randy_at_Pensive.Org
You might want to look at the example for hiding a password at www.inquiry.com for more information in using the OnKey() method, which should work.

Lots of other new stuff too.

  • Rick Greenwald The Power Objects Pro at www.inquiry.com
Received on Sat Jun 22 1996 - 00:00:00 CEST

Original text of this message