Tåke
11-25-2003, 06:54 AM
string $objects[] = sort(`ls -sl -l`);
string $objects[] = `ls -sl -l`;
If I use one of these arrays in my code, it works nicely.
But, if I try using an if command to switch between the making of the array, I just get a bunch of errors.
I've tried declaring the array almost everywhere in the script, but it wont work.
It seems like maya wants to process the info below my if command before anything else!!
How can it be solved?
The sketchy code:
if ($sortobj == 1) {
string $objects[] = sort(`ls -sl -l`);
}
else {
string $objects[] = `ls -sl -l`;
}
string $objects[] = `ls -sl -l`;
If I use one of these arrays in my code, it works nicely.
But, if I try using an if command to switch between the making of the array, I just get a bunch of errors.
I've tried declaring the array almost everywhere in the script, but it wont work.
It seems like maya wants to process the info below my if command before anything else!!
How can it be solved?
The sketchy code:
if ($sortobj == 1) {
string $objects[] = sort(`ls -sl -l`);
}
else {
string $objects[] = `ls -sl -l`;
}
