You are on page 1of 1

' Mapbasic source code to demonstrate how to get the rowid's of a

selection
' Inspired by Mike Katz: Mike.Katz@gmpte.gov.uk
' Written by Uffe Kousgaard: uffe@routeware.dk
' Should be located at http://www.routeware.dk/download/rowid.mb
' 8-Aug-2001

' To use it change the selection in line 20 to something that matches


your
' own needs.

include "mapbasic.def"

Declare Sub Main


Declare Sub SelChangedHandler

dim ID as integer

Sub Main
dim i as integer
Set Handler SelChangedHandler Off
Select * from Mytable where linktype=11 into tmptable
Set Handler SelChangedHandler On

print chr$(12)
for i=1 to tableinfo(tmptable,TAB_INFO_NROWS)
select * from tmptable where rowid=i
print ID
next
close table tmptable
end program
end Sub

Sub SelChangedHandler
ID=CommandInfo(CMD_INFO_ROWID)
End Sub

You might also like