Hi Steve,
You can ignore it by using the ‘OnError’ and ‘Resume ‘ statements to handle the error. Alternatively (and a much better option in my opinion) you could select only records which have an associated map object and then run your update on the selection (see code below). This *should* avoid the error entirely (no promises!).
'===================================================
ALTER TABLE "HFSVs_Completed_2008_09" ( add Easting Integer ) INTERACTIVE
ALTER TABLE "HFSVs_Completed_2008_09" ( add Northing Integer ) INTERACTIVE
Select * from HFSVs_Completed_2008_09 where Obj into ToUpdate
UPDATE ToUpdate Set Easting = CentroidX(obj)
UPDATE ToUpdate Set Northing = CentroidY(obj)
COMMIT TABLE HFSVs_Completed_2008_09 INTERACTIVE
CLOSE TABLE HFSVs_Completed_2008_09 INTERACTIVE
'===================================================
Hope this helps!
Tom Bacon
GIS Engineer, Mouchel
T 01444 472380 │ E thomas...@mouchel.com │ W www.mouchel.com
Our values: innovation │ excellence │ integrity │ responsibility
From: mapi...@googlegroups.com
[mailto:mapi...@googlegroups.com] On Behalf Of StevePeat
Sent: 12 February 2013 14:21
To: mapi...@googlegroups.com
Subject: [MI-L] Suppressing warning Messages in MapBasic
Hi, Does anyone know of a way to supress warning messages when running command scripts in the MapInfo MapBasic Window. I am running a simple script on multiple table, part of which contains the commands
OPEN TABLE "\\Hqgis\Planweb\Public\Community Fire Safety\Prevention\STATIC\2008-09\HFSVs Completed 2008-09.TAB" INTERACTIVE
ALTER TABLE "HFSVs_Completed_2008_09" ( add Easting Integer ) INTERACTIVE
ALTER TABLE "HFSVs_Completed_2008_09" ( add Northing Integer ) INTERACTIVE
UPDATE HFSVs_Completed_2008_09 Set Easting = CentroidX(obj)
UPDATE HFSVs_Completed_2008_09 Set Northing = CentroidY(obj)
COMMIT TABLE HFSVs_Completed_2008_09 INTERACTIVE
CLOSE TABLE HFSVs_Completed_2008_09 INTERACTIVE
OPEN TABLE "\\Hqgis\Planweb\Public\Community Fire Safety\Prevention\STATIC\2008-09\HFSVs Completed 2008-09.TAB" INTERACTIVE
|
On some tables, when it gets to the UPDATE statements, they work as desired, but issue the MapInfo warning "CentroidX: could not fetch object from the current row, argument 1" , and the script stops. I simply want it to ignore the error and carry on I have tried using the SET PROGRESSBARS OFF andSET EVENT PROCESSING OFF statements but these have no effect Thanks Steve Peat Devon and Somerset Fire and Rescue Service, UK
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups
"MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to mapinfo-l+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Mouchel Limited (Mouchel) is registered in England and Wales with registered number 01686040 at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX. The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. No contracts may be concluded on behalf of Mouchel by means of email communications. Mouchel reserves the right to monitor and intercept emails sent and received on our network. |
No virus found in this
message.
Checked by AVG - www.avg.com
Version: 2013.0.2897 / Virus
Database: 2639/6097 - Release Date: 02/11/13
The compiler is free. Anybody can download it and use it.