V4CC - VVarchar constructors faulty

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Mon Jan 4 12:39:45 CST 2010


On 1/4/10 7:30 PM, "Ruslan Zasukhin" <ruslan_zasukhin at valentina-db.com>
wrote:

> On 1/3/10 10:42 PM, "Ernesto Giannotta" <ernestogiannotta at tiscalinet.it>
> wrote:
> 
> Hi Erne,
>  
>> from the V4CC_VarChar.h:
>> 
>> @interface VVarChar : VString
>> {
>> }
>> 
>> -(id) initWithName:(NSString*)inName maxLength:(int)inLen flags:(int) inFlags
>> method:(NSString*)inMethod;
>> -(id) initWithName:(NSString*)inName length:(int)inLen flags:(int)inFlags;
>> -(id) initWithName:(NSString*)inName length:(int)inLen;
>> -(id) initWithName:(NSString*)inName;
>> 
>> but only first constructor returns a valid Varchar field, the others generate
>> a Vstring object with unpredictable results (banged my head on it all day
>> long!)
>> 
>> So better remove them from header or make them work as expected ;-)
>> 
>> I'll Mantis this right away.
> 
> This is sources of VarChar class in V4CC
> 
> By idea, second, third, forth constructors should call the first one.
> 
> But you say they create VStrng class ...
> may be in fact is called PARENT ctor ... But why

I have found why :)

Because first VarChar ctor have  maxLength:
But rest and Vstring class has this param named  length:

FIXED.


> /***************************************************************************
> *******************/
> @interface VVarChar : VString
> {
> }
> 
> -(id) initWithName:(NSString*)inName maxLength:(int)inLen flags:(int)
> inFlags method:(NSString*)inMethod;
> -(id) initWithName:(NSString*)inName length:(int)inLen flags:(int)inFlags;
> -(id) initWithName:(NSString*)inName length:(int)inLen;
> -(id) initWithName:(NSString*)inName;
> 
> 
> /***************************************************************************
> *******************/
> @end // @interface VVarChar
> 
> 
> /***************************************************************************
> *******************/
> @implementation VVarChar
> 
> /***************************************************************************
> *******************/
> -(id) initWithName:(NSString*)inName maxLength:(int)inLen flags:(int)
> inFlags method:(NSString*)inMethod
> {
>     self = [super init];
>     if( self )
>     {
>         START( "VarChar_Ctor" );
>         LOG_PARAM( self );
>         LOG_PARAM( inName );
>         LOG_PARAM( inLen );
>         LOG_PARAM( inFlags );
>         LOG_PARAM( inMethod );
>         
>         try
>         {
>             if( gTable )
>             {
>                 // fucking RB have create BLOB class already, so
>                 data->mpField = NULL;
>                 
>                 Str_Unicode u_name( inName );
>                 Str_Unicode u_method( inMethod );
>                 
>                 I_Field_Ptr pField = CreateVarCharField(
>                     gTable, u_name.c_str(), inLen, ushort(inFlags),
> u_method.c_str() );
>                 
>                 Field_SetInstance( self, data, pField );
>             }
>             
>         }MY_END_TRY
>     }
>     
>     RETURN( self );
> }
> 
> 
> /***************************************************************************
> *******************/
> -(id)initWithName:(NSString*)inName length:(int)inLen flags:(int)inFlags
> {
>     return [self initWithName:inName length:inLen flags:inFlags method:nil];
> }
> 
> /***************************************************************************
> *******************/
> -(id)initWithName:(NSString*)inName length:(int)inLen
> {
>     return [self initWithName:inName length:inLen flags:fNone method:nil];
> }
> 
> /***************************************************************************
> *******************/
> -(id)initWithName:(NSString*)inName
> {
>     return [self initWithName:inName length:20 flags:fNone method:nil];
> }
> 
> /***************************************************************************
> *******************/
> @end // @implementation VVarChar
> 
> 
> 
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina

-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list