2017-08-08 8 views
1

て文字列の配列を渡すと、これはMELで私のコードですが、動作していない理由を私は知らない。procの

window -width 150; 
columnLayout -adjustableColumn true; 
    button -label "Button 1" -command "Base"; 
    button -label "Button 2" -command "Top"; 
    button -label "Button 3" -command "test"; 
showWindow; 

global string $BaseCurves, $TopCurves; 

global proc Base() { 
    $BaseCurves=`ls -sl`; 
} 

global proc Top() { 
    $TopCurves=`ls -sl`; 
} 

global proc test() { 
    print $TopCurves[0]; 
} 

を、私はこのエラーを持っている理由私にはわからない:

"$TopCurves" is an undeclared variable. 

答えて

0

試してみてください:

global string $BaseCurves; 

window -width 150; 
columnLayout -adjustableColumn true; 
    button -label "Button 1" -command "Base"; 
    button -label "Button 2" -command "Top"; 
    button -label "Button 3" -command "test"; 
showWindow; 

global proc Base() { 
    $BaseCurves=`ls -sl`; 
}; 

global proc Top() { 
    $TopCurves=`ls -sl`; 
}; 

global proc test() { 
    string $TopCurves[0]; 
}; 

¡希望があります。