This is a multi-part message in MIME format.

------extPart_000_000C_01C2CA85.E16DB640
Content-Type: text/plain;
	charsetso-8859-1"
Content-Transfer-Encoding: 7bit

First -- thanks Guy, that solved that problem and allowed me to find and
move on to the next.

Let's say I have a reference to an object called "contact" and it has an
attribute "phone".  The atrribute phone can be legally set like this:

contact.phone  703-277-7272"

But, let's say I have a variable, called meth.  And meth "phone".  I want
to use my variable meth like this:

contact.meth  703-277-7272"  # this should set phone


I tried using @meth, but I get a parse error.  How would I go about doing
this?

-Dwayne


> -----Original Message-----
> From: ts [mailto:decoux / moulon.inra.fr]
> Sent: Sunday, February 02, 2003 6:04 AM
> To: ruby-talk ML
> Cc: ruby-talk / ruby-lang.org
> Subject: Re: hash question...
>
>
> >>>>> "D" Dwayne Smurdon @ DNA Media Pro
> <smurdon / dnamediapro.com> writes:
>
> D> map.keys.each  |a| { person.a  s.Fields(map[a]).Value }
>                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  This is interpreted as an Hash, you must write
>
>    map.keys.each   {|a| person.a  s.Fields(map[a]).Value }
>                    ^^^^
>
>  now it's interpreted as a block
>
> D> D:/Apps/Ruby/projects/OutlookContact.rb:29: odd number
> list for Hash
>
>  This error message is for this
>
> pigeon% ruby -e 'hash   1 }'
> -e:1: odd number list for Hash
> pigeon%
>
> pigeon% ruby -e 'hash   1, 2 }'
> pigeon%
>
> pigeon% ruby -e 'hash   1, 2, 3 }'
> -e:1: odd number list for Hash
> pigeon%
>
>
> Guy Decoux
>
>

------extPart_000_000C_01C2CA85.E16DB640
Content-Type: text/html;
	charsetso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Windows-1252">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6249.1">
<TITLE>dynamic method name...was RE: hash question...</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>First -- thanks Guy, that solved that problem and allowed me to find and move on to the next.</FONT>
</P>

<P><FONT SIZE=2>Let's say I have a reference to an object called &quot;contact&quot; and it has an attribute &quot;phone&quot;.&nbsp; The atrribute phone can be legally set like this:</FONT></P>

<P><FONT SIZE=2>contact.phone = &quot;703-277-7272&quot; </FONT>
</P>

<P><FONT SIZE=2>But, let's say I have a variable, called meth.&nbsp; And meth == &quot;phone&quot;.&nbsp; I want to use my variable meth like this:</FONT>
</P>

<P><FONT SIZE=2>contact.meth = &quot;703-277-7272&quot;&nbsp; # this should set phone</FONT>
</P>
<BR>

<P><FONT SIZE=2>I tried using @meth, but I get a parse error.&nbsp; How would I go about doing this?</FONT>
</P>

<P><FONT SIZE=2>-Dwayne</FONT>
</P>
<BR>

<P><FONT SIZE=2>&gt; -----Original Message-----</FONT>

<BR><FONT SIZE=2>&gt; From: ts [mailto:decoux / moulon.inra.fr]</FONT>

<BR><FONT SIZE=2>&gt; Sent: Sunday, February 02, 2003 6:04 AM</FONT>

<BR><FONT SIZE=2>&gt; To: ruby-talk ML</FONT>

<BR><FONT SIZE=2>&gt; Cc: ruby-talk / ruby-lang.org</FONT>

<BR><FONT SIZE=2>&gt; Subject: Re: hash question...</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; &gt;&gt;&gt;&gt;&gt; &quot;D&quot; == Dwayne Smurdon @ DNA Media Pro </FONT>

<BR><FONT SIZE=2>&gt; &lt;smurdon / dnamediapro.com&gt; writes:</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; D&gt; map.keys.each&nbsp; |a| { person.a = rs.Fields(map[a]).Value }</FONT>

<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</FONT>

<BR><FONT SIZE=2>&gt;&nbsp; This is interpreted as an Hash, you must write</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp; map.keys.each&nbsp;&nbsp; {|a| person.a = rs.Fields(map[a]).Value }</FONT>

<BR><FONT SIZE=2>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^^^^</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt;&nbsp; now it's interpreted as a block</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; D&gt; D:/Apps/Ruby/projects/OutlookContact.rb:29: odd number </FONT>

<BR><FONT SIZE=2>&gt; list for Hash</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt;&nbsp; This error message is for this</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; pigeon% ruby -e 'hash = { 1 }'</FONT>

<BR><FONT SIZE=2>&gt; -e:1: odd number list for Hash</FONT>

<BR><FONT SIZE=2>&gt; pigeon%</FONT>

<BR><FONT SIZE=2>&gt;&nbsp; </FONT>

<BR><FONT SIZE=2>&gt; pigeon% ruby -e 'hash = { 1, 2 }'</FONT>

<BR><FONT SIZE=2>&gt; pigeon% </FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; pigeon% ruby -e 'hash = { 1, 2, 3 }'</FONT>

<BR><FONT SIZE=2>&gt; -e:1: odd number list for Hash</FONT>

<BR><FONT SIZE=2>&gt; pigeon% </FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; Guy Decoux</FONT>

<BR><FONT SIZE=2>&gt; </FONT>

<BR><FONT SIZE=2>&gt; </FONT>
</P>

</BODY>
</HTML>
------extPart_000_000C_01C2CA85.E16DB640--