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 


WAIT speed
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 1:11 am    Post subject: WAIT speed Reply with quote

Hi

I cant go 55

I cant seem to got faster than wait 0.04

Reason is I need faster REPEAT - UNTILs etc..

I've searched the forum without success on this item.

Is there a API wait command or something I can use like a wait.DLL?

Thanks all you VDS brain monsters..
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 2:48 am    Post subject: Reply with quote

I found this zip at the forum awhile back, but I got it to work with below script. delay.zip(delayVDS in mille seconds)

I provide a link below to get the delay.DLL zip (I checked it for virus allready)

http://www.vtol.us/web-forums/VDS5/projects/delayVDS/delay.zip

Below is compiled EXE of script below:
http://www.vtol.us/web-forums/VDS5/projects/delayVDS/delay2.zip

Code:
DIALOG CREATE,delayVDS,-1,0,253,123
DIALOG ADD,text,applytext,30,85,190,,Delay in mille seconds test
DIALOG ADD,BUTTON,apply,13,15,50,40,APPLY,,,hand
DIALOG ADD,BUTTON,leave,75,190,50,40,Close,,,hand
DIALOG ADD,text,test,80,85
dialog show

#  have delay.dll in path
external delay.dll
#DEFINE FUNCTION,DELAY

:Evloop
  wait event
  goto @event()

:applyBUTTON
%%counter = 0
%y = @DATETIME(ss)
REPEAT
 %E = @event()
 %%counter = @succ(%%counter)
 dialog set,test,%%counter
#  ERROR = untraped error
 %x = @DELAY(60)
UNTIL @equal(%%counter,30)@equal(%E,CLOSE)@equal(%E,LEAVEBUTTON)
goto evloop

:leaveBUTTON
:close
EXIT


This all works perfect as far as being faster than the VDS5 wait command, but I get an untrapped ERROR error.
But, be sure you keep clicking the APPLY button till you see the ERROR.

I'm I stupid again Rolling Eyes
Does anyone have a simple fix line for this script in mind, would appreciate it highly.
Thanks for looking Cool


Last edited by vtol on Sun Dec 17, 2006 5:00 am; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 17, 2006 4:19 am    Post subject: Reply with quote

I clicked Apply a dozen times and never got an error. I had the dll in same directory (if that makes a difference).

Though I did get an error from clicking Close as there's no leave label Rolling Eyes

_________________
cheers

Dave
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 5:08 am    Post subject: Reply with quote

oops

I edited the script and added the leave label, thanks.
I also updated the download delay2.zip.

Try testing it like this:
Click the Apply, then wait till it gets to 30, then click the apply.
Do that a few times, here the error appears on the second time around.

I was thinking if I was more advanced on ERROR trapping, a hint could guide me to making it work here.

Thanks for helping..
Back to top
View user's profile Send private message Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 17, 2006 5:41 am    Post subject: Reply with quote

vtol wrote:
Try testing it like this:
Click the Apply, then wait till it gets to 30, then click the apply.
Do that a few times, here the error appears on the second time around.

Yep, that's what I did, without getting an error. Maybe PC related? I tested it on an old Athlon 1.4GHz with 640MB of ram (running XP SP2).

As to your errortrap, you could try something like this:

Code:
:ErrorTrap
  if @equal(33,@error(E))
    wait 1
    goto evloop
  else
    warn Oh Crap! Runtime Error @error(E) at line @error(N)
    goto close
  end
  goto EvLoop


Though I've never tried bypassing a runtime error 33.

_________________
cheers

Dave
Back to top
View user's profile Send private message
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 17, 2006 5:52 am    Post subject: Reply with quote

Here's the errortrap code I use in default.dsc

Code:
:Error
:ErrorTrap
  if @equal(39,@error(E))
    freelib tfpvrdll.dll
    wait 1
    goto evloop
  end
  rem prevent continuous error loop if user chooses not to email support
  if %%ExitErr
    %%ExitErr = @succ(%%ExitErr)
  end
  rem  write error to application's log
  binfile write,1,text," "@datetime(ddddd tt) - !!! Runtime ERROR @error(E) at Line @error(N) !!! @chr(91)%V@chr(93)@cr()@lf()
  rem  old 'copy error' code (replaced by email support code)
  rem %o = @msgbox(Runtime Error @error(E) at Line @error(N) -  @chr(91)%V@chr(93)    @cr()@cr()Copy error message to clipboard?    ,%%ProgName Error!,$14)
  rem email support code
  %o = @msgbox(Runtime Error @error(E) at Line @error(N) -  @chr(91)%V@chr(93)    @cr()@cr()Email error message to ToppyTools Support?    ,%%ProgName Error!,$14)
  if @equal(%o,6)
    rem  old 'copy error' code (replaced by email support code)
    rem    clipboard set,%%ProgName Runtime Error @error(E) at line @error(N) @chr(91)%V@chr(93)
    rem email support
    shell open,"mailto:support@mydomain.com?subject=Runtime Error in "%%ProgName"&body="%%ProgName" v"%%Build" had a Runtime Error "@error(E)" at line "@error(N)" ["%V"]"
    goto close
  else
    rem prevent continuous error loop if user chooses not to email support
    if @greater(%%ExitErr,1)
      stop
    end
    %%ExitErr = 1
    goto close
  end
  goto EvLoop

