Re: Power Objects Bug or feature? Help!

From: Rick Greenwald <greenie_at_interaccess.com>
Date: 1996/07/20
Message-ID: <31F10CDD.2024_at_interaccess.com>#1/1


DNIEDaniel Lundin wrote:
>
> Help! I'm under attack from the evil bugs of Power Objects
> 1.0.16!
>
> I first created an integer-type field called fldTextLength.
> Then I've created a string-type multiline textfield with an
> OnKey method that looks like this:
>
> OnKey(keychar, keycode, shift)
> IF keycode=5 AND shift=1 THEN
> fldTextLength.value=LEN(self.value)
> OnKey=true
> END IF
>
> Guess what? When hitting shift+space nothing happens! I
> tried changing to other key characters as well, but it does
> not work... :(
>
> Apparently a field cannot referer to its own value in method
> code until it has lost focus and then regained it again.
> Then it works. Once... Until the value of the field has
> changed, where you have to get the field to loose and regain
> focus once more....
>
> This must be a bug.. or? Anyone have a solution?
>
> ---------------------------------------------------------------

Daniel -

When the OnKey() method is fired, you can look at the keychar variable which is passed to the method to determine the current keystroke. By using this plus the value, you have what you want.

For a detailed explanation on how to use OnKey to hide a password, which you can probably translate into what you want, go check out the OPO Pro section at www.inquiry.com. There's been a bunch of new tips posted recently.

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

Original text of this message