Solved

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

Posted on 2001-09-04
4
205 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
ID: 6454696
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
ID: 6461913
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
ID: 6462134
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
ID: 6463822
Thanks.  That seems to do the job.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How do you create a simple buy now button for a website? 7 73
you tube .com 2 206
How to capture emails for mailing list in WordPress 3 63
Column Spacing 3 94
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

830 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