<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
help_defs = new Object();<br>helps_defs.Atomic = "Roosters are atomic";<br>debug(helps_defs.Atomic); // gives me "Roosters are atomic"<br><div id="ecxidOWAReplyText44362" dir="ltr">
<div dir="ltr"><font size="2" color="#000000" face="Arial">myVar = 'Atomic';</font></div>
<div dir="ltr"><font style="" face="Arial">debug(help_defs[myVar]); // gives me u</font>ndefined.<br></div></div><br><br><br><hr id="stopSpelling">Subject: RE: [Xerte] Accessing associative arrays via variable?<br>Date: Sun, 27 Dec 2009 21:23:56 +0000<br>From: Julian.Tenney@nottingham.ac.uk<br>To: xerte@lists.nottingham.ac.uk<br><br>
<style>
.ExternalClass .ecxhmmessage P
{padding:0px;}
.ExternalClass body.ecxhmmessage
{font-size:10pt;font-family:Verdana;}
</style>
<div id="ecxidOWAReplyText44362" dir="ltr">
<div dir="ltr"><font size="2" color="#000000" face="Arial">myVar = 'Atomic';</font></div>
<div dir="ltr"><font face="Arial">debug(help_defs[myVar]);</font></div></div>
<div dir="ltr"><br>
<hr>
<font size="2" face="Tahoma"><b>From:</b> xerte-bounces@lists.nottingham.ac.uk on behalf of Dave Burnett<br><b>Sent:</b> Sun 27/12/2009 18:05<br><b>To:</b> Xerte list<br><b>Subject:</b> [Xerte] Accessing associative arrays via variable?<br></font><br></div>
<div><br>help_defs = new Object();<br>helps_defs.Atomic = "Roosters are atomic";<br>debug(helps_defs.Atomic); // gives me "Roosters are atomic"<br><br>Can I sub a variable into the place of .Atomic in that last statement?<br><br>Sort of like in AW, to call a value from a property list using a variable for the property name I'd use:<br><br>Trace(my_prop_list[Symbol("a"^some_variable)]) <br>
<hr>
Hotmail: Trusted email with Microsoft’s powerful SPAM protection. <a href="http://clk.atdmt.com/GBL/go/177141664/direct/01/">Sign up now.</a> </div>                                            <br /><hr />Hotmail: Powerful Free email with security by Microsoft. <a href='http://clk.atdmt.com/GBL/go/171222986/direct/01/' target='_new'>Get it now.</a></body>
</html>