On Thu, 11 Aug 2005, Ronning, Christine wrote: > 1) Does anyone know of a source I can use to look at the coding for some > MapBasic example applications? I have tried opening the .MB files that > come with MapInfo both in MapBasic and in notepad, but it looks like > things are encrypted. I also searched the MapInfo-L list archives, but > couldn't find anything useful.
MapBasic source code (files with a .mb extension, not .mbx) are plain text. They're not encrypted. You must have tried to open an .mbx file. Also there's tons of MapBasic source code at the Directions Magazine Free Tools site. There's also plenty of examples in your C:\Program Files\MapInfo\MapBasic\SAMPLES\MAPBASIC directory. What you might have trouble finding is a few simple examples that get you through the basics. Those sorts of things are presented in the standard MapBasic 2-day course offered by MapInfo and many resellers (if you ever get to Denver, I teach that course at Primus Geographics' offices, but you can get that training from MapInfo partners in Canada too.) But if you're determined to teach yourself, I'd start by perusing the MapBasic Reference manual, and then dig into the sample applications that come with MapBasic (mentioned above.) I wouldn't say these are the most elegant examples of MapBasic programming, but they will show you how to get the job done. The main advice I teach in my class is to use the MapBasic window to write the complicated code for things like opening tables, making thematic maps and setting layers and styles in map windows. This doesn't write the most flexible code, but if you're a beginner, it's amazingly productive. Next, learn to understand the online help pages. They're great. People who say MapInfo's help stinks are just plain wrong. And perhaps your best resource is this here mailing list. It helps to ask only one question per message, and provide an example of the *relevant* code that's giving you trouble. Make it easy for people to verify your problem and don't ask too many questions at a time, and you'll get results. > 2) I would like to develop a MapBasic application that links a thematic > map to the layout view. My layout contains a thematic map and > corresponding rectangular objects that are meant to represent each > geography found on the map. Beside these rectangular objects are text > boxes that list the geography Id and value associated with it. I would > like to run a MapBasic program that updates and sorts the rectangles and > text boxes based on the thematic map instead of having to do it manually > each time. Erm... You might want to try this in steps. Have you tried using the Cartographic legend commands, or are you really set on building your own legend manager? You *can* build your own, and you can do some really neat things in a layout window, but creating a custom legend manager is not a project for a beginner. Not that you shouldn't try, but I'd say learn to use the tools that exist (i.e. cartographic legend) before you attempt to blaze new trail. - Bill Thoen --------------------------------------------------------------------- List hosting provided by Directions Magazine | www.directionsmag.com | To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Message number: 17464