Hello there! I've searched on Google, Forums, etc, but i'm out of luck. I'm 
trying to achieve the functionality on the code below, yet I don't want to 
print the new line, both samples works, but not like I want: I desire to print 
the given string "what" into an async way, just like we do using the echo and 
I'm really without ideas ...

The code below prints for every millisecs:

> import os
> 
> proc wait_n_print(what: string, iterations: int, millisecs: int) =
>     
> 
> var current = 0 var repeat = true
> 
> while repeat == true:
>
>> echo what os.sleep(millisecs)
>> 
>> current = current + 1
>> 
>> if current == iterations:
>>     repeat = false

The code below prints everything at once:

> import os
> 
> proc wait_n_print(what: string, iterations: int, millisecs: int) =
>     
> 
> var current = 0 var repeat = true
> 
> while repeat == true:
>
>> stdout.write what os.sleep(millisecs)
>> 
>> current = current + 1
>> 
>> if current == iterations:
>>     repeat = false

So, again, I wanna print for every iteration the given string, and not all at 
once.

Any ideas? TY!

Reply via email to