Hi list, Is there a known issue with std.setenv() ? For me on XP sp1 std.setenv("foo", "bar"); Returns a zero and doesn't actually set anything. What I want to acomplish is the following; I want to have one shred that calls in a set of other shreds that all sync in the style of the otf examples but I'd like to set a environment variable that tells them what our bpm will be. Also; do I understand correctly that the only way of turning a string into a int or float is by abusing the acii numbers? Even if I happen to know the string is a number? As I type this I just realised it might be a lot more practical to stop postponing reading up on global classes, still it looks like std.setenv() is malfuctioning. Yours, kas.
I think the best way to do that is to use a global class with a static member variable. Among other advantages, you dont have to do any string to int/float conversion, if you accidentally mistype your variable names the compiler will complain, and its a lot more straightforward. For converting ASCII strings to ints or floats, look at the std.atoi () and std.atof() functions. spencer On Jun 1, 2006, at 10:38 AM, Kassen wrote:
Hi list,
Is there a known issue with std.setenv() ?
For me on XP sp1
std.setenv("foo", "bar");
Returns a zero and doesn't actually set anything.
What I want to acomplish is the following; I want to have one shred that calls in a set of other shreds that all sync in the style of the otf examples but I'd like to set a environment variable that tells them what our bpm will be.
Also; do I understand correctly that the only way of turning a string into a int or float is by abusing the acii numbers? Even if I happen to know the string is a number?
As I type this I just realised it might be a lot more practical to stop postponing reading up on global classes, still it looks like std.setenv() is malfuctioning.
Yours, kas. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On 6/1/06, Spencer Salazar
I think the best way to do that is to use a global class with a static member variable. Among other advantages, you dont have to do any string to int/float conversion, if you accidentally mistype your variable names the compiler will complain, and its a lot more straightforward.
Yes, thanks, that seems to be the way to go. I figured some of that out while I was typing my message but decided to send anyway because setenv() might still be in need of some attention. I mean; it's not the right solution to my situation right now but it should still work. Thanks. Kas.
participants (2)
-
Kassen
-
Spencer Salazar