| View previous topic :: View next topic |
| Author |
Message |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Tue Aug 20, 2002 6:11 pm Post subject: Popup capture problem |
|
|
*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?  |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Tue Aug 20, 2002 6:15 pm Post subject: |
|
|
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 |
|
 |
VDSuser Contributor


Joined: 21 Mar 2002 Posts: 58 Location: Somewhere in time
|
Posted: Tue Aug 20, 2002 6:41 pm Post subject: |
|
|
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! ) |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Tue Aug 20, 2002 7:33 pm Post subject: |
|
|
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  _________________ 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 |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Aug 21, 2002 8:32 am Post subject: |
|
|
Just for the record:
As long as
| Code: | | OPTION DECIMALSEP,. |
is set, there is no need to quote the value of the WAIT command.
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 |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Aug 21, 2002 4:34 pm Post subject: |
|
|
Hiya Dread,
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  _________________ 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 |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Aug 21, 2002 6:49 pm Post subject: |
|
|
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
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Aug 21, 2002 7:02 pm Post subject: |
|
|
Lol, extra WAIT parameters create a TIMER event...
WAIT EVENT, 2
OR
WAIT 2, EVENT
both do the same thing...
Cheers, Mac  _________________ 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 |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed Aug 21, 2002 7:16 pm Post subject: |
|
|
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.
Dread
_________________ _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
|
|
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
|
|