Mapbasic

886
MapBasic Version 10 REFERENCE

description

Mapbasic Reference

Transcript of Mapbasic

MapBasicVersion 10

REFERENCE

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 Pitney Bowes Software Inc., One Global View, Troy, New York 12180-8399. 2009 Pitney Bowes Software Inc. All rights reserved. MapInfo, the Pitney Bowes Software logo, and MapBasic are trademarks of Pitney Bowes Software Inc. and/or its affiliates. Americas: Phone: (518) 285-6000 Fax: (518) 285-6070 Sales: (800) 327-8627 Government Sales: (800) 619-2333 Technical Support: (518) 285-7283 Technical Support Fax: (518) 285-6080 www.mapinfo.com UK and EMEA: Phone: +44(0) 1753 848200 Fax: +44(0) 1753 621140 Technical Support: +44(0) 1634 880141 www.mapinfo.co.uk Asia Pacific: Phone: 61. 2.9437.6255 Fax: 61.2.9439. 1773 Technical Support: 1800 648 899 www.mapinfo.com.au Contact information for all Pitney Bowes Business Insight offices is located at:: http://www.mapinfo.com/contactus 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. May 2009

Table of ContentsChapter 1: Introduction to MapBasic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19Language Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 MapBasic Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Looping and Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Output and Printing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Procedures (Main and Subs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Error Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Custom Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Data-Conversion Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Date and Time Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Math Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23 Working With Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 Creating and Modifying Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 Querying Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 Working With Remote Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25 Working With Files (Other Than Tables) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 File Input/Output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 File and Directory Names. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .26 Working With Maps and Graphical Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Creating Map Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Modifying Map Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Querying Map Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 Working With Object Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 Working With Map Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 Creating the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 ButtonPads (ToolBars). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30

Reference

10.0

Table of Contents

Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 System Event Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Communicating With Other Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 DDE (Dynamic Data Exchange; Windows Only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Integrated Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Special Statements and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Contacting Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Copyright Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

Chapter 2: New and Enhanced MapBasic Statements and Functions . . . . . . . . 35Support for Microsoft Office 2007 Access and Excel . . . . . . . . . . . . . . . . . . . . . . . . . . 36 USNGToPoint(string) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 PointToUSNG$(obj, datumid). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Create Adornment statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Set Adornment statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Closing an Adornment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Information about the Adornment Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 GroupLayerInfo function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 LayerListInfo function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Enhanced Functions and Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Add Map statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 LayerInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Map statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 WindowInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Server ConnectionNumber. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Set Map statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

Chapter 3: A Z MapBasic Language Reference . . . . . . . . . . . . . . . . . . . . . . . . . 75Acos( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Add Cartographic Frame statement 79 Add Column statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Add Map statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Alter Button statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Alter ButtonPad statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Alter Cartographic Frame statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Alter Control statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Alter MapInfoDialog statement 98 Alter Menu statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 Alter Menu Bar statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Alter Menu Item statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 Alter Object statement 107 Alter Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

4

MapBasic 10.0

Table of Contents

ApplicationDirectory$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 Area( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .114 AreaOverlap( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115 Asc( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116 Asin( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117 Ask( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 Atn( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 AutoLabel statement 120 Beep statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 Browse statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 Brush clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 Buffer( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125 ButtonPadInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126 Call statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127 CartesianArea( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129 CartesianBuffer( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 CartesianConnectObjects( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 CartesianDistance( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .132 CartesianObjectDistance( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133 CartesianObjectLen( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133 CartesianOffset( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .134 CartesianOffsetXY( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135 CartesianPerimeter( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .136 Centroid( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137 CentroidX( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138 CentroidY( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 CharSet clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 ChooseProjection$( ) function 143 Chr$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 Close All statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144 Close Connection statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 Close File statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .145 Close Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .146 Close Window statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 ColumnInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148 Combine( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 CommandInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151 Commit Table statement 157 ConnectObjects( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .162 Continue statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .163 Control Button / OKButton / CancelButton clause . . . . . . . . . . . . . . . . . . . . . . . . . . .165

Reference

10.0

Table of Contents

Control CheckBox clause. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166 Control DocumentWindow clause. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Control EditText clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 Control GroupBox clause. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 Control ListBox / MultiListBox clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 Control PenPicker/BrushPicker/SymbolPicker/FontPicker clause . . . . . . . . . . . . . . 173 ControlPointInfo() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174 Control PopupMenu clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175 Control RadioGroup clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 Control StaticText clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177 ConvertToPline( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178 ConvertToRegion( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 ConvexHull( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 CoordSys clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180 CoordSysName$() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184 Cos( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 Create Arc statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185 Create ButtonPad statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186 Create ButtonPads As Default statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 Create Cartographic Legend statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 CreateCircle( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194 Create Collection statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 Create Cutter statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197 Create Ellipse statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 Create Frame statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 Create Grid statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 Create Index statement 205 Create Legend statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205 CreateLine( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 Create Line statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207 Create Map statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208 Create Map3D statement 210 Create Menu statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 Create Menu Bar statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Create MultiPoint statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 Create Object statement 221 Create Pline statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225 CreatePoint( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Create Point statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228 Create PrismMap statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229 Create Ranges statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

6

MapBasic 10.0

Table of Contents

Create Rect statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .234 Create Redistricter statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .235 Create Region statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .236 Create Report From Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .238 Create RoundRect statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .239 Create Styles statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .240 Create Table statement 242 CreateText( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .244 Create Text statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245 CurDate( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247 CurDateTime() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .247 CurrentBorderPen( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248 CurrentBrush( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248 CurrentFont( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .249 CurrentLinePen( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .250 CurrentPen( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .251 CurrentSymbol( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .251 CurTime() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .252 DateWindow( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255 Day( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .255 DDEExecute statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .256 DDEInitiate( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .257 DDEPoke statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .260 DDERequest$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .261 DDETerminate statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .264 DDETerminateAll statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .264 Declare Function statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .265 Declare Method statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .267 Declare Sub statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269 Define statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .271 DeformatNumber$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .272 Delete statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .273 Dialog statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .274 Dialog Preserve statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .280 Dialog Remove statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .281 Dim statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .282 Distance( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .288 Do CaseEnd Case statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .289 DoLoop statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .291 Drop Index statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .292 Drop Map statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .293

Reference

10.0

Table of Contents

Drop Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294 End MapInfo statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 End Program statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 EndHandler procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296 EOF( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 EOT( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297 EPSGToCoordSysString$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 Erase( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299 Err( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300 Error statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Error$( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301 Exit Do statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302 Exit For statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Exit Function statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Exit Sub statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304 Exp( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305 Export statement 306 ExtractNodes( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309 Farthest statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310 Fetch statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 FileAttr( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314 FileExists( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 FileOpenDlg( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 FileSaveAsDlg( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318 Find statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319 Find Using statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 Fix( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324 Font clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 ForNext statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327 ForegroundTaskSwitchHandler procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328 Format$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329 FormatDate$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332 FormatNumber$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333 FormatTime$ function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334 FME Refresh Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 FrontWindow( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 FunctionEnd Function statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336 Geocode statement 339 GeocodeInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 Get statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 GetDate() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

8

MapBasic 10.0

Table of Contents

GetFolderPath$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .348 GetGridCellValue( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .349 GetMetadata$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .350 GetSeamlessSheet( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .351 GetTime() function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352 Global statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352 Goto statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .353 Graph statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .354 GridTableInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .356 HomeDirectory$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357 HotlinkInfo function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357 Hour function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358 IfThen statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .359 Import statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .361 Include statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366 Input # statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .366 Insert statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .367 InStr( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369 Int( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .370 IntersectNodes( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .371 IsGridCellNull( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .371 IsogramInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .372 IsPenWidthPixels( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .375 Kill statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .376 LabelFindByID( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .377 LabelFindFirst( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .378 LabelFindNext( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .379 LabelInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .380 LayerInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .383 Layout statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .389 LCase$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .390 Left$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .390 LegendFrameInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .391 LegendInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .393 LegendStyleInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .394 Len( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .394 Like( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .395 Line Input statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .396 LocateFile$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .397 LOF( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .399 Log( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .399

Reference

10.0

Table of Contents

LTrim$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 Main procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 MakeBrush( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 MakeCustomSymbol( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 MakeDateTime function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404 MakeFont( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405 MakeFontSymbol( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 MakePen( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 MakeSymbol( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408 Map statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409 Map3DInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 MapperInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415 Maximum( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419 MBR( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421 Menu Bar statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 MenuItemInfoByHandler( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 MenuItemInfoByID( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 Metadata statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425 MGRSToPoint( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 Mid$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429 MidByte$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 Minimum( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430 Minute function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 Month( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431 Nearest statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432 Note statement 436 NumAllWindows( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436 NumberToDate( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437 NumberToDateTime function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 NumberToTime function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438 NumCols( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439 NumTables( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440 NumWindows( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440 ObjectDistance( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 ObjectGeography( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447 ObjectInfo( ) function 450 ObjectLen( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454 ObjectNodeHasM( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455 ObjectNodeHasZ( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456 ObjectNodeM( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458 ObjectNodeX( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459

10

MapBasic 10.0

Table of Contents

ObjectNodeY( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .460 ObjectNodeZ( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .461 Objects Check statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .462 Objects Clean statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .464 Objects Combine statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .465 Objects Disaggregate statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .467 Objects Enclose statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .469 Objects Erase statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .470 Objects Intersect statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .472 Objects Move statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .473 Objects Offset statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .474 Objects Overlay statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .476 Objects Pline statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .476 Objects Snap statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .477 Objects Split statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .479 Offset( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .481 OffsetXY( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .482 OnError statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .483 Open Connection statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .485 Open File statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .486 Open Report statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .488 Open Table statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .489 Open Window statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .491 Overlap( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .492 OverlayNodes( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .493 Pack Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .494 PathToDirectory$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .495 PathToTableName$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .496 Pen clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .497 PenWidthToPoints( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .500 Perimeter( ) function 501 PointsToPenWidth( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .502 PointToMGRS$( ) function 503 PointToUSNG$(obj, datumid). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .504 Print statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .506 Print # statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .507 PrintWin statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .508 PrismMapInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .509 ProgramDirectory$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513 ProgressBar statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .513 Proper$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .516

Reference

10.0

Table of Contents

ProportionOverlap( ) function 517 Put statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517 Randomize statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518 RasterTableInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 RegionInfo( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 ReadControlValue( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521 ReDim statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524 Register Table statement 526 Supporting Transaction Capabilities for WFS Layers . . . . . . . . . . . . . . . . . . . . . . . . . 532 Relief Shade statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533 Reload Symbols statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 RemoteMapGenHandler procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534 RemoteMsgHandler procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535 RemoteQueryHandler( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 536 Remove Cartographic Frame statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 Remove Map statement 539 Rename File statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 Rename Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 Reproject statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 Resume statement 542 RGB( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 Right$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 Rnd( ) function 545 Rollback statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 Rotate( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546 RotateAtPoint( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 Round( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 RTrim$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 Run Application statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 Run Command statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 Run Menu Command statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 Run Program statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553 Save File statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555 Save MWS statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555 Save Window statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557 Save Workspace statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 SearchInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560 SearchPoint( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563 SearchRect( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564 Second function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 565 Seek( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566

12

MapBasic 10.0

Table of Contents

Seek statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .566 SelChangedHandler procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .567 Select statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .568 SelectionInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .577 Server Begin Transaction statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .578 Server Bind Column statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .579 Server Close statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .581 Server_ColumnInfo( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .582 Server Commit statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .584 Server_Connect( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .585 Server_ConnectInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .592 Server Create Map statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .593 Server Create Style statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .596 Server Create Table statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .597 Server Create Workspace statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .599 Server Disconnect statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .600 Server_DriverInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .601 Server_EOT( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .602 Server_Execute( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .603 Server Fetch statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .604 Server_GetODBCHConn( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .606 Server_GetODBCHStmt( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .607 Server Link Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .608 Server_NumCols( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .611 Server_NumDrivers( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .611 Server Refresh statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .612 Server Remove Workspace statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .613 Server Rollback statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .613 Server Set Map statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .614 Server Versioning statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .615 Server Workspace Merge statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .617 Server Workspace Refresh statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .619 SessionInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .620 Set Application Window statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .621 Set Area Units statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .622 Set Browse statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .623 Set Cartographic Legend statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .624 Set Command Info statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .625 Set Connection Geocode statement 627 Set Connection Isogram statement 630 Set CoordSys statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .632

Reference

10.0

Table of Contents

Set Date Window statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633 Set Datum Transform Version statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 Set Digitizer statement 635 Set Distance Units statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 Set Drag Threshold statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 Set Event Processing statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 Set File Timeout statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639 Set Format statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 Set Graph statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 Set Handler statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646 Set Layout statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647 Set Legend statement 650 Set Map statement 653 Set Map3D statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 674 Set Next Document statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676 Set Paper Units statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678 Set PrismMap statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 679 Set ProgressBars statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680 Set Redistricter statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681 Set Resolution statement 683 Set Shade statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683 Set Style statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685 Set Table Datum statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686 Set Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686 Set Target statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688 Set Window statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690 Sgn( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699 Shade statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 701 Sin( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710 Space$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 SphericalArea( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 SphericalConnectObjects( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713 SphericalDistance( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713 SphericalObjectDistance( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714 SphericalObjectLen( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715 SphericalOffset( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716 SphericalOffsetXY( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717 SphericalPerimeter( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718 Sqr( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719 StatusBar statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 Stop statement 721

14

MapBasic 10.0

Table of Contents

Str$( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .722 String$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .723 StringCompare( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .724 StringCompareIntl( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .725 StringToDate( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .725 StringToDateTime function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .727 StringToTime function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .727 StyleAttr( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .728 SubEnd Sub statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .730 Symbol clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .732 SystemInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .735 TableInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .737 Tan( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .741 TempFileName$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .742 Terminate Application statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .743 TextSize( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .743 Time( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .744 Timer( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .744 ToolHandler procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .745 TriggerControl( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .747 TrueFileName$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .748 Type statement 749 UBound( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .750 UCase$( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .751 UnDim statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .751 UnitAbbr$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .752 UnitName$( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .753 Unlink statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .754 Update statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .754 Update Window statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .755 USNGToPoint(string) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .756 Val( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .757 Weekday( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .759 WFS Refresh Table statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .760 WhileWend statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .760 WinChangedHandler procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .762 WinClosedHandler procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .763 WindowID( ) function 764 WindowInfo( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .765 WinFocusChangedHandler procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .773 Write # statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .774

Reference

10.0

Table of Contents

Year( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775

Appendix A: HTTP and FTP Libraries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777MICloseContent( ) procedure 778 MICloseFtpConnection( ) procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778 MICloseFtpFileFind( ) procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778 MICloseHttpConnection( ) procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 MICloseHttpFile( ) procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779 MICloseSession( ) procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780 MICreateSession( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 780 MICreateSessionFull( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781 MIErrorDlg( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782 MIFindFtpFile( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784 MIFindNextFtpFile( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784 MIGetContent( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785 MIGetContentBuffer( ) function 786 MIGetContentLen( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786 MIGetContentString( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787 MIGetContentToFile( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787 MIGetContentType( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788 MIGetCurrentFtpDirectory( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789 MIGetErrorCode( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 789 MIGetErrorMessage( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790 MIGetFileURL( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790 MIGetFtpConnection( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791 MIGetFtpFile( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792 MIGetFtpFileFind( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794 MIGetFtpFileName( ) procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794 MIGetHttpConnection( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795 MIIsFtpDirectory( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795 MIIsFtpDots( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796 MIOpenRequest( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796 MIOpenRequestFull( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797 MIParseURL( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799 MIPutFtpFile( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800 MIQueryInfo( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801 MIQueryInfoStatusCode( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802 MISaveContent( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803 MISendRequest( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803 MISendSimpleRequest( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804 MISetCurrentFtpDirectory( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805 MISetSessionTimeout( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805

16

MapBasic 10.0

Table of Contents

Appendix B: XML Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807MIXmlAttributeListDestroy( ) procedure 808 MIXmlDocumentCreate( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .808 MIXmlDocumentDestroy( ) procedure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .809 MIXmlDocumentGetNamespaces( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .809 MIXmlDocumentGetRootNode( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .810 MIXmlDocumentLoad( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .810 MIXmlDocumentLoadXML( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .811 MIXmlDocumentLoadXMLString( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .812 MIXmlDocumentSetProperty( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .813 MIXmlGetAttributeList( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .814 MIXmlGetChildList( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .814 MIXmlGetNextAttribute( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .815 MIXmlGetNextNode( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .816 MIXmlNodeDestroy( ) procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .816 MIXmlNodeGetAttributeValue( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .817 MIXmlNodeGetFirstChild( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .817 MIXmlNodeGetName( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .818 MIXmlNodeGetParent( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .819 MIXmlNodeGetText( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .819 MIXmlNodeGetValue( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .820 MIXmlNodeListDestroy( ) procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .820 MIXmlSCDestroy( ) procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .821 MIXmlSCGetLength( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .821 MIXmlSCGetNamespace( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .822 MIXmlSelectNodes( ) function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .822 MIXmlSelectSingleNode( ) function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .823

Appendix C: Character Code Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825 Appendix D: Summary of Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 827Comparison Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .828 Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .829 Geographical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .829 Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .830 Automatic Type Conversions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .830

Appendix E: MapBasic Definitions File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861

Reference

10.0

Table of Contents

18

MapBasic 10.0

Introduction to MapBasic

1

This manual describes every statement and function in the MapBasic Development Environment programming language. To learn about the concepts behind MapBasic programming, or to learn about using the MapBasic development environment, see the MapBasic User Guide.

Topics in this Section:Type Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Language Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 MapBasic Fundamentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22 Working With Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24 Working With Files (Other Than Tables) . . . . . . . . . . . . . . . . . . . .26 Working With Maps and Graphical Objects . . . . . . . . . . . . . . . . . .27 Creating the User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 Communicating With Other Applications . . . . . . . . . . . . . . . . . . .31 Special Statements and Functions . . . . . . . . . . . . . . . . . . . . . . . . .32

Language Overview

Type ConventionsThis manual uses the following conventions to designate specific items in the text: Convention If, Call, Map, Browse, Area Meaning Bold words with the first letter capitalized are MapBasic keywords. Within this manual, the first letter of each keyword is capitalized; however, when you write MapBasic programs, you may enter keywords in upper-, lower-, or mixed-case. Main, Pen, Object Non-bold words with the first letter capitalized are usually special procedure names or variable types. Italicized words represent parameters to MapBasic statements. When you construct a MapBasic statement, you must supply an appropriate expression for each parameter. Keywords or parameters which appear inside square brackets are optional. When a syntax expression appears inside braces, the braces contain a list of keywords or parameters, separated by the vertical bar character ( | ). You must choose one of the options listed. For example, in the sample shown on the left ({ On | Off }), you should choose either On or Off. Actual program samples are shown in Courier font.

table, handler, window_id

[ window_id ], [ Interactive ] { On | Off }

"Note "Hello,world!"

Language OverviewThe following pages provide an overview of the MapBasic language. Task descriptions appear on the left; corresponding statement names and function names appear on the right, in bold. Function names are followed by parentheses ( ).

MapBasic FundamentalsVariablesDeclare local or global variables: Resize array variables: Declare custom data structure: Dim, Global ReDim, UBound( ), UnDim Type

20

MapBasic 10.0

Chapter 1: Introduction to MapBasic

Looping and BranchingLooping: ForNext, Exit For, DoLoop, Exit Do, WhileWend IfThen, Do Case, GoTo End Program, Terminate Application, End MapInfo

Branching: Other flow control:

Output and PrintingPrint a window's contents: Print text to message window: Set up a Layout window: Export a window to a file: Controlling the Printer: PrintWin Print Layout, Create Frame, Set Window Save Window Set Window, Window Info( )

Procedures (Main and Subs)Define a procedure: Call a procedure: Exit a procedure: Main procedure: Declare Sub, SubEnd Sub Call Exit Sub Main

Error HandlingSet up an error handler: Return current error information: Return from error handler: Simulate an error: OnError Err( ), Error$( ) Resume Error

Reference

21

Functions

FunctionsCustom FunctionsDefine a custom function: Exit a function: Declare Function, FunctionEnd Function Exit Function

Data-Conversion FunctionsConvert strings to codes: Convert codes to strings: Convert strings to numbers: Convert numbers to strings: Convert a number or a string to a date: Converting to a 2-Digit Year: Convert object types: Convert labels to text: Convert a point object to a MGRS coordinate: Convert a MGRS coordinate to a point object: Convert a point object to a USNG coordinate: Convert a USNG coordinate to a point object: Asc( ) Chr$( ) Val( ) Str$( ), Format$( ) NumberToDate( ), StringToDate( ) Set Date Window, DateWindow( ) ConvertToRegion( ), ConvertToPline( ) LabelInfo( ) PointToMGRS$( ) MGRSToPoint( ) PointToUSNG$(obj, datumid) USNGToPoint(string)

Date and Time FunctionsObtain the current date: Extract parts of a date: Read system timer: Convert a number or a string to a date: Obtain the current time and date: Obtain the date and time: CurDate( ) Day( ), Month( ), Weekday( ), Year( ) Timer( ) NumhmmberToDate( ), StringToDate( ) CurTime(),CurDateTime() GetDate(), GetTime()MapBasic 10.0

22

Chapter 1: Introduction to MapBasic Convert a number to date and time: Convert a string to date and time: Convert date and time to a particular format: Convert time to hour, minute and second: NumberToDateTime(), NumberToTime() StringToDateTime(), StringToTime() FormatDate(), FormatTime() Hour(), Minute(), Second()

Math FunctionsTrigonometric functions: Geographic functions: Cos( ), Sin( ), Tan( ), Acos( ), Asin( ), Atn( ) Area( ), Perimeter( ), Distance( ), ObjectLen( ), CartesianArea( ), CartesianPerimeter( ), CartesianDistance( ), CartesianObjectLen( ), SphericalArea( ), SphericalPerimeter( ), SphericalDistance( ), SphericalObjectLen( ) Randomize, Rnd( ) Abs( ), Sgn( ) Fix( ), Int( ), Round( ) Exp( ), Log( ), Minimum( ), Maximum( ), Sqr( )

Random numbers: Sign-related functions: Truncating fractions: Other math functions:

String FunctionsUpper / lower case: Find a sub-string: Extract part of a string: Trim blanks from a string: Format numbers as strings: UCase$( ), LCase$( ), Proper$( ) InStr( ) Left$( ), Right$( ), Mid$( ), MidByte$( ) LTrim$( ), RTrim$( ) Format$( ), Str$( ), Set Format, FormatNumber$( ), DeformatNumber$( ) Len( ) Chr$( ), Asc( ) Like( ), StringCompare( ), StringCompareIntl( )

Determine string length: Convert character codes: Compare strings:

Reference

23

Working With Tables Repeat a string sequence: Return unit name: Convert a point object to a MGRS coordinate: Convert a MGRS coordinate to a point object: Convert an EPSG string to a CoordSys clause: Convert a point object to a USNG coordinate: Convert a USNG coordinate to a point object: Space$( ), String$( ) UnitAbbr$( ), UnitName$( ) PointToMGRS$( ) MGRSToPoint( ) EPSGToCoordSysString$( ) PointToUSNG$(obj, datumid) USNGToPoint(string)

Working With TablesCreating and Modifying TablesOpen an existing table: Close one or more tables: Create a new, empty table: Turn a file into a table: Import/export tables/files: Modify a table's structure: Open Table Close Table, Close All Create Table Register Table Import, Export Alter Table, Add Column, Create Index, Drop Index, Create Map, Drop Map Create Report From Table Open Report Insert, Update, Delete Pack Table Set Table Table Rollback Rename Table Drop Table

Create a Crystal Reports file: Load a Crystal Report: Add, edit, delete rows: Pack a table: Control table settings: Save recent edits: Discard recent edits: Rename a table: Delete a table:

24

MapBasic 10.0

Chapter 1: Introduction to MapBasic

Querying TablesPosition the row cursor: Select data, work with Selection: Find map objects by address: Find map objects at location: Obtain table information: Obtain column information: Query a table's metadata: Query seamless tables: Fetch, EOT( ) Select, SelectionInfo( ) Find, Find Using, CommandInfo( ) SearchPoint( ), SearchRect( ), SearchInfo( ) NumTables( ), TableInfo( ) NumCols( ), ColumnInfo( ) GetMetadata$( ), Metadata TableInfo( ), GetSeamlessSheet( )

Working With Remote DataCreate a new table: Communicate with data server: Begin work with remote server: Assign local storage: Obtain column information: Send an SQL statement: Position the row cursor: Save changes: Discard changes: Free remote resources: Make remote data mappable: Change object styles: Synchronize a linked table: Create a linked table: Unlink a linked table: Disconnect from server:Reference

Server Create Table Server_Connect( ), Server_ConnectInfo( ) Server Begin Transaction Server Bind Column Server_ColumnInfo( ), Server_NumCols( ) Server_Execute( ) Server Fetch, Server_EOT( ) Server Server Rollback Server Close Server Create Map Server Set Map Server Refresh Server Link Table Unlink Server Disconnect

25

Working With Files (Other Than Tables) Retrieve driver information: Get ODBC connection handle: Get ODBC statement handle: Set Object styles: Server_DriverInfo( ), Server_NumDrivers( ) Server_GetODBCHConn( ) Server_GetODBCHStmt( ) Server Create Style

Working With Files (Other Than Tables)File Input/OutputOpen or create a file: Close a file: Delete a file: Rename a file: Copy a file: Read from a file: Write to a file: Determine file's status: Turn a file into a table: Retry on sharing error: Open File Close File Kill Rename File Save File Get, Seek, Input #, Line Input Put, Print #, Write # EOF( ), LOF( ), Seek( ), FileAttr( ), FileExists( ) Register Table Set File Timeout

File and Directory NamesReturn system directories: ProgramDirectory$( ), HomeDirectory$( ), ApplicationDirectory$( ) PathToTableName$( ), PathToDirectory$( ), PathToFileName$( ) TrueFileName$( ) FileOpenDlg( ), FileSaveAsDlg( )

Extract part of a filename:

Return a full filename: Let user choose a file:

26

MapBasic 10.0

Chapter 1: Introduction to MapBasic Return temporary filename: Locate files: TempFileName$( ) LocateFile$( ), GetFolderPath$( )

Working With Maps and Graphical ObjectsCreating Map ObjectsCreation statements: Create Arc, Create Ellipse, Create Frame, Create Line, Create Object, Create PLine, Create Point, Create Rect, Create Region, Create RoundRect, Create Text, AutoLabel, Create Multipoint, Create Collection CreateCircle( ), CreateLine( ), CreatePoint( ), CreateText( ) Create Object, Buffer( ), CartesianBuffer( ), CartesianOffset( ), CartesianOffsetXY( ), ConvexHull( ), Offset( ), OffsetXY( ), SphericalOffset( ), SphericalOffsetXY( ) Insert, Update Objects Enclose

Creation functions: Advanced operations:

Store object in table: Create regions:

Modifying Map ObjectsModify object attribute: Change object type: Offset objects: Set the editing target: Erase part of an object: Alter Object ConvertToRegion( ), ConvertToPLine( ) Objects Offset, Objects Move Set Target CreateCutter, Objects Erase, Erase( ), Objects Intersect, Overlap( ) Objects Combine, Combine( ), Create Object Rotate( ), RotateAtPoint( ) Objects Pline, Objects Split Objects Overlay, OverlayNodes( ) Set Resolution

Merge objects: Rotate objects: Split objects: Add nodes at intersections: Control object resolution:

Reference

27

Working With Maps and Graphical Objects Store an object in a table: Check Objects for bad data: Object processing: Insert, Update Objects Check Objects Disaggregate, Objects Snap, Objects Clean

Querying Map ObjectsReturn calculated values: Area( ), Perimeter( ), Distance( ), ObjectLen( ), Overlap( ), AreaOverlap( ), ProportionOverlap( ) ObjectGeography( ), MBR( ), ObjectNodeX( ), ObjectNodeY( ), ObjectNodeZ( ), Centroid( ), CentroidX( ), CentroidY( ), ExtractNodes( ), IntersectNodes( ) SessionInfo( )

Return coordinate values:

Return settings for coordinates, distance, area and paper units: Configure units of measure:

Set Area Units, Set Distance Units, Set Paper Units, UnitAbbr$( ), UnitName$( ) Set CoordSys ObjectInfo( ) LabelFindByID( ), LabelFindFirst( ), LabelFindNext( ), Labelinfo( )

Configure coordinate system: Return style settings: Query a map layer's labels:

Working With Object StylesReturn current styles: CurrentPen( ), CurrentBorderPen( ), CurrentBrush( ), CurrentFont( ), CurrentLinePen( ), CurrentSymbol( ), Set Style, TextSize( ) StyleAttr( ) MakePen( ), MakeBrush( ), MakeFont( ), MakeSymbol( ), MakeCustomSymbol( ), MakeFontSymbol( ), Set Style, RGB( ) ObjectInfo( ) Alter Object

Return part of a style: Create style values:

Query object's style: Modify object's style:

28

MapBasic 10.0

Chapter 1: Introduction to MapBasic Reload symbol styles: Style clauses: Reload Symbols Pen clause, Brush clause, Symbol clause, Font clause

Working With Map WindowsOpen a map window: Create/edit 3DMaps: Map Create Map3D, Set Map3D, Map3DInfo( ), Create PrismMap, Set PrismMap, PrismMapInfo( ) Add Map Remove Map AutoLabel MapperInfo( ), LayerInfo( ) Set Map Shade, Set Shade, Create Ranges, Create Styles, Create Grid, Relief Shade LabelFindByID( ), LabelFindFirst( ), LabelFindNext( ), Labelinfo( )

Add a layer to a map: Remove a map layer: Label objects in a layer: Query a map's settings: Change a map's settings: Create or modify thematic layers:

Query a map layer's labels:

Creating the User InterfaceButtonPads (ToolBars)Create a new ButtonPad: Modify a ButtonPad: Modify a button: Query the status of a pad: Respond to button use: Restore standard pads: Create ButtonPad Alter ButtonPad Alter Button ButtonPadInfo( ) CommandInfo( ) Create ButtonPads As Default

Reference

29

Creating the User Interface

Dialog BoxesDisplay a standard dialog box: Ask( ), Note, ProgressBar, FileOpenDlg( ), FileSaveAsDlg( ), GetSeamlessSheet( ) Dialog Alter Control, TriggerControl( ), ReadControlValue( ), Dialog Preserve, Dialog Remove CommandInfo(CMD_INFO_DLG_OK) Set ProgressBars Alter MapInfoDialog

Display a custom dialog box: Dialog handler operations:

Determine whether user clicked OK: Disable progress bars: Modify a standard MapInfo Professional dialog box:

MenusDefine a new menu: Redefine the menu bar: Modify a menu: Modify the menu bar: Invoke a menu command: Query a menu item's status: Create Menu Create Menu Bar Alter Menu, Alter Menu Item Alter Menu Bar, Menu Bar Run Menu Command MenuItemInfoByHandler( ), MenuItemInfoByID( )

WindowsShow or hide a window: Open a new window: Open Window, Close Window, Set Window Map, Browse, Graph, Layout, Create Redistricter, Create Legend, Create Cartographic Legend, LegendFrameInfo FrontWindow( ), WindowID( ) Set Map, Shade, Add Map, Remove Map, Set Browse, Set Graph, Set Layout, Create Frame, Set Legend, Set Cartographic Legend, Set Redistricter, StatusBar, Alter Cartographic Frame, Add Cartographic Frame, Remove Cartographic Frame WindowInfo( ), MapperInfo( ), LayerInfo( )

Determine a window's ID: Modify an existing window:

Return a window's settings:

30

MapBasic 10.0

Chapter 1: Introduction to MapBasic Print a window: Control window redrawing: PrintWin Set Event Processing, Update Window, Control DocumentWindow clause NumWindows( ), NumAllWindows( )

Count number of windows:

System Event HandlersReact to selection: React to window closing: React to map changes: React to window focus: React to DDE request: SelChangedHandler WinClosedHandler WinChangedHandler WinFocusChangedHandler RemoteMsgHandler, RemoteQueryHandler( ) RemoteMapGenHandler ToolHandler EndHandler ForegroundTaskSwitchHandler Set Handler

React to OLE Automation method: Provide custom tool: React to termination of application: React to MapInfo Professional getting or losing focus: Disable event handlers:

Communicating With Other ApplicationsDDE (Dynamic Data Exchange; Windows Only)Start a DDE conversation: Send a DDE command: Send a value via DDE: Retrieve a value via DDE: Close a DDE conversation: Respond to a request: DDEInitiate( ) DDEExecute DDEPoke DDERequest$( ) DDETerminate, DDETerminateAll RemoteMsgHandler, RemoteQueryHandler( ), CommandInfo(CMD_INFO_MSG)

Reference

31

Special Statements and Functions

Integrated MappingSet MapInfo Professional 's parent window: Set a Map window's parent: Create a Legend window: Set Application Window Set Next Document Create Legend

Special Statements and FunctionsDefines the name and argument list of a method/function in a .Net assembly Launch another program: Return information about the system: Run a string as an interpreted command: Save a workspace file: Load a workspace file or an MBX: Configure a digitizing tablet: Send a sound to the speaker: Set data to be read by CommandInfo: Set duration of the