Miniguide to the MapBasic Window

Jacques PARIS, April 2000

TABLE OF CONTENTS

1 - THE MBW IN GENERAL

1-1 MBW targets
1-2 Mini Guide targets
1-3 MBW basic functioning principles

2 - WORKING THE MBW

2-1 Opening and closing the MBW
2-2 Editing MBW contents
2-3 Typing statements in the MBW
2-4 Issuing commands through the MBW
2-5 Saving and using scripts
2-6 A useful utility

3 - COMPONENTS OF A MBW SCRIPT

3-1 Local variables
3-2 Statements
3-3 Run Menu Command (RMC)
3-4 Commands
3-4-1 Run command
3-4-2 Running an application
3-4-3 Running a program
3-4-4 Terminating an application
3-5 Functions

4 - DEALING WITH UNITS

4-1 Coordinate system
Coordinate units in a table
Coordinate units in a Mapper
Coordinate units in a Layout
Coordinate units in MBW
4-2 Specifying units
4-2-1 Area units
4-2-2 Distance units
4-2-3 Paper units
4-2-4 Units names <> Abbreviations
4-3 Choosing a coordinate system
Coordsys clause
ChooseProjection$()
Set Coordsys

5 - DEALING WITH STYLES AND FORMATS

5-1 Styles
5-1-1 Style clauses
Brush
Pen
Symbol
5-1-2 Current styles
5-1-3 Detailed style attributes
5-1-4 Points <> Width and other PEN functions
IsPenWidthPixels()
PenWidthToPoints()
PointsToPenWidth()
PenPattern()
5-1-5 Defining styles
MakeBrush()
MakeFont()
MakePen()
MakeSymbol()
MakeCustomSymbol()
MakeFontSymbol()
5-1-6 Changing current styles
5-1-7 Scope of style settings
5-1-7-1 Pen style of closed objects
5-1-7-2 Applying style to existing objects
5-1-7-3 Applying style to new objects
5-1-7-4 Style override
5-1-8 Managing symbols
5-1-9 Colors in the RGB context
RGB()
5-2 Numbers
Format$()
FormatNumber$()
Set Format Number
DeformatNumber$()
5-3 Dates
FormatDate$()
Set Format Date
Set Date Window
StringToDate()
NumberToDate()
Time()
CurDate()
Day()
WeekDay()
Month()
Year()
Timer()

6 - Creating new objects

6-1 Create commands
6-1-1 Create Arc
6-1-2 Create Ellipse
6-1-3 Create Line
6-1-4 Create Pline
6-1-5 Create Point
6-1-6 Create Rect
6-1-7 Create Region
6-1-8 Create RoundRect
6-1-9 Create Text
6-1-10 The [INTO...] optional clause
6-2 CreateXXX() functions
6-2-1 Conditions of use
6-2-2 CreateCIRCLE()
6-2-3 CreateLINE()
6-2-4 CreatePOINT()
6-2-5 CreateTEXT()
6-3 Comparing creation procedures
6-3-1 Direct insertion or variable holding
6-3-2 Controlling the style of the new objects
6-3-3 Storing objects held in object variables

7 - WORKING ON EXISTING OBJECTS

7-0 Information on existing objects
7-1 Alter object
7-2 Buffer()
7-3 CartesianBuffer()
7-4 Centroid object
7-5 Conversion to polyline
7-6 Conversion to region
7-7 Creating objects from objects
7-8 Deleting objects
7-9 Extraction by nodes
7-10 Intersection nodes
7-11 Combination of objects
7-12 Erasing with objects
7-13 Objects intersect
7-14 Objects overlay
7-15 Objects split
7-16 Overlap of two objects
7-17 Overlay nodes of two objects
7-18 Set target
7-19 Set resolution
7-20 Update

8 - GEOMETRIC INFORMATION FUNCTIONS

8-1 Area()
8-2 AreaOverlap()
8-3 CartesianArea()
8-4 CartesianDistance()
8-5 CartesianObjectLen()
8-6 CartesianPerimeter()
8-7 CentroidX()
8-8 CentroidY()
8-9 Distance()
8-10 MBR()
8-11 ObjectGeography()
8-12 ObjectLen()
8-13 ObjectNodeX()
8-14 ObjectNodeY()
8-15 Perimeter()
8-16 ProportionOverlap()
8-17 SphericalArea()
8-18 SphericalDistance()
8-19 SphericalObjectLen()
8-19 SphericalPerimeter()

9 - WINDOWS IN GENERAL

