| View previous topic :: View next topic |
| Author |
Message |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Fri Jan 16, 2004 11:23 pm Post subject: Event when entering a field? |
|
|
Does anyone know of a way to fire an event when a user enters an edit field? Under certain conditions I need to ask the user a "pre-validation" question that will be used for a default in the field. _________________ Joe Floyd |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Jan 16, 2004 11:55 pm Post subject: |
|
|
Looks like the only way is something like:
| Code: |
OPTION DECIMALSEP,"."
DIALOG CREATE,Focus,-1,0,240,160
DIALOG ADD,EDIT,EDIT1,63,43
DIALOG ADD,BUTTON,BUTTON1,100,60,70,20
DIALOG SHOW
%%Focus = No
DIALOG FOCUS,BUTTON1
:Evloop
wait event,"0.01"
goto @event()
:Timer
if @BOTH(@EQUAL(@FOCUS(),EDIT1),@EQUAL(%%Focus,No))
%%Test = @INPUT(Input Something)
DIALOG SET,EDIT1,%%Test
%%Focus = Yes
end
if @NOT(@EQUAL(@FOCUS(),EDIT1))
%%Focus = No
end
goto evloop
:BUTTON1BUTTON
goto evloop
:Close
exit
|
_________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Sat Jan 17, 2004 1:41 am Post subject: |
|
|
Thanks - I hadn't thought of trying a timer.
I've never used a timer and don't fully understand it. How often does the TIMER event occur? _________________ Joe Floyd |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Jan 17, 2004 1:43 am Post subject: |
|
|
The second param of WAIT in evloop tells VDS how many seconds between Timer events. In the example above it's 0.01 seconds. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
jwfv Valued Contributor

Joined: 19 Mar 2002 Posts: 422 Location: Beaufort, SC
|
Posted: Sat Jan 17, 2004 2:21 am Post subject: |
|
|
Does the TIMER event occur if you just use WAIT EVENT with no time interval? If so, what is the default? Just curious. _________________ Joe Floyd |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Sat Jan 17, 2004 2:29 am Post subject: |
|
|
Nope, only works when specifying an interval. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sat Jan 17, 2004 4:04 am Post subject: |
|
|
Make sure for full compatibility that when using a decimal number, like
0.01 to use OPTION DECIMALSEP,"."  _________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Sat Jan 17, 2004 4:45 am Post subject: |
|
|
If you use "WAIT EVENT,0" and have not set the OPTION SLEEPTIME, then
the default I do believe is 100ms. You can change that by setting the
OPTION SLEEPTIME to something of your choice, like 50, 25 or 200. Then
just use 0 in the WAIT EVENT and your timer will wait as long as you
set in the OPTION SLEEPTIME.
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
|