Ok people this guide is here only for the hardcore among you who REALLY want to
have a code explorer for Uniface code and will do just about anything to get
one. It is NOT a pretty solution at all.

This required some hex editing so ALWAYS work only on a backup of your exe file.
Even when it works, save the original, just in case. I absolutely will not be
responsible for the damage you could do to your PSPad install if you mess this
up.

I did this using program version 4.5.3 (2262). Look in Help>About to ensure you
have the same version. If you're using a different version you should either:

1. Give up now if you're not familiar with hex editing.
2. Ignore any hex file positions I mention below and use search (CTRL-F) to find
the text I mention instead. There should only be one occurrence of each text
string so make sure another cannot be found before you do any editing.

What you need to do is alter the Kixtart code explorer definition so it works
for uniface. The reasons for choosing this are that:

1. Kixtart has the same number of letters as Uniface. This is important when hex
editing as you cannot add/remove characters.
2. Kixtart has the equivalent of a uniface entry, called a function .
3. Kixtart is a language I despise and would never willingly use. If I ever do,
I'll edit in notepad or something.

Here's a step-by-step guide of what to do:

1. Back up your PSPad.exe file.

2. Open the PSPad.exe you intend to edit either in a hex editor or using the
backed-up PSPad.exe in hex editing mode. You will not be able to use the same
copy of PSPad.exe to edit itself so don't bother trying.

3. Go to the Settings>Highlighter Settings menu and find an available User
Highlighter slot. Set this to use the Uniface user highlighter that comes with
PSPad as default.

4. Go to position _002353e1 _in the PSPad.exe file (press CTRL-G and enter
_$002353e1_ if editing via PSPad). You should see the following chars:
function\s+(.*)
This is the regular expression that determines what is a kixstart function. We
need our uniface expression to be the same number of chars so carefully change
it to the following:
\s*entry\s+(.*)

5. Go to position _00157ea0 _where you should see the text
Kixtart. Change this carefully to Uniface  and save
the file.

6. Run your edited Pspad.exe. If you edited it properly it will open normally.
Open some uniface code or paste some in then select View>Change Syntax from the
menu.

7. There should now be two entries called Uniface (one in the main highlighter
section at the top and one in the user highlighters at the bottom). Choose the
first one.

Behold, you now have a code explorer definition for Uniface. An interesting
bonus feature is that you should have two definition types - Function lists each
function and External lists each function call (as coincidentally, call is also
a Kixtart keyword).

You may have luck managing to do this for other languages too - like me, you'd
need to find a predefined language you will never use, locate the position of
the regex definitions and the language name in the file and edit them both
keeping the same number of chars (to pad a regex with extra chars, try using
ZZZZZ* as spaces will not work). Please don't ask me to do it for you as the
answer will be NO! Without access to the source code, it took me long enough to
find the hex positions to do this for Uniface.

The most interesting thing to note from this approach is that the code explorer
does indeed use regular expressions to determine the function/variable
definitions in the code. Jan, is there any reason these could not be moved out
to user-configurable files in a later release?

Good luck,
Evil Overlord

-- 
<http://forum.pspad.com/read.php?2,39581,39655>
PSPad freeware editor http://www.pspad.com

Odpovedet emailem