Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: Egg or bird: what's first?
Thread ID: 143433 Message ID: 143467 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Classes and Objects
Date: Wednesday, August 29, 2007 12:07:00 AM         
   


> >
> > "In VFP If you put some code in th event code (i don't know how to describe this) the default event code waren't execute if you don't add DODEFAULT(...) in it."
> >
> > Unless it is built-in:) Built-in code always executes at the end if not overridden by nodefault.
> >
> > Cetin Basoz
>
> No so sure.
> I never figured out when I need to put DODEFAULT in KeyPress event of the form. Sometimes If i put it the KeyPress event fires twice, sometimes if I didn't put it - no keypress is executed.
>
> -----------------
> Borislav Borissov
>
> Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
> The only thing normal about database guys is their tables.

Keypress as an example, the pressed key is always executed. Or lostfocus as another example, control loses focus:

* procedure lostfocus
if this.Value < 20
  * NODEFAULT && prevent base code so it can get focus
  this.SetFocus()
endif


Keypress to uppercase a-z:

procedure Keypress
lparameters key, control
if between(m.Key, asc("a"), asc("z"))
  dodefault(m.key-32,0)
  * nodefault && not having this one shows built-in executes after code
endif

Cetin Basoz

ENTIRE THREAD

Egg or bird: what's first? Posted by Ilya Rabyy @ 8/28/2007 7:50:35 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/28/2007 8:22:20 PM
RE: Egg or bird: what's first? Posted by Ilya Rabyy @ 8/28/2007 8:32:37 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/28/2007 8:36:23 PM
RE: Egg or bird: what's first? Posted by Borislav Borissov @ 8/28/2007 11:42:40 PM
RE: Egg or bird: what's first? Posted by Cetin Basoz @ 8/28/2007 11:46:26 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/28/2007 11:56:24 PM
RE: Egg or bird: what's first? Posted by Borislav Borissov @ 8/28/2007 11:56:41 PM
RE: Egg or bird: what's first? Posted by Ken Murphy @ 8/29/2007 12:03:44 AM
RE: Egg or bird: what's first? Posted by Cetin Basoz @ 8/29/2007 12:07:00 AM
RE: Egg or bird: what's first? Posted by Cetin Basoz @ 8/28/2007 11:31:35 PM