Information on windows
9-1 FrontWindow()
9-2 NumAllWindows()
9-3 NumWindows()
9-4 WindowId()
9-5 WindowInfo()
Managing windows
9-6 Closing a window
9-7 Opening a non-document window
9-8 Setting up a window
9-9 Setting up parts of MI main window
Menu Bar
StatusBar
Set ProgressBars
9-10 Saving an image of a window.
9-11 Updating a window
9-12 Printing a window

10 - DOCUMENT WINDOWS

Browser
10-1 New browser window
10-2 Setting up a browser
10-3 Browser contents
Graph
10-4 New graph window
10-5 Setting up a graph
Mapper
10-6 MapperInfo()
10-7 Layerinfo()
10-8 New map window
10-9 Setting up a map
10-10 Adding a layer to a mapper
10-11 Removing a layer from a mapper
Layout
10-12 New layout window
10-13 Setting up a layout
10-14 Creating a new frame

11 - TABLES

Existing table
11-1 Opening a MI table
11-2 Closing an open table
11-3 Exporting a table in another format
11-4 Setting up a table
New table
11-5 Importing a table
11-6 Creating a new table
11-7 Registering a table
Modifications to a table
global
11-8 Creating/dropping an index
11-9 Creating/dropping a map
columns
11-10 Altering a table
11-11 Adding a column
11-12 Updating (entire column)
rows
11-13 Inserting new rows
11-14 Updating (selected rows)
11-15 Deleting object(s), row(s)
Managing tables
11-16 Packing a table
11-17 Saving a table
11-18 Discarding unsaved edits
11-19 Renaming a table
11-20 Erasing a table from disk
Getting information
11-21 Information on a column
11-22 Number of columns
11-23 Number of tables
11-24 Information on a table
11-25 Seamless table
Creating a report
11-26 Creating a Crystal report
11-27 Loading a report
Meta Data
11-28 Managing Metadata
11-29 Retrieving Metadata

12 - FINDING AND SELECTING

12-1 Geographic search
SearchInfo()
SearchPoint()
SearchRect()
12-2 Locating a record in its table
12-3 Normative selection
12-4 Information on a selection
12-5 Locating an 'address'
12-6 Specifying column used for finding

13 - MAPPING

Thematic map
13-1 Adding a thematic map
13-2 Set shade
Legend
13-3 Create legend
13-4 Set legend
13-5 Create cartographic legend
13-6 Add cartographic frame
13-7 Set cartographic legend
13-8 Alter cartographic frame
13-9 Remove cartographic frame
13-10 Information about a legend frame
Labels
13-11 Automatic labels
13-12 Questioning labels
13-13 Getting information on a label
Grid map
13-14 Creating a grid map
13-15 Shading a relief map

14 - PADS AND MENUS
Buttons and pads

14-0 Information on a buttonpad
14-1 Acting on a button
14-2 Acting on a buttonpad
14-3 Creating a buttonpad
14-4 Reverting a buttonpad to original
14-5 Definitions of MI buttonpads
14-6 Standard MI icons
14-7 Standard MI cursors
14-8 Available drawing modes
Items and Menus
14-9 Acting on a specific menu item
14-10 Information on a menu item
14-11 Acting on a menu
14-12 Creating a new menu
14-13 Redefining the menu bar
14-14 Acting on the menu bar
14-15 Standard menu names and codes
14-16 Control codes and special characters in menu
14-17 MI menus
14-18 Menu item codes
Shortcut menus
14-19 Handling shortcut menus
14-20 Standard MI shortcut menus
Managing menus
14-21 Managing menus
 

15 - System

Information at system level
15-1 Information on the system
Addresses
15-2 Directories and paths
File Handling
15-3 Files
15-4 File opening and closing dialogs
Digitizer setup
15-5 Setting up a digitizer
Redistricting session
15-6 Creating a redistricter
15-7 Changing th characteristics of a districts table
Miscellaneous
15-8 Beep
15-9 Character set
15-10 Drag threshold level
15-11 Set event processing
15-12 Randomize
15-13 Saving Workspace
15-14 Ending MapInfo
String comparison
15-15 Stringcompare()

16 - POSTING THE RESULTS

16-1 Message window
16-2 Note window
16-3 Print statement
16-4 Note statement
16-5 Set window statement (part.)
16-6 Making space

17 - TIPS AND EXAMPLES
 

APPENDICES

A - Restrictions on commands

B - Value equivalent of selected parameters

C - Menu item equivalents in MBW

D - Functional classification of all MapBasic functions, clauses, statements and procedures

E - Alphabetic listing of all MapBasic functions, clauses, statements and procedures