Solved

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

Posted on 2001-09-04
4
200 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

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…
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
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…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

823 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