_________________
cheers

Dave
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 5:58 am    Post subject: Reply with quote

Thanks
I'll have to test that little later.
I'm using VDS5, mabye its better with older VDS version Idea

Sorry the ERROR I allways get is below:
27 Untrapped error in an external command or function

Can I simply replace 33 with 27?
Back to top
View user's profile Send private message Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 17, 2006 6:00 am    Post subject: Reply with quote

vtol wrote:
Can I simply replace 33 with 27?

Yep

_________________
cheers

Dave
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 6:10 am    Post subject: Reply with quote

Laughing

Thats wierd, because is was exactly what VDS said in the ERROR.

Just adding the ErrorTrap label and the OPTION ERRORTRAP,ErrorTrap completely fixed it, or should I not see your WARN message?

Code:
OPTION ERRORTRAP,ErrorTrap
DIALOG CREATE,delayVDS,-1,0,253,123
DIALOG ADD,text,applytext,30,85,190,,Delay in mille seconds test
DIALOG ADD,BUTTON,apply,13,15,50,40,APPLY,,,hand
DIALOG ADD,BUTTON,leave,75,190,50,40,Close,,,hand
DIALOG ADD,text,test,80,85
dialog show

#  have delay.dll in path
external delay.dll
#DEFINE FUNCTION,DELAY

:Evloop
  wait event
  goto @event()

:ErrorTrap
  if @equal(27,@error(E))
    wait 1
    goto evloop
  else
    warn Oh Crap! Runtime Error @error(E) at line @error(N)
    goto close
  end
goto EvLoop   
 
:applyBUTTON
%%counter = 0
%y = @DATETIME(ss)
REPEAT
 %E = @event()
 %%counter = @succ(%%counter)
 dialog set,test,%%counter
#  ERROR = untraped error
 %x = @DELAY(60)
UNTIL @equal(%%counter,30)@equal(%E,CLOSE)@equal(%E,LEAVEBUTTON)
goto evloop

:leaveBUTTON
:close
EXIT


Anyways, thanks a billion, been trying to get that DLL working forever.

Thanks again Dave Cool
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 6:15 am    Post subject: Reply with quote

oops

It is having the error, just didnt notice with the trap.
But thats ok, I'll think of something to adjust for when error happens.
Maybe just switch to loop with regular WAIT command, then switch back.

I added a WARN to show when ERROR happens below:

Code:
OPTION ERRORTRAP,ErrorTrap
DIALOG CREATE,delayVDS,-1,0,253,123
DIALOG ADD,text,applytext,30,85,190,,Delay in mille seconds test
DIALOG ADD,BUTTON,apply,13,15,50,40,APPLY,,,hand
DIALOG ADD,BUTTON,leave,75,190,50,40,Close,,,hand
DIALOG ADD,text,test,80,85
dialog show

#  have delay.dll in path
external delay.dll
#DEFINE FUNCTION,DELAY

:Evloop
  wait event
  goto @event()

:ErrorTrap
  if @equal(27,@error(E))
    wait 1
    info ERROR happened".."
    goto evloop
  else
    warn Oh Crap! Runtime Error @error(E) at line @error(N)
    goto close
  end
goto EvLoop   
 
:applyBUTTON
%%counter = 0
%y = @DATETIME(ss)
REPEAT
 %E = @event()
 %%counter = @succ(%%counter)
 dialog set,test,%%counter
#  ERROR = untraped error
 %x = @DELAY(60)
UNTIL @equal(%%counter,30)@equal(%E,CLOSE)@equal(%E,LEAVEBUTTON)
goto evloop

:leaveBUTTON
:close
EXIT


You were a great help, Thanks again Dave Smile
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 6:20 am    Post subject: Reply with quote

One last thing, I'm wondering is this the only way to do this, is with this DLL?

And why no one else needs a faster WAIT command in VDS.

I seem to want or need it pritty frequent. Embarassed

Arrow
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 7:03 am    Post subject: Reply with quote

