Delay function?

Jarrett Billingsley jarrett.billingsley at gmail.com
Tue Sep 2 07:21:18 PDT 2008


On Tue, Sep 2, 2008 at 7:11 AM, Brendan <brenzie at gmail.com> wrote:

> Brendan Wrote:
>
> > I looked through the Phobos page, but haven't found anything like it. Is
> there a sort of delay function anywhere in Phobos?
>
> Well, I just used 'sleep' from the Linux shell instead. I don't understand
> yet what I'm doing wrong with the following function, though. Could someone
> explain and advise?
>
>
> void scrollString( char[] s ) {
>    for ( int i = 0; i < s.length; i++ )
>      writef( s[i] );
>      system( "sleep 0.2" );
>  }
>
>
If you're expecting it to pause after each character.. you're missing braces
around the body of the for loop, this isn't Python ;)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20080902/914528c8/attachment.htm>


More information about the Digitalmars-d-learn mailing list