Personal tools
You are here: Home CompileUsing
FrontPage >> MapInfoRoadmap >> MapBasicDevelopment >> CodeGenerators >> UltraEdit >>

CompileUsing

Document Actions
last edited 1 year ago by PeterHorsbollMoller

So you've decided you like UltraEdit but you still have to drudge through the Start Menu to run MapBasic Editor to compile your work. Not so fast, compile your .mb from UltraEdit, here's how.

Under the Advanced menu, choose Tool Configuration. First, create a little compile script in DOS batch language, and call it MI_Compile.bat, and save it some place handy, c:\Program Files\MapInfo directory for instance. The DOS batch file should contain the following 3 lines:

@Echo off

start/wait MAPBASIC.EXE -NOSPLASH -D %1.mb

if exist %1.err type %1.err

Back in UltraEdit and in the Command Line edit control, enter the following:

"C:\Program Files\MapInfo\MI_Compile.bat" "%p%n" (include the quotes)

In the Menu Item control put whatever you want for this tool's menu label, (e.g. MapBasic Editor Compile). Check "Save all files first", select "Output to listbox", and check "capture output", and then save this with the Insert or Replace button.

WARNING If you are using Norton antivirus, disable it before you compile this way. If you don't, your machine will probably need a reboot. I've been told that the fix for this is to use the "Alternate capture method" but I haven't explored that; I just switch off NAV. McAffee? has no such problem.

There are some users who do not experience the problem mentioned with Norton Antivirus, this problem may be isolated to certain systems.

Anyway, if all is set up, bring your MB file in focus in UE and choose the new tool on the Advanced menu, and it should compile. Make a similar batch file (e.g. MI_Link.bat) for linking and set it up in a similar way.

Mine looks like:

@Echo off

start/wait MAPBASIC.EXE -NOSPLASH -L %1.mbp

if exist %1.err type %1.err

There's more than one way to do this, but look in the UE help and the MapBasic Editor manual for compiling outside the MB editor, and experiment. I actually now use GNU make under UE to compile and link large MapBasic Editor projects in one step (plus it only recompiles things that have changed, so it's fast) but that's a whole other topic.

If you nee to recompile you entire project, I would recommend using a bat file. This is not in anyway connected to you rmapBasic project, so you nee to keep the bat file update as you add new modules to your project.

Here is an example of a bat file that will compile a bunch of MapBasic modules (.mb):

"C:\MapBasic\MapBasic.exe" -nosplash -D "PlanteMenu?.mb" "PlanteArea?.mb"

"C:\MapBasic\MapBasic.exe" -nosplash -D "PDExcel?.mb" "PDHent?.mb" "PDTools?.mb" "PlanteDatabase?.mb"

"C:\MapBasic\MapBasic.exe" -nosplash -D "PDMarkDlg?.mb" "PDMarkerDlg?.mb" "PDMarkTable?.mb"

"C:\MapBasic\MapBasic.exe" -nosplash -D "DFFE\HEMALoadData?.mb" "DFFE\T_HEMA_ANSOGER_INFO.mb"

"C:\MapBasic\MapBasic.exe" -nosplash -D "LECLoad?\LECImport?.mb"

"C:\MapBasic\MapBasic.exe" -nosplash -D "Printing 3.3\Printing.mb" "Printing 3.3\PrintHlp?.mb"

"C:\MapBasic\MapBasic.exe" -nosplash -D "Tools\ToolSplit?.mb"

dir *.err /s pause

Note that I have used relative paths. These are all relative to the location of the bat file. Also note that you can send more than one mb file to be compiled. This will speed up the compilation as MapBasic has to be initiated fewer times.

« December 2008 »
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
 

Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: