Hi Christophe,

Two problems with your code:

1. SelChangedHandler is called whenever a selection CHANGES, i.e. also when a 
selection is cleared (and thus not present). And a
selection can consist of several records, not just one, so you need to build a 
loop around your call to CommandInfo()

2. The "table" of a mapper window is always the cosmetic layer, named 
"Cosmetic#". The cosmetic layer is also defined for layout
windows, but not for browsers and graphs, so you need to make sure it's called 
as a result of a change in a valid window.

Furthermore, WinChangedHandler is called if the content of the window is 
changed. It's not an intelligent event, it doesn't tell you
why the content changed. That you'll need to figure out for yourself.

But if the changes are prompted by yourself (update ...), why do you need a 
change event ?

Best regards/Med venlig hilsen
Lars V. Nielsen
GisPro, Denmark
http://www.gispro.dk/

----- Original Message ----- 
From: "Christophe Brabant" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, June 09, 2005 12:04 PM
Subject: MI-L need help for handlers


Hi

Here is the code I use :

===========================================================================

Dim    sel_rowid
As Integer

Sub SelChangedHandler

    sel_rowid = CommandInfo(CMD_INFO_ROWID)

End Sub

Sub WinChangedHandler

    Dim    win_id
    As Integer

    ' window id of the changed window
    win_id = CommandInfo(CMD_INFO_WIN)

    Print WindowInfo(win_id, WIN_INFO_TABLE)

End Sub
============================================================================

When I move an object in any layer, Cosmetic1 is always printed, even if the
object has been mapped with a table
( for example c:\temp\mytable.tab) with an Update statement (Update mytable
Set Obj=object .....)

What I need is printing the table name (.TAB) mapped with the moved object,
and know at which line the object is stored
into .TAB file.

Thank you - Christophe


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

Reply via email to