I had several requests on how to setup Ultraedit / UEStudio for MapBasic. This 
is some of the stuff Peter Horsbøll Møller and I have filed through the years:


Setup for Ultraedit or UEStudio for MapBasic use:

*1*.
Create two text files and save them to two batch files called:
Compile_MapBasic.bat and Link_MapBasic.bat.

*2*.
Enter in the Compile_MapBasic.bat file:

@Echo off
"C:\Program Files\MapInfo\mapbasic 4.5\Mapbasic.Exe" -NOSPLASH -D ""%1.mb""
if exist ""%1.err"" type ""%1.err""

Adjust the path.

*3*.
Enter in the Link_MapBasic.bat:

@Echo off
"C:\Program Files\MapInfo\mapbasic 4.5\Mapbasic.Exe" -NOSPLASH -L ""%1.mbp""
if exist ""%1.err"" type ""%1.err""

Adjust the path.

*4*.
Make two entries in the Tool Configuration under the menu: Advanced > Tool 
Configuration.

*5*.
Insert a new tool.

Enter in the command line:
"D:\Dev\UltraEdit_setup\Batch\Compile450.bat" "%p%n"

Adjust the path.

Set the Menu Item Name to
Compile MapBasic 4.5

Activate the following items:
-Save all files first
-Save Active files
-Output to List Box

*6*.
The command line for linking a project is:
"D:\Dev\UltraEdit_setup\Batch\Link450.bat" "%rp%rn"

*7*.
Set the shortcut for compiling to ctrl+k and linking to ctrl+l.

This in done en menu Advanced > Configuration > Tab sheet Key Mapping
Select AdvancedUserTool1 fom the list and Assign the shortcut to ctrl k
Do the some for AdvancedUserTool2 iwth ctrl l

*8*.
Create a new txt file called wordlist and add the text:

/L12 "MapBasic" Line Comment = ' File Extensions = MB DEF MBP WOR MNU LNG STR
/Delimiters = [EMAIL PROTECTED]&*()-+=|\/{}[]:;"'<> ,   .?
/Function String = "^{%Function^}^{%Sub^}"
/Member String = "^([A-Za-z0-9_:.]+^)[ ^t*&]+$S[ ^t]++[(=;]"
/Variable String = "^([A-Za-z0-9_:.]+^)[ ^t*&]+$S[ ^t]++[(=;]"
/Indent Strings = "Then" "If" "Else" "ElseIf" "Case" "Function" "Sub" "For" 
"Do" "While"
/Unindent Strings = "End If" "End Sub" "End Function" "End Case" "Next" "Loop" 
"NoSelect"
/Open Brace Strings =  "{" "(" "["
/Close Brace Strings = "}" ")" "]"
/Open Fold Strings = "Sub " "Function "
/Close Fold Strings = "End Sub" "End Function"
/C1 Type
Alias
Brush
Date
Float Font
Integer
Logical
Object
Pen
SmallInt String Symbol
T_POINT

/C2 Declarations
As
ByVal
Declare Define Dim
Global
Include
Type

/C3 Operators
Abs Acos ALL AND ANY Asin Atan
Between BLACK BLUE
Contains Cos CYAN
Entire Entirely Exp
FALSE Fix
GREEN
IN Intersects Int
Log
MAGENTA Minimum Maximum Mod
NOT
OR
Part Partly
RED Round
Sin Sqr
Tan TRUE
Within WHITE
YELLOW
+
-
*
/
^
&
\
(
)
<
>
,
=

/C4 Procedures and handlers, loop and branch
Call Calling Case
Do
Else ElseIf End Exit
Fetch For Function
GoTo
If
Loop
Next Note
OnError
Print
Resume
Sub
Then
Until
Wend While

/C5 SQL syntax
From
Group By
Into
NoSelect
Order By
Select Selection
Where


*9*.
Create a ASCII file calledl autocomplete.txt enter the following lines:

ApplicationDirectory$()
As String
As Integer
As Object
As Date
As Logical
As Float
As Pen
As Brush
As Symbol
As Font
As T_POINT
Control EditText                Position
Control StaticText      Position
Control ListBox         Position
Control MultiListBox    Position
Control OKButton                Position
Control CancelButton    Position
Control Button          Position
Control CheckBox                Position
Control PopUpMenu               Position
Control MultiListBox    Position
Control RadioGroup      Position
Control GroupBox                Position
Control SymbolPicker    Position
Control BrushPicker     Position
Control PenPicker               Position
Control FontPicker      Position
ButtonPadInfo(
BTNPAD_INFO_FLOATING
BTNPAD_INFO_WIDTH
BTNPAD_INFO_NBTNS
BTNPAD_INFO_X
BTNPAD_INFO_Y
BTNPAD_INFO_WINID
ColumnInfo(
COL_INFO_NAME
COL_INFO_NUM
COL_INFO_TYPE
COL_INFO_WIDTH
COL_INFO_DECPLACES
COL_INFO_INDEXED
COL_INFO_EDITABLE
COL_TYPE_CHAR
COL_TYPE_DECIMAL
COL_TYPE_INTEGER
COL_TYPE_SMALLINT
COL_TYPE_DATE
COL_TYPE_LOGICAL
COL_TYPE_GRAPHIC
COL_TYPE_FLOAT
CommandInfo(CMD_
CMD_INFO_X
CMD_INFO_Y
CMD_INFO_SHIFT
CMD_INFO_CTRL
...
...
add more your self by pasting from the MapBasic.def fil.

*10*
Add the autocomplete.txt for code completion:
In menu Advanced > Configuration > tabsheet Edit.
Set the field Auto Complete File to point to the autocomplete.txt file.
With ctrl+space you can now have code completion (not intelligent but 
alphabetich)

*11*
Have the 'Trim trailing spaces on file save' on in the Menu Advanced > 
Configuration > General,
else an 'exit sub' might be taken for a 'sub' when using the folder collapse of 
subs and function

---------------------------

Note: A MapBasic project and the associated UEStudio project most have the same 
name.
This is to be able to link a MapBasic project from UEStudio.



HTH,

Jakob Lanstorp
Software Consultant
Geographical Information & IT 

COWI A/S
Odensevej 95
DK-5260 Odense S

Tel  +45 6311 4900
Fax  +45 6311 4949
Mob  +45 5050 8087
E-mail [EMAIL PROTECTED]
http://www.cowi.dk
http://www.cowi.com

Reply via email to