CommandInfo (CMD_INFO_ROWID) should only be used within a SelChangedHandler,
and only when CommandInfo (CMD_INFO_SELTYPE) returns 1 or 2.   

You want to manipulate the entire table aSelName rather than one row of the
base table.  Alternatively, store the return value form CommandInfo
(CMD_INFO_ROWID) in a variable in SelChangedHandler, and then use its value
in SnapNodes.

HTH
Spencer

________________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nicki Cozens
Sent: Wednesday, August 30, 2006 10:21 AM
To: [email protected]
Subject: [MI-L] Help with commandinfo(CMD_INFO_ROWID) after a dialog
iscalled please

 
Dear Listers
 
I have a number of procedures that are called from a menu bar.  One of the
menu items allows the user to change the snapping tolerance of the node
snapping tool I have created.  If the user selects a polygon and then runs
the main node snapping tool it works ok (if a little slow – see previous
postings!), however, if the user previously selects a polygon, then chooses
to change the snapping tolerance via the menu, an error occurs back in the
main node snapping routine when a CommandInfo is issued to find out the row
id of the selected polygon.  
 
Can anyone shed any light on what is happening please – I think it is
something to do with the OKbutton on the dialog changing the selection?  
 
Is there an easy way how I can get the CommandInfo(cmd_info_rowid) to find
the row id of the selected polygon after the ok button has been clicked?
 
Here are the main snippits of code:
 
#######################################################################
Sub snaptolerance       ‘runs when user selects change tol. from menu
Dialog 
      Title "Snapping Tolerance" 
      Control StaticText 
            Title "Please enter new tolerance (in m)" 
            'Position 10, 10
      Control EditText
            Value 0.25
            Into gf_snaptolerance
      Control OKbutton
      Control CancelButton
End Sub
###########################################################################
Sub SnapNodes                       ‘runs when user chooses snap from menu
 
‘... the variable declarations go in here and some initializing
 
If SelectionInfo(SEL_INFO_NROWS) > 0 Then
      aSelName = SelectionInfo(SEL_INFO_SELNAME)            'eg "Query1" 
    gs_theselTable = SelectionInfo(SEL_INFO_TABLENAME)
      Note (gs_theseltable)   ‘just to check – this is showing table name
Else
      Note("The selection is now 0")                        'just to check
            ‘This is not showing so there are rows selected
End If
gi_myrowid = commandInfo(cmd_info_rowid)   ‘This is where the error occurs
 
###########################################################
 
The error that is returned is:-
CommandInfo: argument 2 out of range, corresponding to the last line shown
above
 
Many thanks
Nicki Cozens
 
Nicki Cozens 
Data Management Officer 
Highways Development Control
Leicestershire County Council
County Hall
Glenfield
Leicester
LE3 8RA 
 
 
 
_______________________________________________________________________
Leicestershire County Council - rated a 'four-star' council by the Audit
Commission
_______________________________________________________________________
 
 
This e-mail and any files transmitted with it are confidential. If you are
not the intended recipient, any reading, printing, storage, disclosure,
copying or any other action taken in respect of this e-mail is prohibited
and may be unlawful. If you are not the intended recipient, please notify
the sender immediately by using the reply function and then permanently
delete what you have received.
 
Incoming and outgoing e-mail messages are routinely monitored for compliance
with Leicestershire County Council's policy on the use of electronic
communications. The contents of e-mails may have to be disclosed to a
request under the Data Protection Act 1998 and the Freedom of Information
Act 2000.
 
The views expressed by the author may not necessarily reflect the views or
policies of the Leicestershire County Council.
 
Attachments to e-mail messages may contain viruses that may damage your
system. Whilst Leicestershire County Council has taken every reasonable
precaution to minimise this risk, we cannot accept any liability for any
damage which you sustain as a result of these factors. You are advised to
carry out your own virus checks before opening any attachment.
 
 



_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to