View Full Version : Brain Fart

10 October 2009, 03:39 PM
You know how you have one of those days where you just can't seem to think of how to do something....

This brings along my question...

I have an attribute, an integer without an end but I want the following to happen. When the number is ten, twenty, thirty etc. I want it to drive another attribute that is within the range of 0-9, in other words, when the greater driving attribute is 10 the driven attribute is 0, driver = 11, driven = 1 etc. Is this possible? basically removing the # from this ##0. Removing the extra number...

Or if there is a wildcard that I can use ie. "if (number_grp.geoCycle == %1)"


P.S. I'm not sure if that was clear...

10 October 2009, 02:20 PM
Well, the only way that comes to my mind right now is to cast a string from your integer and remove the ## you dont want with substring.

10 October 2009, 02:24 PM
this should work, just a quick example:

int $myInt = 123;
string $myString = "";

$myString = $myInt;
string $myNewString = `substring $myString 3 3`;
int $myNewInt = $myNewString;
print ($myNewString + ":" + $myNewInt);

CGTalk Moderation
10 October 2009, 02:24 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.