forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Event when entering a field?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Fri Jan 16, 2004 11:23 pm    Post subject: Event when entering a field? Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Fri Jan 16, 2004 11:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Sat Jan 17, 2004 1:41 am    Post subject: Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sat Jan 17, 2004 1:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Sat Jan 17, 2004 2:21 am    Post subject: Reply with quote

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
View user's profile Send private message
SnarlingSheep
Professional Member
Professional Member


Joined: 13 Mar 2001
Posts: 759
Location: Michigan

PostPosted: Sat Jan 17, 2004 2:29 am    Post subject: Reply with quote

Nope, only works when specifying an interval.
_________________
-Sheep
My pockets hurt...
Back to top
View user's profile Send private message Send e-mail
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Jan 17, 2004 4:04 am    Post subject: Reply with quote

Make sure for full compatibility that when using a decimal number, like
0.01 to use OPTION DECIMALSEP,"." Smile

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sat Jan 17, 2004 4:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group