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


Joined: 07 Aug 2004 Posts: 340
|
Posted: Sat Jan 08, 2005 5:36 pm Post subject: how to stop |
|
|
:newloop
%k = @pred(%K)
dialog set,status1,Shutdown in %K s...
wait event,1
if @equal(@event(),0)
stop
end
if @equal(%K,0)
runh Shutdown.exe -s -t 00
end
goto newloop
how to stop(to exit) this part of script
i have stop button in script DONT work
i have option errortrap DONT work |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Sat Jan 08, 2005 6:04 pm Post subject: |
|
|
@event() is never going to be 0, it will be TIMER. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Sat Jan 08, 2005 6:31 pm Post subject: |
|
|
I have TIMER
:Timer
%t = @datetime(hh:nn)
dialog set,time,%T
IF @Equal(%T,%A)
goto newloop
end
i dont now what do you mean
i have made Presets of Shutdown time in hours this delays shutdown with %k = @pred(%K)
how to stop (cancel) this sucker |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sat Jan 08, 2005 9:05 pm Post subject: |
|
|
Hi Filip,
Do you mean something like this?
Cheers,
- Boo
| Code: |
DIALOG CREATE,New Dialog,-1,0,375,160
DIALOG ADD,STYLE,STYLE1,,16,,,RED
REM *** Modified by Dialog Designer on 01/08/2005 - 14:58 ***
%%num = 10
DIALOG ADD,STATUS,STATUS1,Program running...
DIALOG ADD,BUTTON,Stop,80,155,64,24,Stop
DIALOG ADD,TEXT,Time,34,150,,,@datetime(hh:nn:ss),,STYLE1
DIALOG SHOW
%K = 10
%A = @datetime(hh:nn:@fadd(@datetime(ss),10))
:evloop
wait event,.0001
%E = @event()
if @not(@null(%E))
goto %E
end
goto evloop
:newloop
%E = @event()
%k = @pred(%K)
dialog set,status1,Shutdown in %K seconds...
wait
if @equal(%E,STOPBUTTON)
goto Stopbutton
end
if @equal(%K,0)
info Run shutdown program!
goto close
end
if @equal(%E,CLOSE)
goto close
end
goto newloop
:Timer
dialog set,status1,Program running... Approximately %%num seconds until shutdown sequence...
%%num = @pred(%%num)
%T = @datetime(hh:nn:ss)
dialog set,time,%T
wait
IF @equal(%T,%A)
goto newloop
end
IF @greater(%T,%A)
goto newloop
end
goto evloop
:CLOSE
exit
:Stopbutton
info Script stopped!
stop
|
|
|
| Back to top |
|
 |
filip Valued Contributor


Joined: 07 Aug 2004 Posts: 340
|
Posted: Sat Jan 08, 2005 9:45 pm Post subject: |
|
|
| Thanks... |
|
| 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
|
|