Home Technical Talk

In MEL, trying to create a group, if that group already exists delete it.

polycount sponsor
Offline / Send Message
malcolm polycount sponsor
I can't get this working, if I remove the break the script works, but it creates too many erroneous groups, with the break in there it creates a single group, but then when I run the script again it ignores the if statement? Any idea what I'm doing wrong?

string $transforms[] = `ls -tr`;
for ($t in $transforms)
{
    if ($t == "null1")
    {
        delete $t;
        print "Deleted group.";
    }
   
    else
    {
        CreateEmptyGroup;
        print "Created group.";
        break;
    }
}


Replies

Sign In or Register to comment.