我正在运行 Coldfusion8
,但无法访问我设置的数组。
我的数组设置如下:
Application.strConfig.respH = arrayNew(2);
Application.strConfig.respH[1][1] = "s";
Application.strConfig.respH[1][2] = 127;
Application.strConfig.respH[2][1] = "m";
Application.strConfig.respH[2][2] = 230;
...
导致出现这个:
RESPH:
[array]
1) [array]
1) s
2) 127
2) [array]
1) m
2) 230
我需要根据页面中获取的尺寸来获得默认的数字。例如,当我得到m
时,我需要获取m
的respH
值。目前,我正在尝试以下方法:
<cfscript>
LOCAL.runner = "s,m,l,xl";
LOCAL.lt = ListGetAt(LOCAL.runner, LOCAL.i, ",");
LOCAL.height = Application.strConfig.respH[ LOCAL.lt ];
</cfscript>
这样做,Coldfusion 会抱怨 m
的值无法转换为数字。
问题:
如何访问我的 strConfig
对象中的元素?
感谢您的帮助!
ArrayFind
) - LeighApplication.strConfig.respH.s = 127
,以便像这样访问它:Application.strConfig.respH[LOCAL.lt]
。让我们看看这是否有效。你想把你的评论作为答案吗,这样我就可以检查了吗? - frequent