Solved

Is there a command in Lingo similar in function to a "C" Sleep command?

Posted on 2001-09-04
4
186 Views
Last Modified: 2013-12-24
I would like to pause a handler for a brief amount of time.  I tried using a "pause" and a "delay" statement but they didn't seem to accomplish the results I need.  I am a novice to Director so I need specifics.
0
Comment
Question by:bleek
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:winwiz
Comment Utility
I'm not sure you I have enough information about your issue.  But if you are trying to wait for something to occur, you could use a repeat while statement:

repeat while flag <> 1
--nothing
-- the behavior will sit here until flag = 1
end repeat


-- at some point you would set flag = 1 and the behavior will continue.

--
hope this helps, if not, please be more specific about what you are trying to accomplish.

thanks
0
 

Author Comment

by:bleek
Comment Utility
I was hoping for a set time for the pause, like a Sleep(1000) in "C".  I saw a "Wait for Time Duration "  but didn't get enough detail to use it. If there is no such feature, I will have to use a loop, but I was trying to avoid that.
0
 
LVL 2

Accepted Solution

by:
winwiz earned 100 total points
Comment Utility
I have written a handler to use that should work exactly like the sleep() funcion in C.

put this code into a movie script, so you'll be able to call it from anywhere:

on sleep secs
  startTimer
  repeat while the timer < secs*60
    --do nothing  
  end repeat
  return
end

then, just like in C, you can have a time out any time by calling sleep():   i.e.=  

on beginsprite me
sleep(5) -- wait for 5 seconds
alert "it's been 5 seconds"
end
0
 

Author Comment

by:bleek
Comment Utility
Thanks.  That seems to do the job.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now