[chuck-users] Flush ChucK IO

Tom Aizenberg tom at tomaizenberg.nl
Fri May 21 11:54:30 EDT 2010

Hi Kas,


Thanks, if this works that's fine with me a  ftos or .toString() would be
even better of course ;)






Van: chuck-users-bounces at lists.cs.princeton.edu
[mailto:chuck-users-bounces at lists.cs.princeton.edu] Namens Kassen
Verzonden: vrijdag 21 mei 2010 17:49
Aan: ChucK Users Mailing List
Onderwerp: Re: [chuck-users] Flush ChucK IO




A different question I now have is, how do I convert a float to a string?
Haven't been able to find this in the documentation/examples. :(




Strangely casting doesn't work (I feel it should). This works though;


3 => float foo;


string bar;


foo +=> bar;




That's more or less a implicit cast.


We can also make it a bit nicer and create a function that you could use
inside of the creation of your OSC messages;


//Float TO String converter


fun string ftos(float arg)


    string bar;

    arg +=> bar;

    return bar;



//trivial test

<<<ftos( 123.45 ) >>>; 


I still feel the lack of a real cast for this is a missing feature though.
And I'd like to be able to overload the cast operation.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20100521/e90983ef/attachment-0001.html>

More information about the chuck-users mailing list