well the reason its giving you that error is because your declaring $CurMod as an int instead of an int array, when the return is an array. Thats what it looks like to me at first glance at least. So just do something like this: global proc tkToggleHardEdgeSelect() { int $CurMode[] = `polySelectConstraint -q -sm`; if…
That gives: Error: "$CurMode" is not an array. I don't think that's the case, "-q -sm" returns a single value of the current constraint of ede smoothness: 0,1 or 2.