我认为如果我可以访问设置为特殊名称空间(如框、窗口等)的变量,那就太好了。请参阅以下脚本,
Names Default To Here( 1 );
testbox = Function( {items, win_index = 1, box_index = 1},
{default local},
ctb = Context Box(
box:win_index = win_index;
box:box_index = box_index;
box:hlb = H List Box(
box:btn_close = Button Box( "Close Me", box:hlb << delete ),
box:btn_get = Button Box( "Get Selected", Print( box:lb_items << get Selected ) ),
box:btn_find = Button Box( "Find Me", Print( box:win_index, box:box_index ) ),
box:btn_select = Button Box( "Select
Me", box:hlb << Select ),
box:btn_deselect = Button Box( "DeSelect Me", box:hlb << DeSelect ),
box:lb_items = List Box( items )
);
);
Return( ctb );
);
nw = new window("Test Window",
window:win_index = 14;
window:box_index = 28;
cont_box = testbox( {"1", "2", "3"}, 3, 4 ),
textbox("Some stuff")
);
如果我可以访问 nw:win_index 和 cont_box:win_index 并正确显示值,那就太棒了。 目前它只能从 EvalContextBox 内部访问命名空间。
我很高兴与大家分享这个问题已在 JMP 15 中得到解决,该版本目前正在开发中,将于秋季推出。引用现在可用于访问在它们引用的对象范围内的变量。 这包括窗口、上下文框、JMP 应用程序和 JMP 应用程序模块实例。 例如,如果您有一个窗口引用 w,w:var 和 Namespace(w) 现在可以工作。