MapBasic brugergruppe. Introduktion til MapBasic. Peter Horsbøll Møller Senior Systems Engineer Januar 2013



Relaterede dokumenter
MapBasic hvad kan det bruges til? Insights Danmark 2011

MapBasic brugergruppe. Geografiske objekter. Peter Horsbøll Møller Senior Systems Engineer April 2013

Help / Hjælp

IBM Network Station Manager. esuite 1.5 / NSM Integration. IBM Network Computer Division. tdc - 02/08/99 lotusnsm.prz Page 1

Portal Registration. Check Junk Mail for activation . 1 Click the hyperlink to take you back to the portal to confirm your registration

Aktivering af Survey funktionalitet

how to save excel as pdf

Værktøjer fra værktøjskassen. Søren Breddam, Stevns Kommune

TM4 Central Station. User Manual / brugervejledning K2070-EU. Tel Fax

3D NASAL VISTA 2.0

Vores mange brugere på musskema.dk er rigtig gode til at komme med kvalificerede ønsker og behov.

DET KONGELIGE BIBLIOTEK NATIONALBIBLIOTEK OG KØBENHAVNS UNIVERSITETS- BIBLIOTEK. Index

Click to edit title style. Få mere ud af dine kort. Tom Probert Peter Horsbøll Møller

User Manual for LTC IGNOU

QUICK START Updated: 18. Febr. 2014

QUICK START Updated:

Unitel EDI MT940 June Based on: SWIFT Standards - Category 9 MT940 Customer Statement Message (January 2004)

Vilkår for brug GIS-Byggesag 1 af 48

DK - Quick Text Translation. HEYYER Net Promoter System Magento extension

E-PAD Bluetooth hængelås E-PAD Bluetooth padlock E-PAD Bluetooth Vorhängeschloss

MultiProgrammer Manual

Vejledning til at tjekke om du har sat manuel IP på din computer.

VÆR EFFEKTIV SOM SAS PROGRAMMØR MED SAS ENTERPRISE GUIDE 7.12 GEORG MORSING

Status på det trådløse netværk

Linear Programming ١ C H A P T E R 2

Boligsøgning / Search for accommodation!

Project Step 7. Behavioral modeling of a dual ported register set. 1/8/ L11 Project Step 5 Copyright Joanne DeGroat, ECE, OSU 1

StarWars-videointro. Start din video på den nørdede måde! Version: August 2012

Shooting tethered med Canon EOS-D i Capture One Pro. Shooting tethered i Capture One Pro 6.4 & 7.0 på MAC OS-X & 10.8

#MADE IN DENMARK# Danish Design by Hammel

Opsætning af Backup. Hvis programmet registreres korrekt vises nedenstående skærmbillede. Genstart herefter programmet.

Opsætning af Backup. Dette er en guide til opsætning af backup med Octopus File Synchronizer.

Privat-, statslig- eller regional institution m.v. Andet Added Bekaempelsesudfoerende: string No Label: Bekæmpelsesudførende

SAS Corporate Program Website

Aflevering af OIOXML-skemaer Dokumentation

Userguide. NN Markedsdata. for. Microsoft Dynamics CRM v. 1.0

Det er muligt at chekce følgende opg. i CodeJudge: og

Setup Guide Do It Now Work Smarter

Instruktioner i installation og afinstallation af Windows PostScript- og PCLprinterdrivere

PARALLELIZATION OF ATTILA SIMULATOR WITH OPENMP MIGUEL ÁNGEL MARTÍNEZ DEL AMOR MINIPROJECT OF TDT24 NTNU

ASB signatur. ASB signatur. Vejledning til opsætning af signatur IKT - Februar 2008

Tips og Tricks. Erik Wendelboe Nielsen Christian Woergaard. econocap. PTC/USER Fredericia

Terese B. Thomsen 1.semester Formidling, projektarbejde og webdesign ITU DMD d. 02/

Brug sømbrættet til at lave sjove figurer. Lav fx: Få de andre til at gætte, hvad du har lavet. Use the nail board to make funny shapes.

Fejlbeskeder i SMDB. Business Rules Fejlbesked Kommentar. Validate Business Rules. Request- ValidateRequestRegist ration (Rules :1)

Operation Manual SMS Air Conditioner Remote Controller Model No.: SR-001

Hvor er mine runde hjørner?

Generalized Probit Model in Design of Dose Finding Experiments. Yuehui Wu Valerii V. Fedorov RSU, GlaxoSmithKline, US

