^ title ^

Offline
obviously, how else was the wait () secs block made?
Offline
There certainly is a sleep function. I never googled it, but you might as well do.
In case you find nothing, you can always use steps.
Offline
joefarebrother wrote:
obviously, how else was the wait () secs block made?
I know, but that's because it's a timer block (#t). Other timer blocks include play note for ( ) secs and play drum for ( ) secs. When these blocks are used in Squeak, they work for their full value, but don't wait for the next commands (at least in experience). For example, playing a note for 2 beats and then returning something will play that note for 2 beats, but will immediately return the value without waiting for the note to finish.

Offline
LS97 wrote:
There certainly is a sleep function. I never googled it, but you might as well do.
In case you find nothing, you can always use steps.
I found a delay thing, used by the syntax
(Delay forSeconds: NUMBER) wait
but it delays everything, and I was hoping for something that would only delay the method that runs it...

Offline
I would make a variable for the current time (in milliseconds) and run a loop until the time - the variable is the desired time. There's a way to do this so the loop doesn't make it crash, but I forget what it is.
Offline
rubiks_cube_guy238 wrote:
I would make a variable for the current time (in milliseconds) and run a loop until the time - the variable is the desired time. There's a way to do this so the loop doesn't make it crash, but I forget what it is.
How would the loop make it crash? (That's a really good idea, using the time as a timer...)

Offline
Greenatic wrote:
LS97 wrote:
There certainly is a sleep function. I never googled it, but you might as well do.
In case you find nothing, you can always use steps.I found a delay thing, used by the syntax
Code:
(Delay forSeconds: NUMBER) waitbut it delays everything, and I was hoping for something that would only delay the method that runs it...
i THINK you have to go deep inside the execution engine to do that...
Offline
Greenatic wrote:
LS97 wrote:
There certainly is a sleep function. I never googled it, but you might as well do.
In case you find nothing, you can always use steps.I found a delay thing, used by the syntax
Code:
(Delay forSeconds: NUMBER) waitbut it delays everything, and I was hoping for something that would only delay the method that runs it...
Use steps then. You know what that is right?
"stepTime" and "step:" methods?
Offline
LS97 wrote:
Greenatic wrote:
LS97 wrote:
There certainly is a sleep function. I never googled it, but you might as well do.
In case you find nothing, you can always use steps.I found a delay thing, used by the syntax
Code:
(Delay forSeconds: NUMBER) waitbut it delays everything, and I was hoping for something that would only delay the method that runs it...
Use steps then. You know what that is right?
"stepTime" and "step:" methods?
No, I don't...could you please explain?

Offline
Greenatic wrote:
LS97 wrote:
Greenatic wrote:
I found a delay thing, used by the syntaxCode:
(Delay forSeconds: NUMBER) waitbut it delays everything, and I was hoping for something that would only delay the method that runs it...
Use steps then. You know what that is right?
"stepTime" and "step:" methods?No, I don't...could you please explain?
^ last post ^
bump

Offline