According to the code below, you start updating at RowID=0.  However, the
first row in a MapInfo table has a RowID=1.  Therefore, you are always one
row behind where you should be.  Change the line i = 0 to i = 1 and you
should be AOK.

Gayr.

[EMAIL PROTECTED] wrote:

> I have a small problem with the loop function.
> The Update... overwrites all the rows with the last info
> What did I wrong?
>
> Thanks
>
> Include "MENU.DEF"
> Include "MAPBASIC.DEF"
> Dim i As Integer, f_x_st, f_y_st, f_x_sl, f_y_sl As Float
> i = 0
> Fetch first from Test
> Do While not EOT (test)
> f_x_st = ObjectGeography (test.obj, OBJ_GEO_LINEBEGX)
> f_y_st = ObjectGeography (test.obj, OBJ_GEO_LINEBEGY)
> f_x_sl = ObjectGeography (test.obj, OBJ_GEO_LINEENDX)
> f_y_sl = ObjectGeography (test.obj, OBJ_GEO_LINEENDY)
> Update test Set x_START = f_x_st Where Rowid=i
> Update test Set y_START = f_y_st Where Rowid = i
> Update test Set x_SLUT = f_x_sl Where Rowid = i
> Update test Set y_SLUT = f_y_sl where Rowid = i
> i = i + 1
> Fetch Next From test
> Loop
>
> ----------------------------------------------------------------------
> To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
> "unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to