Engelsk. Niveau C. De Merkantile Erhvervsuddannelser September Casebaseret eksamen. og

WIKI & Lady Avenue New B2B shop

Vi ska ha det vand vi kan drikke

Engelsk. Niveau D. De Merkantile Erhvervsuddannelser September Casebaseret eksamen. og

Side 1 af 9. SEPA Direct Debit Betalingsaftaler Vejledning

Digitaliseringsstyrelsen

Basic statistics for experimental medical researchers

ODBC made easy på dansk (når bare man ved hvordan) Jesper Michelsen, Data warehouse & Analyse

Brugermanual til Assignment Hand In

SEPA Direct Debit. Mandat Vejledning Nets Lautrupbjerg 10 DK-2750 Ballerup

Business Rules Fejlbesked Kommentar

RentCalC V Soft-Solutions

Vejledning til Blackboards portfolio værktøj

MapBasic &.NET interaktion. MapBasic.NET. Jakob Lanstorp IT konsulent COWI. Odense 23. Juni jun 2011 MapBasic &.

Vester Kopi A/S - Plotservice

Netværk & elektronik

frame bracket Ford & Dodge

The EAL Jobportal. How to get started

Mandara. PebbleCreek. Tradition Series. 1,884 sq. ft robson.com. Exterior Design A. Exterior Design B.

Trolling Master Bornholm 2012

Schedulering af SAS job i MS Task Scheduler, som sender med log og statuskode ved fejl

Transkript:

MapBasic brugergruppe Introduktion til MapBasic Slå mute fra hvis I vil sige eller spørge om noget Peter Horsbøll Møller Senior Systems Engineer Januar 2013 Every connection is a new opportunity Every connection is a new opportunity

Program MapBasic IDE som udviklingsværktøj Opslag og tolkning af MapBasic hjælpefilen MapBasic-vinduet som genvej til MapBasic-kode Simpel struktur på et lille MapBasic-program Hvordan laver man en knap og et menupunkt Spørgsmål og svar Every connection is a new opportunity

MapBasic IDE Hent den her: http://mustafaozcetin.wordpress.com/mapbasic/mapbasicide-en/ Et gratis udviklingsmiljø til MapBasic som dog kræver MapInfo MapBasic for at få kompileret kildekoden til en applikation Udviklet af en tredjepart, Mustafa Özçetin En væsentlig forbedring i forhold til standard MapBasic editoren Et alternativ til andre tredjeparts teksteditorer, som kan konfigureres til MapBasic udvikling

Syntaks markering Defineret i *.xshd filerne i mappen <installation directory>\theme folder. Forskellig farve på de forskellige typer tekst: tal tekst kendte MapBasic ord

Tekstfuldførelse Tryk Ctrl +Space og se mulige tekster, kommandoer eller procedurenavne

Tekstfuldførelse MapBasic IDE kender Alle standard MapBasic kommandoer og funktioner Alle de variable (lokale, modulære og globale) du måtte have defineret i dit modul Ale konstanter i MapBasic.def, Menu.def PaperSize.def og Icons.def De subprocedurer og funktioner, du selv har defineret Dine egne typer Og det gælder for både dem i selve modulet og i de inkluderede filer (via Include... )

Indsættelse af tekstblokke Indtast følgende efterfulgt af Tab for automatisk indsættelse af tekstblok if : If-End If tekstblok dc : Do-Case tekstblok for : For-Next tekstblok dw : Do-While tekstblok ww : While-Wend tekstblok typ : Type tekstblok sub : Sub-End Sub tekstblok func : Function-End Function tekstblok

Kodestumper Du kan indsætter foruddefinerede kodestumpler med Alt-Insert. Dette viser dig en liste med kodestumper. Vælg den ønskede i listen og tryk enten Tab eller Enter for at indsætte den.

Egne kodestumper Opret dine egne kodestumper via Settings > Edit Custom Code Snippets Indsættes med Ctrl + Alt + Insert

Hjælp til skrivning Dupliker aktuel linje Slet aktuel linje Flyt linje op Flyt linje ned Ctrl + D Alt + Del Alt+ Up Alt + Down Kommentar Ctrl + 7 Gå til selve procedure/funktion F3 Fold sammen/fold ud Ctrl + Shift + F

Hjælp til positionering Gå til Procedure/funktion Ctrl + Shift + O Opret/fjern bogmærke Gå til næste bogmærke Gå til forrige bogmærke F8 Ctrl+Shift+Pil Op Ctrl+Shift+Pil Ned

Understøttelse af flere MapBasic versioner

