Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. 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 : Open Page or Post…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

864 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

20 Experts available now in Live!

Get 1:1 Help Now