.
.Heres a good example of why it would be handy

Download my VDS5 EXE and DSC below:
http://www.vtol.us/web-forums/VDS5/projects/delayVDS/delay3.zip

Download original delay.DLL zip below:
http://www.vtol.us/web-forums/VDS5/projects/delayVDS/delay.zip

Code:
OPTION ERRORTRAP,ErrorTrap
DIALOG CREATE,delayVDS,-1,0,300,150
DIALOG ADD,text,applytext,30,85,190,,Delay in mille seconds test
DIALOG ADD,BUTTON,apply,13,15,50,40,APPLY,,,hand
DIALOG ADD,BUTTON,leave,118,240,50,22,Close,,,hand
DIALOG ADD,text,test,83,245
DIALOG ADD,PROGRESS,meter,80,20,219,20,,100
dialog hide,meter
dialog show

#  have delay.dll in path
external delay.dll
#DEFINE FUNCTION,DELAY

:Evloop
  wait event
  goto @event()

:ErrorTrap
  if @equal(27,@error(E))
    info ERROR happened".."
    goto evloop
  else
    warn Oh Crap! Runtime Error @error(E) at line @error(N)
    goto close
  end
goto EvLoop   
 

:applyBUTTON
%y = @DATETIME(ss)
DIALOG show,meter
%%counter = 0
REPEAT
 %%counter = @SUCC(%%counter)
 DIALOG SET,meter,%%counter
 %E = @event()
 %%counter = @succ(%%counter)
 dialog set,test,%%counter
 %x = @DELAY(12)
UNTIL @equal(%%counter,100)@equal(%E,CLOSE)@equal(%E,LEAVEBUTTON)
wait "0.5"
DIALOG hide,meter
dialog clear,test
wait "0.5"

%y = @DATETIME(ss)
DIALOG show,meter
%%counter = 0
REPEAT
 %%counter = @SUCC(%%counter)
 DIALOG SET,meter,%%counter
 %E = @event()
 %%counter = @succ(%%counter)
 dialog set,test,%%counter
 %x = @DELAY(12)
UNTIL @equal(%%counter,100)@equal(%E,CLOSE)@equal(%E,LEAVEBUTTON)
wait "0.5"
DIALOG hide,meter
dialog clear,test
wait "0.5"

goto evloop
 

:leaveBUTTON
:close
EXIT


It shows how it could out run the VDS WAIT command Cool
.
.


Last edited by vtol on Sun Dec 17, 2006 7:36 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 17, 2006 7:21 am    Post subject: Reply with quote

vtol wrote:
Thats wierd, because is was exactly what VDS said in the ERROR.

VDS said "Oh Crap"? Cool

vtol wrote:
Just adding the ErrorTrap label and the OPTION ERRORTRAP,ErrorTrap completely fixed it, or should I not see your WARN message?

You should only see the WARN message for all errors except 27

Also, if the dll continues to give runtime error 27 it will get stuck in a loop.

_________________
cheers

Dave
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Sun Dec 17, 2006 7:32 am    Post subject: Reply with quote

OK
Well it has the error here a lot at times, but it just keeps on ticking, not stuck in a loop as of yet.

Its a cool DLL, only wish someone would make one like it or the original maker would update it a bit.

Quess this is all done here till someone comes in with some new tips or ideas.

Thanks for helping Dave - I gotta sleep now, I'm on utter side of the rock.
Wink
Back to top
View user's profile Send private message Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Dec 17, 2006 8:18 am    Post subject: Reply with quote

I just tried your latest example and replaced the "%x = @DELAY(12)" line with the VDS wait command. Any value for "wait" from 0.05 to 0.001 results in your example taking 6 seconds. Changing the value to 0.06 results in it taking 11 seconds! The difference between 0.05 and 0.06 should only add 2 seconds (in your example). It also seems the wait command can't use a value of less than 0.05 (anything less than 0.05 gives the same result as 0.05).

With "%x = @DELAY(12)" it only takes 4 seconds.
With "%x = @DELAY(6)" it only takes 3 seconds.
With "%x = @DELAY(3)" it only takes 3 seconds.

So it seems delay.dll has a lower limit too.


I seem to remember reading about a dll or dsu that supported shorter waits than the VDS command supports... though it may have been delay.dll - or maybe gadget?


BTW when I run your latest compiled exe I get occasional errors. But when I run your code from within the (slower) VDS IDE I don't.

You could contact delay.dll's author (details in the delay.txt) though since it was written 9 years ago I don't imagine you'll get a reply.

_________________
cheers

Dave
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
Goto page 1, 2  Next
Page 1 of 2

 
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