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 


Popup capture problem

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


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Tue Aug 20, 2002 6:11 pm    Post subject: Popup capture problem Reply with quote

*sigh* No sooner do I solve one problem than another creeps in.

I'm able to identify the exact popup I wish to close (and I can close it beautifully, if such a thing is possible) but in order to do so my if @winexists(%%popup) statement has to run continuously:

:evloop
%e = @event()
if @winexists(%%popup)
goto PopupHandlingSub
else
if %e
goto EventHandlingSub
end
end
goto evloop

As a result of my brilliance, CPU usage goes up to 100% while the program is running. It seems I've created a digital boat anchor (can't use it for anything else).

So ... can we discuss this or what? Embarassed
Back to top
View user's profile Send private message
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Tue Aug 20, 2002 6:15 pm    Post subject: Reply with quote

Like Mac mentioned in the Knowledge Base, you can put a WAIT statement, such as
WAIT 0.1 or WAIT 0.05 (don't forget to place OPTION DECIMALSEP,. somewhere in your
script in that case) somewhere in the loop. In order to allow for even shorter delays,
you'll have to modify OPTION SLEEPTIME to something below 50 milliseconds.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
VDSuser
Contributor
Contributor


Joined: 21 Mar 2002
Posts: 58
Location: Somewhere in time

PostPosted: Tue Aug 20, 2002 6:41 pm    Post subject: Reply with quote

Once again, Tommy, you show me why you're there and I'm here. Thanks.

(Frankly, I didn't know there was a knowledge base. My link takes me directly to the General Help page so I can see what's going on. Guess I need to see what went on first! Wink )
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Tue Aug 20, 2002 7:33 pm    Post subject: Reply with quote

You're also missing the source code examples, product
releases, etc. Here's the forum index link:

http://www.vdsworld.com/forum/index.php

Also, the fractional WAIT times must be enclosed in
quotes for some countries (if I remember correctly...):

WAIT ".01"

As Tommy mentioned, use OPTION DECIMALSEP, "."
(somewhere near the beginning of the program unless
you're gonna change it again).

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Aug 21, 2002 8:32 am    Post subject: Reply with quote

Just for the record:

As long as
Code:
OPTION DECIMALSEP,.

is set, there is no need to quote the value of the WAIT command.
Code:
WAIT .1

will work fine also on platforms using comma as the decimal separator.

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Aug 21, 2002 4:34 pm    Post subject: Reply with quote

Hiya Dread, Smile

Finally found the old post mentioning quotes on a fractional WAIT
(sledge was having problems without quotes):

http://www.vdsworld.com/archive/index.php?page=topic&board=14&topic=30

Try this COMMA example with and without the quotes (tested on VDS3).
With quotes, it waits 9/10 of a second after ya hit the close button.
Without quotes it waits 9 seconds after ya hit the close button.
Code:

OPTION DECIMALSEP, ","
DIALOG CREATE,Test Program,-1,0,100,50,SMALLCAPS
DIALOG SHOW

:EVLOOP
  REPEAT
    WAIT "0,9"
  UNTIL @event()

:CLOSE
  EXIT

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Aug 21, 2002 6:49 pm    Post subject: Reply with quote

Hi Mac!

Ahaaa, that's interesting. You're absolute right - without the quotes it's a long wait 8O
I never noticed that behaviour before. Perhaps because my systems run with comma as the decimal separator, so in my progs
using numeric values or WAIT statements I routinely set
Code:
OPTION DECIMALSEP,.

to avoid problems when the progs are used on systems having a point decimal separator.

When I do that, I never saw problems when just coding WAIT .2 or WAIT 0.2 etc. (with no quotes).

*************

But is a bit intriguing; it seems that a plain WAIT command could take some parameter other than just a numeric value.

Try this

Code:
OPTION DECIMALSEP, ","
DIALOG CREATE,Test Program,-1,0,100,50,SMALLCAPS
DIALOG SHOW

:EVLOOP
  REPEAT
   WAIT 2,event
  UNTIL @event()

:CLOSE
  EXIT


Now you don't even have to touch that Close button Wink

Greetz
Dread

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Aug 21, 2002 7:02 pm    Post subject: Reply with quote

Lol, extra WAIT parameters create a TIMER event...

WAIT EVENT, 2

OR

WAIT 2, EVENT

both do the same thing... Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Wed Aug 21, 2002 7:16 pm    Post subject: Reply with quote

Yoooo. Didn't figure that one out at first.

But it's kinda strange syntax, isn't it! Documentation still says nothing about WAIT <interval> being capable of using params. Confused

Dread
_________________

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
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