I want to create a new object in a layer.  The method is simple :
layer.addfeature (feature, rowvalues)

Creating and filling feature is OK.  Filling rowvalues is also OK.
But what is the best method for creating an empty set of rowvalues ?

I use the following code (VB6) :

     dim ds as dataset
     dim rvs as rowvalues
     dim l as layer

     Set l = MapXMap.Layers.Item("mylayer")
     Set ds = MapXMap.DataSets("mylayer")
     Set rvs = ds.RowValues(0).Clone()

This does not work if you call
     l.BeginAccess miAccessReadWrite
before the line "set rvs = ...", in which case the "set rvs"
call raise error 1049.

The solution was to call "set rvs" before "l.BeginAccess", but that
is probably some kind of voodoo programming since using the program
through Citrix and TFE causes the error again... (Well, I know, i'm
looking for troubles :-).  Even worse, the same error occurs on an
other PC on a big file ... but works on mine.  This is looking more
and more like black magic !

Is there other solutions ?

I use also the following sequence elsewhere :

      Set rvs = New MapXLib.RowValues
      Set rvst = layer.DataSets.Item("mylayer").RowValues(0)
      For i = 1 To rvst.Count
        rvs.Add rvst(i)
      Next i

which give also strange results : the first time, row values are
filled with the values of the latest object read in "mylayer", but
after that, it's OK and the values are empty or null depending the
definition in the table...

Any idea is welcome, as any better documentation than the MapX manual...

Thanks for reading,
-- 
Michel Wurtz
MAAPAR/DGA/SDSI/CERIT/DIG





---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8810

Reply via email to