Hi Jacques
the code below will print the rowid of a selection,
run it and open a browser and select any row in it, it will then print the
id to the messagewindow
include "mapbasic.def"
declare sub main
declare sub SelChangedHandler
sub main
end sub
sub SelChangedHandler
if selectioninfo(sel_info_nrows) = 1 then
print commandinfo(CMD_INFO_ROWID)
end if
end sub
Med venlig hilsen
Peter Laulund
*************************************************************
Kort & Matrikelstyrelsen � www.kms.dk
National Survey and Cadastre - Denmark
Rentemestervej 8 � DK 2400 K�benhavn NV
E-mail: [EMAIL PROTECTED] � Home: [EMAIL PROTECTED]
Phone: +45 3587 5050 � Direct: +45 3587 5173
*************************************************************
"Jacques Paris" <[EMAIL PROTECTED]> - 18-09-2001 13:19:44
Besvar venligst til "Jacques Paris" <[EMAIL PROTECTED]>
Til: "MIL" <[EMAIL PROTECTED]>
cc: (bcc: Peter Laulund/MI/KMS)
Vedr�rende: MI-L rowid of selected object
I have been digging in various sources and archives to try to find a way to
get the rowid of a selected object in its original table. I thought I had
seen something about it but...
While waiting for some ideas from the list, I have devised a small
workaround that shows promises ans is certainly amusing.
First set the browser of the base table to show only 2 lines (it is the
minimum size MI will let you have: set window with height=0.1 inch). Then
as
an object is selected
Run Menu Command 306. Retrieve the rowid as with i_row=base_table.rowid -1.
RMC 306 is "find selection" and MI seems to set the pointer for base_table
to the last row that is displayed in the browser. Only problem: if selected
object is last row, 1 should not be substracted.
The browser must be open for the pointer to be updated. The map could be
minimized (it saves redrawing time). If it is done interactively with the
MapBasic window, it is very easy to find if the selected object is the last
record; there will be only one line in the browser.
Awaiting for some good challenges.
Jacques Paris
e-mail [EMAIL PROTECTED]
MapInfo/MapBasic support http://www.paris-pc-gis.com
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.