:Subscript Help:

Subscript v1.1:

;###########################################################################################
;tag
:General:

 Subscript lists "Labels" (or "Tag" marks, according to settings) contained in an ".ahk",
  ".bat",  ".txt" script
 Select within the table, and program will use Editor (Active App) to locate selected line.
 Also operates on .BAT files, or (for :Headings . .) .txt,.txx files where Label has colon 
 ":" at the start of the line.
 HotKeys:
   [Alt][Ctrl]esc: 	exitapp
   [Alt][Ctrl]F10:	exitapp
   [Alt][Ctrl]f5:  	sendRaw `;###########################################################################################`n;tag`n
   [Shift]f5:   	Restore program list of Labels



:Install:

 UNZIP zip file to the directory from which the program will be run.
 Included in zip is "Anchor.ahk" which is needed by the program.

 With the use of a hotkey management program to provide a program-specific hotkey/macro set,
 program [Shift]+F5  to run Subscript.exe, (under Editor s/r), 

	+F5::Run, [Drive]:\[Path..]Subscript\Subscript.exe
 	
 or if Editor permits programmable Tools, call program within the Editor.

 Alternatively, Subscript can be run using a Desktop shortcut

 When first run, (from within an editor displaying a .txt,.bat,.ahk file), if an inappropriate
 or no subscript.ini file exists, the program will take a little time initially to create a 
 basic subscript.ini file.

 The default hotkey to display label/Tag lines is [Shift]+F5 (configurable in the ini file.)
;###########################################################################################
;tag
:Display:

If subscript is run while editing a file with an ".ahk", .txt or .bat extension, the program 
creates a Table listing "Labels:" or ":Headings"(or ";Tag" marks, according to  settings) 
contained in the ".ahk" or .txt or .bat script. Thesse are the default extensions, to which 
others can be added using "Setup Label/Tag" (Right-click Taskbar icon).

 If an Entry within the table is selected, the program will use the Editor (Active App) to 
 locate the Label (or ";Tag").
 Also operates on .BAT files or  .txt,.txx files(ie. for ":Headings" . . ), where Labels have 
 a colon ":" at the start of line.
 For .txt files which have not been pre-configured with a preceeding colon, ":...(Headings)",
 for Subscript to locate and store as "TAGS", selecting "@T-Colon>END" in the Table listing 
 will switch to lines which END with a colon, since these lines are often headings. 
 Selecting "@T-Colon>START" will restore the default start of line colon as TAGS.
 If additional file-extensions have been added, e.g. ".DOC", the options will be those 
 selected for .TXT extensions

 If the top entry in the table, "Reload List" is selected, or if the Hotkey (Default:[Shift]F5)
 is pressed when Label-List is displayed, the Label list will be updated.

 Selecting "SORT List ON/OFF" at the top of the table will toggle list-SORT option. 
 Default is SORT ON (ini file key: SortLst=1).
 When Label-List is displayed, select label using mouse or cursor keys. Typing a letter will
 move successively to each entry starting with the letter pressed. "Enter" selects label.

 Label-List also includes
 	" @TOP" 			- Goto top of file
 	" @SORT List On"	- Set display to "Sorted"
 	" @Reload List" 	- Create new Label-list
 	" @T-Colon>END" 	- Switch TAG-Colon to END/START of line (.TXT ONLY)
 	"~Bottom"			- Goto end of file
 	
 More sophisticated editors allow Syntax highlighting, which can be configured using Regex 
 to colour/highlight headings and labels like ":Heading", and "Heading:".
 Subscript can provide fast navigation to "labels:" and ":Headings" and ":Labels"

 For "Labels-List", the last 10 labels selected will be shown beneath " @TOP" in the table, 
 these "Prev-Labels" being stored under the "filename" edited, in SubscrTag.ini, which stores
 data for the last 20 files for which subscript was called. After the list of "Prev-Labels"
 there is an entry " ~~~~~~~Clr~Prev~", which if selected clears the "Previous-labels" listing
 from the subscript list and SubscrTag.ini file, (No alteration is made to the edited file).

 "Previous-Label" feature can be turned on/off by Right-clicking the Taskbar icon and 
 selecting "Setup Label/Tag".
 
 Note: 
 The more recent Prev-Labels are placed higher in the list, unless List is "SORT ON", in
 which case they are alphabetically listed.
 
 Only the settings for the Last 20 filenames are kept.
 
:"Label-Tag" List:

The program also provides a "Label-Tag" List to record 10 locations, which are saved and 
recalled for the last 20 edited filenames in which subscript was run.

The "Label-Tag" List (not to be confused with ";Tag" Labels which are physically written
into the file) is created by storing the line position (and current line content) when the 
Label-List is called, (using [Shift]F5).
To view the "Label-Tag" list, Hold down [Control] while Label-List is displayed.
While [Ctrl] is held down, press a number from 1 - 10 (0) to store the previous location in 
the file to the "Tag-No.". If, while [Ctrl] is held down, [Shift]+ No. is pressed, the Label 
SELECTED in the "Label-List" is transferred into "Label-Tag-No.". Note that even when [Ctrl] 
is held down, it is still possible to change the selected row in the "Label-List" using the 
keys: "Up/Down" or "Page-Up/Down" or the scroll-bar.

To jump to a position in the edited file stored as a "Label-Tag-No.", press ([Shift]+F5 to 
summon "Label-List", then) hold down [Ctrl] and press [Alt]+No. to go to Label-Tag-No. position. 
Do not hold down [Alt] and [Ctrl] keys down longer than is necessary. The program should 
respond quickly and Hotkeys ([Ctrl+[ALt]) will be picked up by the system/editor.

"Label-Tag" Hotkeys:   (Editor should be pre-configured for "Label-Tag" facilities to operate)
	
	[Ctrl]:	 			While Label-List is displayed, Hold down [Control] for "Tag" List
	Ctrl+[No.]:			When "Tag" List displayed, Stores current Line No. & Line content
	Ctrl+Alt+[No.]:  	When "Tag" List displayed, returns to Line stored in selected "Tag"
	Ctrl+Shift+[No.]:  	When "Tag" List displayed, stores label focused in Label-List into 
							"Tag-[No.]"
	
 Note: [No.] refers to a numeral in the range: 1,2,3,4,5,6,7,8,9,0

Tag-List contents will be stored to the ini file "SubscrTag.ini" under the current Filename 
being edited, and retrieved automatically if the same file is re-edited later,
(up to last 20 filenames limit).

If, while "Label-Tag" list is viewed, Ctrl+Shift+{NumPadAdd}, ie Ctrl-Shift-Grey+ is pressed,
Tag-List contents will be stored to the ini file "SubscrTag.ini".

Also, while "Label-Tag" list is displayed, pressing: Ctrl+Shift+{NumPadSub} or Ctrl-Shift-Grey-,
deletes ALL the Tags.

If the current_Filename section is stored in the ini file, exiting from subscript will cause
the ini filename section to be updated with the current Label-Tags if these were amended. If
the editor is run with the same file, the last stored Label-Tags for that file will be loaded,
(up to last 20 filenames limit).

If at the TOP of the file (Lines N0.1 OR 2), the "Label-Tag" list is displayed and the current
location (and contents) are stored to a Tag-No using Ctrl+[No.], the Line-No and contents
for that Tag-No. will be deleted. Similarly, if the row selected in the "Label-List" is:
	"@Reload List" or "@SORT List" or "@TOP" or "~~Bottom~~" or "~~~~~~~Clr~Prev~"
and [Ctrl]+[Shift]+No. is pressed to transfer Label in "Label List" to "Label-Tag" list, the
the "Tag No." will be cleared.


Note: 
Stored Line Nos. in the Label-Tag list will not be amended if lines above that position in the
file are added to or removed. 
The program assumes that the Editor does not automaically begin a String Search from the 
top of the file.

To move to a stored file position, a search on stored contents is applied, from currently 
20 lines prior to the stored line No., thus reducing the likelyhood of locating to an earlier 
duplicat string in the file matching the stored Search string.
Because of the subsequent stored content search (if stored line has more than 4 characters), 
errors can occur, especially for shorter lines, or if up to 75 characters at the start of the 
stored line is repeated in the file. 
The Label-Tag list should allow file search if EITHER Line No. OR Line Content OR BOTH
are stored in the Label-Tag list.
If the Search fails because the searched line has moved more than 20 lines higher in the file, 
perform a Backwards Search to relocate.

Using "Label-Tag" list switches program automatically to mode: "Persist_fast=2"

Subscript assumes that editors use [Ctrl]-F for "Find", but the "Label-Tag" list needs to be 
aware of the "Goto-Line" hotkey for each editor. The default is [Ctrl]+G.
When necessary, hotkeys to "unBlock" text can also be included in the subscript.ini file.

The subscript.ini file should be pre-configured for "Label-Tag" Line-No references to operate.
Setting the keys: "AutGotoKey= ??" (and "BlockClear= ??" if this is necessary) from the 
"Reconfigure Editor" option (Right-click Taskbar icon) enables the "Go To Line" hotkey which 
the program sends to the editor, to be changed from "[Ctrl]+g" (default).
If [Ctrl] is pressed while Label list is displayed in order to display "Label-Tag" list,
with an editor which has not been preconfigured, the program will present the "Re-Configure"
setup to add the editor presets to subscript.ini when subscript is run for the first time.

The Default for AutGotoKey is [Ctrl]+g (= ^g). If "Enter" is pressed on the Re-Configure box, 
AutGotoKey will be set to "0", disabling subscript "GoToLine" functions.

:HotKeys programmed into Subscript.ahk, (.exe)

	[Alt]+[Ctrl]+Esc: 	exit
	[Ctrl]+[Alt]+F10: 	exit
	[Alt]+[Ctrl]+F5: 	Write ";Tag" + Separator line
	[Shift]+F5: 		Show list of Labels / ";Tags" for Selection. Configurable.
	Escape:	or F10		Suspends subscript, hides program window or quits, to return to editor
						(program only suspended when "Persist_fast=2" or 1, or quits if =0)
	F1:					(If Label-List displayed) Run README.TXT help file 
 											Requires .txt file association
	
Note: If "Persist_fast"=2 in the .ini file, under [settings], (and Subscript was not launched 
from a shortcut previous to the Editor being called)
when the Editor is closed, or switched to a file which is not a configured extension,
".txt", ".bat", or ".ahk", subscript will be closed.

 As Long as the Editor "Title" carries the current .AHK  or .TXT or .BAT extension,
 Subscript should work with most editors.

:Operation

Click on item in List to jump to Subroutine Label/";Tag" 
Selecting "SORT List ON/OFF" will toggle list-SORT ON or OFF
For .ahk files, labels end with ":"
For .BAT files, label line starts with ":"
For .Txt and other files, label line start or end with ":" depending on selection made.

SetUp: Re-check Screen settings & select listing of "Labels" or ";Tag" marks.

This version includes a special facility to allow the hotkey [Ctrl]+R (Default)in EditPad Pro 
Editor, to call "Replace" prompt. (The Hotkey is re-settable in the INI file.)
The search string is then entered and the "Repeat Find" key,[Ctrl]-f, is then sent to the 
Editor.
(For EditPad, Tab characters change focus in the "Search & Replace" prompt to the 
"Replace With" entry pane, so Tabs in the "Search" string need to be replaced with [Shift]+Tab, 
allowing subscript to refine the search).

The "BIGNOTE" feature is now removed.


:INI File: - keys used:

[Settings]
InitConfigini=0		(Default=0), if =1: Adjust Table height for font & Screen Res.
Persist_fast=2		if =2   Subscript exits* when Editor/configured .Ext not Active window
			if =1  	is Persistant (TSR), with fast mode- but no SetTimer-(autoExit)
	(test only)	if =0  	prog is NOT Persistant, always rescan Editor, Exit after "Find"
labelscout=1		if =1 (Deflt), Use Labels ":", if = 0 - use ";Tag"
SortLst=1			if =1 (Deflt), Label-list sorted, if =0, unsorted
EndColon=0			TAG-Colon to START of line, if = 1 - use Line END
fontsize=10			Set according to preference
ScreenHeight=600	set by program
rowheight=17		set by program
winheightwaste=70	set by program

ALLPresetPrg=0_Default,other_editor,..	Lists Window title names for precofiured Editors
ALLPresetExt=.txt,.txx,.bat,.ahk, etc.	Lists configured file extensions
PrgPreset=(editor)			Title name for Active Editor

ConfigEdt=1		Enter "configure Subscript" when next run
SscrHKey=+F5		Subscript Hotkey

[0_Default]
PrgPrmpt=UnSpecified
PrgPreset=0_Default
AutGotoKey=0

[EditPad]
PrgPreset=other_editor			A word from window title for Active Editor
WinTitle=Editor_name
PrgPrmpt=General Editor:		Window description
AutGotoKey=!l				Keys sent to editor for "Goto-Line"
AutFindKey=^r				Keys sent to editor for "Find" (/+Replace) text
BlockClear={F8}{F7}{F7}{F8}^+{F9}

[...]
other Editors
;###########################################################################################
;tag

:INI Keys:

Hotkey characters used within subscript.ini for "Goto-Line", "Clear-Block" and "Find"
and Hotkey:

[Alt] = !`, [Shift] = +`, [Ctrl] = ^, [WIN] key = #, F1 - F12 = {F1} - {F12}

Note:  if AutGotoKey = 0 program presets to ^g  (i.e. [Ctrl]+g)
Note:  if AutFindKey = 0 program presets to ^f  (i.e. [Ctrl]+f), or ^r for EditPad
The defaults are used when keys are missing from the .ini file

;###########################################################################################
;tag
:Special Mod:

The normal "Setup Label/Tag" (right-click Taskbar icon) uses Labels, NOT "Tags". 
Label-List does not require any changes to be made to the edited file.

There is support for .BAT, text file (labels) ":Headings", and ".AHK" "labels:"

".TXT" file labels of the form "A:{Tab}?????",":B:{Tab}?????","B:?????"... etc are also 
accepted.
In ALL cases, {Tab} characters are automatically removed from Search text.

File labels of the form ":????? {Tab} ;Comment",or "B:{Tab}????? ;Comment" or 
"?????:{Tab};Comment"... etc. are also accepted for the editors tested.
However, because editor "Find" windows often cycle through different controls
(e.g. buttons, Replace panel etc.), 1 or more tabs at the start of a line, or 
mid-line TABs in a search line would normally fail for many editors which would
cycle through controls. For this reason, subscript searches on a substring between Tabs 
and searches may fail if the substring is duplicated in the file.

(For EditPad, Tabs are replaced with [Shift]+Tab allowing subscript to refine the search).

;###########################################################################################
;tag
Original Program:		(Employed ";tag" lines written into file for search)

        Uses ";tag" as the key to jump to a sub/routine
  	Ctrl+ALT+F5 will insert one whereever it is needed. (NOTE: THIS ALTERS THE FILE!)
	whatever is on the next line after ";tag", is displayed in the subscript window.
        "BIGNOTE" facility. (Now removed)
 
Original program from www.autohotkey.com:

	language:       english
	platform:       win9x/nt/xp/vista
	author:         Trubbleguy <trubbleguy@trubbleguy.com> 
	November 21 2007

