<HTML>
<HEAD>
<TITLE>Re: V4CC - VVarchar constructors faulty</TITLE>
</HEAD>
<BODY>
<FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>On 1/3/10 10:42 PM, "Ernesto Giannotta" <ernestogiannotta@tiscalinet.it> wrote:<BR>
<BR>
Hi Erne,<BR>
<FONT COLOR="#0000FF"> <BR>
> from the V4CC_VarChar.h:<BR>
> <BR>
> @interface VVarChar : VString <BR>
> {<BR>
> }<BR>
> <BR>
> -(id) initWithName:(NSString*)inName maxLength:(int)inLen flags:(int) inFlags <BR>
> method:(NSString*)inMethod;<BR>
> -(id) initWithName:(NSString*)inName length:(int)inLen flags:(int)inFlags;<BR>
> -(id) initWithName:(NSString*)inName length:(int)inLen;<BR>
> -(id) initWithName:(NSString*)inName;<BR>
> <BR>
> but only first constructor returns a valid Varchar field, the others generate <BR>
> a Vstring object with unpredictable results (banged my head on it all day <BR>
> long!)<BR>
> <BR>
> So better remove them from header or make them work as expected ;-)<BR>
> <BR>
> I'll Mantis this right away.<BR>
</FONT><BR>
This is sources of VarChar class in V4CC<BR>
<BR>
By idea, second, third, forth constructors should call the first one.<BR>
<BR>
But you say they create VStrng class ...<BR>
may be in fact is called PARENT ctor ... But why <BR>
<BR>
<BR>
</SPAN></FONT></FONT><FONT COLOR="#008E00"><FONT FACE="Menlo Regular"><SPAN STYLE='font-size:8.5pt'>/**********************************************************************************************/<BR>
</SPAN></FONT></FONT><FONT FACE="Menlo Regular"><SPAN STYLE='font-size:8.5pt'><FONT COLOR="#CE00A6">@interface</FONT> VVarChar : VString <BR>
{<BR>
}<BR>
<BR>
-(<FONT COLOR="#CE00A6">id</FONT>) initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName maxLength:(<FONT COLOR="#CE00A6">int</FONT>)inLen flags:(<FONT COLOR="#CE00A6">int</FONT>) inFlags method:(<FONT COLOR="#8000AF">NSString</FONT>*)inMethod;<BR>
-(<FONT COLOR="#CE00A6">id</FONT>) initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName length:(<FONT COLOR="#CE00A6">int</FONT>)inLen flags:(<FONT COLOR="#CE00A6">int</FONT>)inFlags;<BR>
-(<FONT COLOR="#CE00A6">id</FONT>) initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName length:(<FONT COLOR="#CE00A6">int</FONT>)inLen;<BR>
-(<FONT COLOR="#CE00A6">id</FONT>) initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName;<BR>
<BR>
<BR>
<FONT COLOR="#008E00">/**********************************************************************************************/<BR>
</FONT><FONT COLOR="#CE00A6">@end</FONT> <FONT COLOR="#008E00">// @interface VVarChar<BR>
</FONT></SPAN></FONT><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
</SPAN></FONT></FONT><FONT COLOR="#008E00"><FONT FACE="Menlo Regular"><SPAN STYLE='font-size:8.5pt'>/**********************************************************************************************/<BR>
</SPAN></FONT></FONT><FONT FACE="Menlo Regular"><SPAN STYLE='font-size:8.5pt'><FONT COLOR="#CE00A6">@implementation</FONT> VVarChar<BR>
<BR>
<FONT COLOR="#008E00">/**********************************************************************************************/<BR>
</FONT>-(<FONT COLOR="#CE00A6">id</FONT>) initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName maxLength:(<FONT COLOR="#CE00A6">int</FONT>)inLen flags:(<FONT COLOR="#CE00A6">int</FONT>) inFlags method:(<FONT COLOR="#8000AF">NSString</FONT>*)inMethod<BR>
{<BR>
<FONT COLOR="#CE00A6">self</FONT> = [<FONT COLOR="#CE00A6">super</FONT> <FONT COLOR="#255A5E">init</FONT>];<BR>
<FONT COLOR="#CE00A6">if</FONT>( <FONT COLOR="#CE00A6">self</FONT> )<BR>
{<BR>
<FONT COLOR="#7E4723">START</FONT>( <FONT COLOR="#E20000">"VarChar_Ctor"</FONT> );<BR>
<FONT COLOR="#7E4723">LOG_PARAM</FONT>( <FONT COLOR="#CE00A6">self</FONT> );<BR>
<FONT COLOR="#7E4723">LOG_PARAM</FONT>( inName );<BR>
<FONT COLOR="#7E4723">LOG_PARAM</FONT>( inLen );<BR>
<FONT COLOR="#7E4723">LOG_PARAM</FONT>( inFlags );<BR>
<FONT COLOR="#7E4723">LOG_PARAM</FONT>( inMethod );<BR>
<BR>
<FONT COLOR="#CE00A6">try<BR>
</FONT> {<BR>
<FONT COLOR="#CE00A6">if</FONT>( <FONT COLOR="#408288">gTable</FONT> )<BR>
{<BR>
<FONT COLOR="#008E00">// fucking RB have create BLOB class already, so<BR>
</FONT> <FONT COLOR="#408288">data</FONT>-><FONT COLOR="#8000AF">mpField</FONT> = <FONT COLOR="#CE00A6">NULL</FONT>; <BR>
<BR>
<FONT COLOR="#408288">Str_Unicode</FONT> u_name( inName );<BR>
<FONT COLOR="#408288">Str_Unicode</FONT> u_method( inMethod );<BR>
<BR>
<FONT COLOR="#8000AF">I_Field_Ptr</FONT> pField = <FONT COLOR="#4B0086">CreateVarCharField</FONT>( <BR>
<FONT COLOR="#408288">gTable</FONT>, u_name.<FONT COLOR="#4B0086">c_str</FONT>(), inLen, <FONT COLOR="#8000AF">ushort</FONT>(inFlags), u_method.<FONT COLOR="#4B0086">c_str</FONT>() );<BR>
<BR>
<FONT COLOR="#255A5E">Field_SetInstance</FONT>( <FONT COLOR="#CE00A6">self</FONT>, <FONT COLOR="#408288">data</FONT>, pField );<BR>
}<BR>
<BR>
}<FONT COLOR="#7E4723">MY_END_TRY<BR>
</FONT> }<BR>
<BR>
<FONT COLOR="#7E4723">RETURN</FONT>( <FONT COLOR="#CE00A6">self</FONT> );<BR>
}<BR>
<BR>
<BR>
<FONT COLOR="#008E00">/**********************************************************************************************/<BR>
</FONT>-(<FONT COLOR="#CE00A6">id</FONT>)initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName length:(<FONT COLOR="#CE00A6">int</FONT>)inLen flags:(<FONT COLOR="#CE00A6">int</FONT>)inFlags<BR>
{<BR>
<FONT COLOR="#CE00A6">return</FONT> [<FONT COLOR="#CE00A6">self</FONT> <FONT COLOR="#255A5E">initWithName</FONT>:inName <FONT COLOR="#255A5E">length</FONT>:inLen <FONT COLOR="#255A5E">flags</FONT>:inFlags <FONT COLOR="#255A5E">method</FONT>:<FONT COLOR="#CE00A6">nil</FONT>];<BR>
}<BR>
<BR>
<FONT COLOR="#008E00">/**********************************************************************************************/<BR>
</FONT>-(<FONT COLOR="#CE00A6">id</FONT>)initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName length:(<FONT COLOR="#CE00A6">int</FONT>)inLen <BR>
{<BR>
<FONT COLOR="#CE00A6">return</FONT> [<FONT COLOR="#CE00A6">self</FONT> <FONT COLOR="#255A5E">initWithName</FONT>:inName <FONT COLOR="#255A5E">length</FONT>:inLen <FONT COLOR="#255A5E">flags</FONT>:<FONT COLOR="#4B0086">fNone</FONT> <FONT COLOR="#255A5E">method</FONT>:<FONT COLOR="#CE00A6">nil</FONT>];<BR>
}<BR>
<BR>
<FONT COLOR="#008E00">/**********************************************************************************************/<BR>
</FONT>-(<FONT COLOR="#CE00A6">id</FONT>)initWithName:(<FONT COLOR="#8000AF">NSString</FONT>*)inName<BR>
{<BR>
<FONT COLOR="#CE00A6">return</FONT> [<FONT COLOR="#CE00A6">self</FONT> <FONT COLOR="#255A5E">initWithName</FONT>:inName <FONT COLOR="#255A5E">length</FONT>:<FONT COLOR="#4D00E0">20</FONT> <FONT COLOR="#255A5E">flags</FONT>:<FONT COLOR="#4B0086">fNone</FONT> <FONT COLOR="#255A5E">method</FONT>:<FONT COLOR="#CE00A6">nil</FONT>];<BR>
}<BR>
</SPAN></FONT><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT></FONT><FONT COLOR="#008E00"><FONT FACE="Menlo Regular"><SPAN STYLE='font-size:8.5pt'>/**********************************************************************************************/<BR>
</SPAN></FONT></FONT><FONT FACE="Menlo Regular"><SPAN STYLE='font-size:8.5pt'><FONT COLOR="#CE00A6">@end</FONT> <FONT COLOR="#008E00">// @implementation VVarChar<BR>
</FONT></SPAN></FONT><FONT SIZE="4"><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
<BR>
</SPAN></FONT></FONT>
</BODY>
</HTML>