MapBasic hjælpefilen INTRODUKTION Hvordan læses hjælpefilen? Det grundliggende i MapBasic

Anden MapBasic dokumentation

Demo MapBasic hjælpefil

MapBasic vinduet MapBasic vinduet i MapInfo Professional: Åbnes via Indstillinger > Vis MapBasic vinduet Optager de (fleste) handlinger brugeren udfører i MapInfo Professional, når det er åbnet Kan også afspille handlinger/kommandoer Vær opmærksom på at MapBasic-kommandoerne i MapBasic vinduet kan være meget specifikke, f.eks. kan de referere til et specifikt vindue, en specifik tabel eller lignende At situationen måske ikke er den helt samme næste gang du afspiller en kommando, måske er der ingen tabeller åbne, måske er der ingen åbne kortvinduer og lignende

Eksempel

Demo MapBasic-vinduet

Generel struktur Include kommandoer Konstanter Deklarationer af procedurer og funktioner Define kommandoer Konstanter som anvendes i modulet Declare kommandoer Deklarationer af interne procedurer og funktioner Dim kommandoer Oprettelse af modulære variable Procedurer og funktioner Selve funktionaliteten

Oprette nye menuer Create Menu newmenuname [ ID menu_id ] [ Context ] As menuitem [ ID menu_item_id ] [ HelpMsg help ] { Calling handler As menuname } [, menuitem... ] newmenuname is a string representing the name of the menu to define or redefine. menuitem is a string representing the name of an item to include on the new menu. Context is reserved for internal use only; not usable in MapBasic programs. menu_id is a SmallInt ID number from one to fifteen, identifying a standard menu. menu_item_id is an integer ID number that identifies a custom menu item. help is a string that appears on the status bar whenever the menu item is highlighted. handler is the name of a procedure, or a code for a standard menu command, or a special syntax for handling the menu event by calling OLE or DDE; see Calling Clause Options. If you specify a command code for a standard MapInfo Professional Show/Hide command (such as M_WINDOW_STATISTICS), the menuitem string must start with an exclamation point and include a caret (^), to preserve the item's Show/Hide behavior. menuname is the name of an existing menu to include as a hierarchical submenu.

Ændre eksisterende menuer Alter Menu { menuname ID menu_id } Add menudef [, menudef... ] Where each menudef defines a menu item, according to the syntax: newmenuitem [ ID menu_item_id ] [ HelpMsg help ] [ { Calling handler As menuname } ] menuname is the name of an existing menu (for example, "File"). menu_id is a standard integer menu ID from 1 to 22; 1 represents the File menu. newmenuitem is a string, the name of an item to add to the specified menu. menu_item_id is a custom integer menu item identifier, which can be used in subsequent Alter Menu Item statements. help is a string that will appear on the status bar while the menu item is highlighted. handler is the name of a procedure, or a code for a standard menu command (e.g., M_FILE_NEW), or a special syntax for handling the menu event by calling OLE or DDE. If you specify a command code for a standard MapInfo Professional Show/Hide command (such as M_WINDOW_STATISTICS), the newmenuitem string must start with an exclamation point and include a caret (^), to preserve the item's Show/Hide behavior. For more details on the different types of handler syntax, see the Create Menu statement.

Oprette menupaletter Create ButtonPad { title_string ID pad_num } As button_definition [ button_definition... ] [ Title title_string ] [ Width w ] [ Position ( x, y ) [ Units unit_name ] ] [ ToolbarPosition ( row, column ) ] [ { Show Hide } ] [ { Fixed Float } ] title_string is the ButtonPad title (for example, "Drawing"). pad_num is the ID number for the standard toolbar you want to re-define: 1 for Main 2 for Drawing 3 for Tools 4 for Standard 5 for ODBC w is the pad width, in terms of the number of buttons across. x, y specify the pad's position when it is floating; specified in paper units (for example, inches). unit_name is a string representing paper units name (for example, "in" for inches, "cm" for centimeters). row, column specify the pad's position when it is docked as a toolbar (for example, 0, 0 places the pad at the left edge of the top row of toolbars, and 0, 1 represents the second pad on the top row).

