Converting ULong fields into ObjectPtr

Stan Busk maxprog at mac.com
Fri Apr 6 12:15:48 CDT 2007


Hi,

I want to convert a ULong field into an ObjectPtr keeping the value.  
Is the following code correct?

----
aRows = vdb.SQLExecute( "SET PROPERTY OnChangeType_ZeroObjectPtr TO  
FALSE" )
newFld = vdb.Table( "mytbl" ).ChangeType( vdb.Table( "mytbl" ).Field 
( "myfld" ), EVFieldType.kTypeObjectPtr, 0 )
If newFld <> nil then
    If vdb.Table( "mytbl" ).Field( "myfld" ).Type =  
EVFieldType.kTypeObjectPtr then
       vdb.Table( "mytbl" ).ObjectPtrField( "myfld" ).Target =  
vdb.Table( "parenttbl" )
       vdb.Table( "mytbl" ).ObjectPtrField( "myfld" ).OnDeletion =  
EVOnDelete.kRestrict
       vdb.Table( "mytbl" ).ObjectPtrField( "myfld" ).IsIndexed = True
    end if
end if
----

If my class define the field as:
mField = new VObjectPtr ("myfld", Parent, EVOnDelete.kRestrict,  
EVFlag.fIndexed, "myLinkName" )
How the heck can I define "myLinkName" in the previous code? I can't  
see any 'LinkName' parameter.

Stan



More information about the Valentina mailing list