<HTML>
<HEAD>
<TITLE>Send NULL arg to Class constructor</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi all &#8211; I have ported over one of our applications from using itcl to using xotcl. I have a lot of code that already uses the itcl stuff, so the port must be backwards compatible. I have the following issue. Can anyone give me an idea how I can get around it? A script that shows my issue is as follows:<BR>
<BR>
#!/usr/bin/tclsh<BR>
package req XOTcl<BR>
namespace import ::xotcl::*<BR>
<BR>
::xotcl::Class Connect -parameter {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{telnet}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{ssh}<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{ip}<BR>
}<BR>
Connect instproc init {node args} {<BR>
&nbsp;&nbsp;&nbsp;&nbsp;[self] instvar telnet<BR>
&nbsp;&nbsp;&nbsp;&nbsp;[self] instvar ip<BR>
}<BR>
<BR>
Connect dev node -ip &quot;127.0.0.1&quot; -telnet<BR>
<BR>
The above does not work, as it seems that the &#8211;telnet arg must not be NULL, however, I need this to be NULL, as it is just a flag.<BR>
<BR>
If I pass in:<BR>
Connect dev node -ip &quot;127.0.0.1&quot; -telnet &#8220;&#8221;<BR>
<BR>
This works, however, this is not backwards compatible with how things were with itcl, and I have too many users/scripts to change how this is done.<BR>
There are potentially 2 ways around this, however, I am unable to find information on if either of them are possible:<BR>
</SPAN></FONT><OL><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Allow the passing in of a NULL argument
</SPAN></FONT><LI><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Prevent the constructor parsing args so that I can parse my own <BR>
</SPAN></FONT></OL><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
I would appreciate any assistance<BR>
<BR>
Cheers<BR>
Colin<BR>
<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>