Ændre eksisterende menupaletter Alter ButtonPad { current_title ID pad_num } [ Add button_definition [ button_definition... ] ] [ Remove { handler_num ID button_id } [,... ] ] [ Title new_title ] [ Width w ] [ Position ( x, y ) [ Units unit_name ] ] [ ToolbarPosition ( row, column ) ] [ { Show Hide } ] [ { Fixed Float } ] [ Destroy ] current_title is the toolbar's title string (e.g., "Main"). pad_num is the ID number for a standard toolbar: 1 for Main, 2 for Drawing, 3 for Tools, 4 for Standard, 5 for ODBC. button_id is a custom button's unique identification number. handler_num is an integer handler code (e.g., M_TOOLS_RULER) from MENU.DEF. new_title is a string that becomes the toolbar's new title; visible when toolbar is floating. w is the pad width, in terms of the number of buttons across. x, y specify the toolbar's position when floating; specified in paper units (e.g., inches). unit_name is a string paper unit name (e.g., "in" for inches, "cm" for centimeters). row, column specify the toolbar's position when docked (e.g., 0, 0 places the pad at the left edge of the top row of toolbars, and 0, 1 represents the second toolbar on the top row).

Knapdefinitioner Each button_definition clause can consist of the keyword Separator, or it can have the following syntax: { PushButton ToggleButton ToolButton } Calling { procedure menu_code OLE methodname DDE server, topic } [ ID button_id ] [ Icon icon_code [ File file_spec ] ] [ Cursor cursor_code [ File file_spec ] ] [ DrawMode dm_code ] [ HelpMsg msg ] [ ModifierKeys { On Off } ] [ Enable ] [ Disable ] [ Check ] [ Uncheck ] procedure is the handler procedure to call when a button is used. menu_code is a standard MapInfo Professional menu code from MENU.DEF (for example, M_FILE_OPEN); MapInfo Professional runs the menu command when the user uses the button. methodname is a string specifying an OLE method name. server, topic are strings specifying a DDE server and topic name. ID button_id specifies a unique button number. This number can be used as a parameter to allow a handler to determine which button is in use (in situations where different buttons call the same handler) or as a parameter to be used with the Alter Button statement.

Knapdefinitioner, fortsat Icon icon_code specifies the icon to appear on the button; n can be one of the standard MapInfo icon codes listed in ICONS.DEF (for example, MI_ICON_RULER). If the File sub-clause specifies the name of a file containing icon resources, n is an integer resource ID identifying a resource in the file. The size of the button can be defined with resource file id of n for small and n+1 for large sized buttons, with resource file ids of n and n+1 respectively. Cursor cursor_code specifies the shape the mouse cursor should adopt whenever the user chooses a ToolButton tool; n is a cursor code (for example, MI_CURSOR_ARROW) from ICONS.DEF. This clause applies only to ToolButtons. If the File sub-clause specifies the name of a file containing icon resources, n is an integer resource ID identifying a resource in the file. DrawMode dm_code specifies whether the user can click and drag, or only click with the tool; dm_code is a code (for example, DM_CUSTOM_LINE) from ICONS.DEF. The DrawMode clause applies only to ToolButtons. HelpMsg msg specifies the button's status bar help and, optionally, ToolTip help. The first part of the msg string is the status bar help message. If the msg string includes the letters \n then the text following the \n is used as the button's ToolTip help. ModifierKeys clause controls whether the shift and control keys affect "rubber-band" drawing if the user drags the mouse while using a ToolButton. Default is Off, meaning that the shift and control keys have no effect.

Ændre menubjælken Alter Menu Bar { Add Remove } { menuname ID menu_id } [, { menuname ID menu_id }... ] menuname is the name of an available menu (e.g., "File") menu_id is a standard menu ID from one to fifteen; one represents the File menu.

Demo Anvendelse af MapBasic IDE

Spørgsmål? Peter Horsbøll Møller peter.moller@pb.com www.pitneybowes.dk/software Husk: Som medlemmer af MapBasic brugergruppen har I mulighed for at sende spørgsmål til mig via e-mail Every connection is a new opportunity

Links Den danske PBSoftware blog: PBBI Location Intelligence Blog: danmark.pbbiblogs.com li.pbbiblogs.com/ MapInfo-L groups.google.com/group/mapinfo-l MI Pro træningssvideoer: Planer for produkterne: Download MapBasic: MI Pro prøveversion: www.pbinsight.com/support/training/video-tutorials roadmap.pbinsight.com/ www.pbinsight.com/support/product-downloads/for/mapbasic www.pbinsight.com/support/product-downloads/for/mapinfo-professional MI Pro dokumentation: Anden dokumentation: Anden download: www.pbinsight.com/support/product-documentation/details/mapinfo-professional www.pbinsight.com/support/product-documentation/ www.pbinsight.com/support/product-downloads/

Every connection is a new opportunity Every connection is a new opportunity