[V4rb] ObjectPtr query

Fred.Stephenson Fred.Stephenson at communication-unltd.com
Wed Sep 24 09:45:13 CDT 2003


Ruslan,


>But you try send iobjptr.target
>This is BaseObject of first database, yes?

correctŠ

>And you send it to second db which DO NOT know it :-)

duh, right ;?)

>
>You need get from iobjptr.target its name
>Then in second db obtain BaseObject with such name and use its pointer.


Ok so

   case kv_typeobjectPtr

     iobjptr=vobjectptr(thefield)
     targ=iobjptr.target
     newtarg=olddb.baseobject(targ.name)
     i=iobjptr.deletionControl
     fieldname=iobjptr.name
     // everthing above looks correct when debugging
     vf=bo.createfield(fieldname,kv_typeobjectPtr,newtarg,i)
'breakpoint here
     'kobjPtr=bo.createObjectPtrField(fieldname,newtarg,i)

doesn't create a valid objectptr. It creates the pointer but there's 
never any target when looking in Vapp (therefore red baseobject). 
When stopping at the breakpoint 'vf'  displays  the correct target 
and pointedobject.

Am I just being really dumb orshould the above work now
BTW I'm using V4RB 1.9.8

all the best

Fred




More information about the Valentina mailing list