所以我需要将数组传递到global procedure
,但像往常一样,我必须重新定义它。我知道这是一个noobie问题,但可以将数组作为过程传入?如果不是,它是否可以成为全球性的并插入到程序中。将数组传递到全局过程
$selectedFace = `ls -selection` ;
global proc crTestScripts($selectedFace) {
print ("OMG aren't lists of things awesome?!" + $selectedFace) ;
}
或
$selectedFace = `ls -selection` ;
global array? $selectedFace ;
global proc crTestScripts() {
global array? $selectedFace ;
print ("OMG aren't lists of things awesome?!" + $selectedFace) ;
}
我传递这个字符串,我仍然得到这个错误:
Error: Wrong number of arguments on call to applyCurrentType
下面是代码样本:
string $selectedFace[] = `ls -sl` ;
global proc applyCurrentType (string $selectedFace[]) {
print("Apply Current Type button clicked\n") ;
global int $applyCurrentType ;
$applyCurrentType = 1 ;
select -cl ;
select $selectedFace ;
crTestScripts ;
}
我知道这件作品迟到了,但是t他得到的错误可能是由于你如何调用你的applyCurrentType()函数。如果你可以从头开始,我们可能会帮助更多? (该调用应该看起来像:'applyCurrentType($ selectedFace)'methinks) – tanantish