Try to add "fetch last from mytable" before calling Eval.

This is from mapbasic help file for the fetch command:
Various MapInfo and MapBasic operations (e.g. Select, Update, and screen
redraws) automatically reset the current row. Accordingly, Fetch
statements should be issued just before any statements that make
assumptions about which row is current.

Kind regards

Uffe Kousgaard
www.routeware.dk

----- Original Message ----- 
From: "Fabio Cabella" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 15, 2003 5:00 PM
Subject: MI-L Wrong RowIDs


> Hi All,
>
> I'm adding some graphical objects into a table. For each I store the
RowID
> so I can remove those objects.
> I do something like this:
>     Do "Insert Into myTable(Obj) values(CreatePoint(_lat_, _long_))"
> I use Eval "myTable.RowID"  to retrive the new insetred rowID.
> If I insert only points I get the right RowID.
> If I insert lines between points
>     Do "Insert Into myTable(Obj) values(CreatePoint(_lat1_, _long1_))"
>     Eval "myTable.RowID" gives me 1
>     Do "Insert Into myTable(Obj) values(CreateLine(_lat1_, _long1_,
_lat2_,
> _lat2_))"
>     Eval "myTable.RowID" gives me 2
>     Do "Insert Into myTable(Obj) values(CreatePoint(_lat1_, _long1_))"
>     Eval "myTable.RowID" gives me 2!!!!
>
> Why do I get 2 and not the correct 3 value?????
>
> Note: I'm handling this code through a VC application and if I debug
it
> step by step I get the right RowID!?!?!
>
> Is 'Eval "myTable.RowID"' the right way to get the new inserted RowID?
> Is there something I'm missing?
>
> TIA,
> Cabbi


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

Reply via email to