<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>Hi
Jill - </FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>Python
for .NET doesn't yet handle in, in/out, ref etc. parameters yet. This is one
</FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>of the
(surprisingly few) places where the Python model doesn't match well with
</FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>.NET.
In the future, I expect that Python will return a tuple of (result, outparam,
outparam...) </FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>to
handle out params, but its not there yet.</FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>A
quick workaround would be to implement a helper method that calls MyMethod
</FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>and
returns the modified int as its result, then call that from Python. (If you need
</FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>both
the bool result and the int, you could return a struct,
etc.)</FONT></SPAN></DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=640325614-25032004><FONT face=Arial color=#0000ff size=2>Hope
this helps!</FONT></SPAN></DIV>
<DIV> </DIV><BR>
<P><FONT size=2>Brian Lloyd
brian@zope.com<BR>V.P. Engineering
540.361.1716 <BR>Zope
Corporation <A href="http://www.zope.com/"
target=_blank>http://www.zope.com</A><BR></FONT></P>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
pythondotnet-bounces@python.org [mailto:pythondotnet-bounces@python.org]<B>On
Behalf Of </B>Jill-Connie Lorentsen<BR><B>Sent:</B> Thursday, March 25, 2004
7:26 AM<BR><B>To:</B> pythondotnet@python.org<BR><B>Subject:</B> [Python.NET]
How to use "out" or "ref" on method parameter list<BR><BR></FONT></DIV>
<DIV>I have a DotNet class with methods with the following
signature:<BR><BR>public bool MyMethod(out int myVariable)<BR>{<BR>
myVariable = 5;<BR> return true<BR>}<BR><BR>Does anybody know how I
cancall them from Python via CLR?<BR>I've tried MyMethod(a), where a has been
an empty list, a list with one<BR>element, an integer etc, but nomatter what i
get an error saying TypeError:<BR>no method matches given arguments<BR><BR>Can
anybody help?<BR><BR>Jill</DIV>
<DIV><FONT size=2><BR></FONT> </DIV></BLOCKQUOTE></BODY></HTML>