Mapinfo Mapbasic V
Total Page:16
File Type:pdf, Size:1020Kb
MapInfo MapBasic v. 8.0 Reference Guide Information in this document is subject to change without notice and does not represent a commitment on the part of the vendor or its representatives. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, without the written permission of MapInfo Corporation, One Global View, Troy, New York 12180-8399. © 2005 MapInfo Corporation. All rights reserved. MapInfo, MapInfo Professional, MapBasic, StreetPro and the MapInfo logo are trademarks of MapInfo Corporation and/or its affiliates. MapInfo Corporate Headquarters: Voice: (518) 285-6000 Fax: (518) 285-6060 Sales Info Hotline: (800) 327-8627 Government Sales Hotline: (800) 619-2333 Technical Support Hotline: (518) 285-7283 Technical Support Fax: (518) 285-6080 Contact information for North American offices is located at: http://www.mapinfo.com/company/company_profile/index.cfm. Contact information for worldwide offices is located at: http://www.mapinfo.com/company/company_profile/worldwide_offices.cfm. Contact information for European and Middle East offices is located at: http://www.mapinfo.co.uk. Contact information for Asia Pacific offices is located at: http://www.mapinfo.com.au. Adobe Acrobat® is a registered trademark of Adobe Systems Incorporated in the United States. Products named herein may be trademarks of their respective manufacturers and are hereby recognized. Trademarked names are used editorially, to the benefit of the trademark owner, with no intent to infringe on the trademark. libtiff © 1988-1995 Sam Leffler, copyright © Silicon Graphics, Inc. libgeotiff © 1995 Niles D. Ritter. Portions © 1999 3D Graphics, Inc. All Rights Reserved. HIL - Halo Image Library™ © 1993, Media Cybernetics Inc. Halo Imaging Library is a trademark of Media Cybernetics, Inc. Portions thereof LEAD Technologies, Inc. © 1991-2005. All Rights Reserved. Portions © 1993-2005 Ken Martin, Will Schroeder, Bill Lorensen. All Rights Reserved. Blue Marble © 1993-2005 ECW by ER Mapper © 1993-2005 VM Grid by Northwood Technologies, Inc., a Marconi Company © 1995-2004™. Portions © 2005 Earth Resource Mapping, Ltd. All Rights Reserved. MrSID, MrSID Decompressor and the MrSID logo are trademarks of LizardTech, Inc. used under license. Portions of this computer program are (c) 1995–1998 LizardTech and/or the university of California or are protected by US patent nos. 5,710,835; 5,130,701; or 5,467,110 and are used under license. All rights reserved. MrSID is protected under US and international patent & copyright treaties and foreign patent applications are pending. Unauthorized use or duplication prohibited. Universal Translator by Safe Software, Inc. © 2004. Crystal Reports ® is proprietary trademark of Crystal Decisions. All Rights Reserved. Products named herein may be trademarks of their respective manufacturers and are hereby recognized. Trademarked names are used editorially, to the benefit of the trademark owner, with no intent to infringe on the trademark. May 2005 Table of Contents Chapter 1: New and Enhanced MapBasic Statements and Functions. 5 Enhanced MapBasic Functions and Statements . 22 Enabling Transparent Patterns on Same Layer. 32 Export Windows to Additional Formats . 32 Chapter 2: Introduction . 33 Language Overview . 34 MapBasic Fundamentals . 34 Variables . 34 Looping and Branching . 35 Output and Printing . 35 Procedures (Main and Subs) . 35 Error Handling . 35 Functions . 35 Custom Functions . 36 Data-Conversion Functions . 36 Date and Time Functions. 36 Math Functions . 37 String Functions . 37 Working With Tables. 38 Creating and Modifying Tables . 38 Querying Tables. 38 Working With Remote Data . 39 Working With Files (Other Than Tables). 40 File Input/Output . 40 File and Directory Names . 40 Working With Maps and Graphical Objects . 41 Creating Map Objects . 41 Modifying Map Objects . 41 Querying Map Objects . 42 Working With Object Styles . 42 Working With Map Windows . 43 Creating the User Interface . 43 ButtonPads (ToolBars). 43 Dialog Boxes . 44 Menus . 44 Windows . 44 System Event Handlers . 45 the guide title Table of Contents Communicating With Other Applications . 45 DDE (Dynamic Data Exchange; Windows Only) . 45 Integrated Mapping. 45 Special Statements and Functions . 46 A – Z Reference . 46 Appendix A: Character Code Table. 586 Appendix B: Summary of Operators. 588 Numeric Operators . 589 Comparison Operators . 590 Logical Operators . 590 Geographical Operators . 591 Precedence . 592 Automatic Type Conversions. 592 Appendix C: MapBasic Definitions File . 594 Index. 615 Product Name and version number © 2005 MapInfo Corporation. All rights reserved. 4 filename.pdf New and Enhanced 1 MapBasic Statements and Functions These are the new statements and functions available for the MapInfo Professional 8.0 product. Sections in this Appendix: New MapBasic Functions and Statements. 6 Enhanced MapBasic Functions and Statements. 22 Reference Guide Chapter 1: CartesianConnectObjects( ) function New MapBasic Functions and Statements CartesianConnectObjects( ) function Purpose Returns an object representing the shortest or longest distance between two objects. Syntax CartesianConnectObjects(object1, object2, min) object1 and object2 are object expressions. min is a logical expression where TRUE calculates the minimum distance between the objects, and FALSE calculates the maximum distance between objects. Returns This statement returns a single section, two-point Polyline object representing either the closest distance (min == TRUE) or farthest distance (min == FALSE) between object1 and object2. Description One point of the resulting Polyline object is on object1 and the other point is on object2. Note that the.