.
--------------------------------------- The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. Mouchel Limited, Registered in England at West Hall, Parvis Road, West Byfleet, Surrey UK KT14 6EZ Registered No : 1686040 .
Please go ahead and add the linking script to your site - it's put on
the list for anyone to use, and it's very useful to have a single site
to consolidate N++ tips as you have created. The MB help search using
KeyHH.exe will be very useful!
I am currently using N++ v4.5 with function list v1.2. I set it up by
creating two rules, one for subs and one for functions for the MapBasic
user defined language (which needs to exist already) - the regular
expressions are contained in the ini file that I posted previously
(though I've tweaked them a little below). Here is how I originally set
up one of the rules (the difference between them is the substitution of
'sub' for 'function')
If you are cutting and pasting from this post, note that I have added a
space in front of each regular expression. This leading space should not
be present when filling in the dialog box as this would certainly mess
things up. For example the first regular expression below begins with the ^
Function Begin: ^[ \t]*sub[ \t]+
This defines the start of a 'block' as a line beginning with zero or
more spaces or tabs, followed by the letters sub, then followed by one
or more spaces or tabs.
Function List Name: [a-zA-Z0-9_]+
The plugin expects the name to be on the same line as the sub keyword.
This regular expression follows on from the first, and catches a block
of one or more alphanumeric characters with no spaces - this text is
then displayed in the function list.
Function End: .*$
I think this allows for the existence of multi line function 'headers' -
not really applicable here, so this regular expression follows on from
the last and catches all remaining characters to the end of the line -
in MB this would be parameters, and thus these are not shown in the
function name in the list.
Separator Between: blank
No need for this in MB as far as I can see
Body Begin: blank
No need for this in MB as far as I can see
Body End: ^[ \t]*end[ \t]+sub[ \t]*
The end of the block is defined as a line beginning with zero or more
spaces or tabs, followed by the letters end, followed by one or more
spaces or tabs, followed by the letters sub, followed by zero or more
spaces or tabs.
The regular expressions here are slightly different from the ones in the
file I uploaded as in writing this I have thought of a couple of
instances that I hadn't considered - the use of keywords or variable
names beginning with 'sub', and the presence of a comment on the same
line as 'end sub'.
I hope this helps you make a bit more sense of the plugin.
Andy
e.j.h.polle wrote:
> Hi Andy,
>
>
> Thanks for your additions. As you might have seen (;-)), part of my
> tips 'n' tricks are based on tips you gave earlier on this list. If
> you do not mind, I would like to add the tip about compiling and
> linking from a MapBasic Project file as well - just to keep everything
> together.
>
> I am still fighting with this function list in Notepad++ though - I do
> not understand this plugin Jens Lorenz created based as it is on
> Regular Expressions.
>
> Which version of this plugin are you using, 1.2 or 2.0? And how did
> you get it to work?
>
> Cheers,
>
> Egge-Jan
>
>
I use it simply to quickly see that I spelled the keywords correctly. I
only use a couple of colors as a consequence; blue for keywords and
green for comments.
- Bill Thoen