| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Tue Jan 14, 2003 10:21 pm Post subject: running 2 timer labels? |
|
|
hello all
i don't know if i ask this before but how can i run to diff timer labels within a script? what i'am doing is one part of the code uses one timer and the other part of code uses the other timer...
thanks |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Jan 15, 2003 1:26 am Post subject: hummm |
|
|
maybe this can't be done  |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Jan 15, 2003 3:24 am Post subject: |
|
|
Sure it can be done Tim.
Simple example:
| Code: |
dialog create,Timer Demo,-1,0,300,200
dialog add,BUTTON,bDemo,10,10,65,25,Push Me!
dialog show
:Evloop
wait event,1
parse "%E;%D",@event(D)
goto %E
:bDemoBUTTON
dialog create,Timer Demo Child,-1,0,200,100,SmallCap
dialog add,Text,Text,10,10
dialog show
%x = 0
rem Notice I don't put "goto Evloop" here
:ChildLoop
wait event,1
%E = @event()
if @equal(%E,Timer)
goto ChildTimer
else
goto %E
end
:ChildTimer
%x = @succ(%x)
dialog select,1
dialog set,Text1,@succ(%x)
rem Now we send the ChildTimer back to the ChildLoop
goto ChildLoop
:CLOSE
if @greater(%D,0)
dialog select,%D
dialog close
wait event
%E = @event()
goto Evloop
end
exit
|
This is just one of many ways to do this. Hope this helps get ya going!  _________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Jan 15, 2003 3:50 am Post subject: ok |
|
|
I think i see what you are doing there.....
thanks
i will play with it to see what i come up with:) |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Jan 15, 2003 3:55 am Post subject: hummm |
|
|
i was playing with that script you posted and i get errors when running it
label not found BUT maybe you post a idea and not a working script to...
thought i would let you know
thanks |
|
| Back to top |
|
 |
ShinobiSoft Professional Member


Joined: 06 Nov 2002 Posts: 790 Location: Knoxville, Tn
|
Posted: Wed Jan 15, 2003 4:05 am Post subject: |
|
|
Sorry Tim. I just typed it out here, you were right about that.
Add the following to the script above:
| Code: |
:Timer
rem Do something here!
goto Evloop
|
_________________ Bill Weckel
ShinobiSoft Software
"The way is known to all, but not all know it." |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Jan 15, 2003 4:30 am Post subject: ok |
|
|
no problem i will try it later tonight...
thanks |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Jan 15, 2003 4:34 am Post subject: hummm |
|
|
looking at the script it seems that it ONLY runs one timer at a time....is there a way to have it run two timers at once....like if you hit a button it runs the second timer AND the main timer at the same time..
thanks |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Jan 15, 2003 5:58 am Post subject: sorry |
|
|
| I guess after reading my first post i didn't explain myself well enought sorry about that..the post above is what i meant |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Jan 15, 2003 6:33 am Post subject: heheh |
|
|
thanks mac  |
|
| Back to top |
|
 |
|