!ReadMe for programming stuff
=============================

This file relates to the contents of the 'BASIC' and 'C'  directories.

Purpose
-------
Provide an editing environment which :
  a) is slightly more consistant (it's a little like TWIN :-) )
  b) looks like StrongEd's focal point moving insertions
  c) is more fun, and something else to swear at


Installation
------------
Add the data at the bottom to the Keys file.
Add the Scripts directory to the real scripts directory.


Usage
-----
In C mode :
  Shift-Home will trigger the special automated functions, with the following
  keys -
    E = 'if () {} else {}' structure. Return moves you to the true part.
    I = 'if () {}' structure. Return moves you to the true part.
    S = 'switch () { case }' structure. Return moves you to the case value,
        second return moves you to the case action.
    W = 'while () {}' structure. Return moves you to the iterated section.

In Basic mode :
  Shift-Home will trigger the special automated functions, with the following
  keys -
    C = 'CASE WHEN' structure. Return moves to the when value, second moves
        you to the action.
    E = 'IF THEN ELSE ENDIF' structure. Return moves you to the true part.
    I = 'IF THEN ENDIF' structure. Return moves you to the true part.
    F = 'DEFFN' structure. No return effect
    P = 'DEFPROC' structure. No return effect
    R = 'REPEAT UNTIL' structure. No return effect
    W = 'WHILE ENDWHILE' structure. Return moves you to the iterated section.

In a moving focus section (when return would move you elsewhere), Escape and
keypad Enter will cancel immediately. Left/right work, Shift-left/right work,
Ctrl-left/right work (but restrict you to the bracket you are in, if any),
Ctrl-C to copy a region works, delete works, normal keys work. Any special
functions are disabled until we drop back to normal mode.


Note
----
I've used all the 'old-style' commands here rather than the more useful
new extensions. Why ? Because I'm still using Beta 3 zap structure, with
a beta 6 Zap module (and a beta 8 mode4 compiled in). I've not had chance
to upgrade yet. As such, these commands might be better written. However,
it would be nice if these extensions were available to people in case they
are interested in them.

Yes, I've based it on TWIN. I just couldn't help it. I saw the groovey
feature and thought - 'hey, cool'. I have some similar macros for function
headers and such like, but this is nicer and also allows you to jump around
the text a little more, making it slightly more intuitive.


For the Keys file :
-------------------

--8<--------
sHOME		&11E	KEYMAP 7

Justin Fletcher's Structure maps (Based on, of all things, TWIN) :
Structures      &407    &040    &090    Programming structures
Jump block      &408    &000    &1FF    Jump in and out of blocks

7: Programming structures

c               &70063  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Case"":BASEMAP 8"
C               &70043  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Case"":BASEMAP 8"
e               &70065  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Else"":BASEMAP 8":MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.Else"":BASEMAP 8"
E               &70045  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Else"":BASEMAP 8":MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.Else"":BASEMAP 8"
i               &70069  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.If"":BASEMAP 8":MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.If"":BASEMAP 8"
I               &70049  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.If"":BASEMAP 8":MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.If"":BASEMAP 8"
f               &70066  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Func"""
F               &70046  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Func"""
p               &70070  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Proc"""
P               &70050  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Proc"""
r               &70072  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Repeat"""
R               &70052  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.Repeat"""
s               &70073  MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.Switch"":BASEMAP 8"
S               &70053  MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.Switch"":BASEMAP 8"
w               &70077  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.While"":BASEMAP 8":MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.While"":BASEMAP 8"
W               &70057  MJE_IFMODE "BASIC:RUNSCRIPT ""<ZapScripts$Dir>.Basic.While"":BASEMAP 8":MJE_IFMODE "C:RUNSCRIPT ""<ZapScripts$Dir>.C.While"":BASEMAP 8"

8: Jump blocks - these prevent you moving out of the block until you hit return.
                 escape and keypad enter will kill this entry mode dead.
                 If you hit return, you will be moved to the next  (or $$ in
                 BASIC mode) and if the next symbol is not the same you will
                 drop back to 'normal' editing mode.
cC		&80003	COPYSEL
RETURN          &8001D  MJE_IFMODE "BASIC!:SEARCHFORWARD """":DELETE:JRF_IF ""..DELETENEXT.BASEMAP 0""":MJE_IFMODE "BASIC:SEARCHFORWARD ""$$"":DELETE:DELETE:JRF_IF "".$.DELETENEXT.BASEMAP 0"""
Ascii chars	&80020-8007E	*&20
DELETE		&8007F	DELETE
<-|		&8001C	DELETE
Ascii chars	&80080-800FF	*&80
LEFT 		&8018C	LEFT
RIGHT		&8018D	RIGHT
sLEFT		&8019C	SLEFT
sRIGHT		&8019D	SRIGHT
cLEFT		&801AC	SEARCHBACK "\((\|\<\)"
cRIGHT		&801AD	SEARCHFORWARD "\()\|\>\)":LEFT:JRF_IF ".).NULL.RIGHT"
kENTER		&80166	BASEMAP 1
ESCAPE		&8001B	BASEMAP 1
--8<--------
